Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upText control selections API conformance #19171
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
Did the previous PR solve part of this? |
|
No, it did not. |
|
Hi, I'd like to have a go at working on this. I've not contributed to servo before so please bear with me... I've established that the |
|
PR submitted for firing the event. Once it is approved I could look into other related issues (e.g. the remaining failing tests, also the spec says that the event should only fire if the selection has actually changed). |
Issue servo#19171
Fire 'select' event in SetSelection{Start,End}
See #19171.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19202)
<!-- Reviewable:end -->
|
I think this assertion (and the other related assertions in other tests) is not correct per the spec. The spec says:
Further down, it then says:
The assertion in the test is checking that the text entry cursor is at the end of the control, however. I made a quick test to check the behaviour in other browsers. Both Firefox and Chromium print So I think the test needs to change, but I'm just checking to see if I have missed something? |
|
Sorry, I'm incorrect because the value is set via JS, therefore step 5 from here applies:
|
Further changes in relation to #19171 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19272) <!-- Reviewable:end -->
Issue servo#19171
Move selection to end when textarea value is assigned Issue #19171 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19358) <!-- Reviewable:end -->
Issue servo#19171
Move selection to end when textarea value is assigned Issue #19171 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19358) <!-- Reviewable:end -->
|
Latest PR: #19461 (I forgot to ref this issue there) |
|
@highfive: assign me |
|
It looks like this has already been assigned to someone. I'll leave the decision to a core contributor. |
Issue servo#19171
Issue servo#19171
|
Once #19544 is merged, the only remaining thing that I'm aware of is steps 7-9 of the input type change algorithm. I can't see any existing WPT tests for that so will need to add some I think. |
|
Actually, I have just added another commit on that PR which deals with the above, so I think we can close this issue once the PR is merged. |
Issue servo#19171
Issue servo#19171
Text selection API conformance This is my next batch of changes for issue #19171. All the tests in tests/wpt/metadata/html/semantics/forms/textfieldselection/ are now passing (and also some tests outside of there). I've made detailed notes about the changes in each commit message. r? @KiChjang <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19544) <!-- Reviewable:end -->
Issue servo#19171
Text selection API conformance This is my next batch of changes for issue #19171. All the tests in tests/wpt/metadata/html/semantics/forms/textfieldselection/ are now passing (and also some tests outside of there). I've made detailed notes about the changes in each commit message. r? @KiChjang <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19544) <!-- Reviewable:end -->
|
@KiChjang this can be closed now! |
We currently have WebIDL bindings to the
selectionStart,selectionEndandselectionRangesetter functions on the HTMLInputElement, but these setters do not follow the spec completely since they do not fireselectevents on the input element when they are called.In addition, we should also check that the code for these setters are matching the steps as outlined in the spec.
Code:
components/script/dom/htmlinputelement.rsSpec: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea%2Finput-selectionstart
Test:
tests/wpt/web-platform-tests/html/semantics/forms/textfieldselection/selection-start-end.htmlEDIT: Since @jonleighton has taken this up and focused their efforts on ensuring conformance of both HTMLInputElement and HTMLTextAreaElement selections API, the scope of this issue has been expanded accordingly.