-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Update selectedcontent in selectedness setting #11890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This PR makes sure that the contents of the selectedcontent element stay up to date when the selected option is changed in the selectedness setting algorithm. This issue was found here: web-platform-tests/wpt#55849 (comment)
| last <code>option</code> element with its <span | ||
| data-x="concept-option-selectedness">selectedness</span> set to true in the <span | ||
| data-x="concept-select-option-list">list of options</span> in <span>tree order</span> to | ||
| false.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reads a bit ambiguous to me. Maybe:
Set the selectedness of all option elements whose selectedness is true in the list of options to false, exception for the last one.
Perhaps it's okay as-is though. @zcorpan @domfarolino @noamr thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your proposed wording, but do we even need to specify the ones with selectedness to true? How about:
Set the selectedness of all option elements in the list of options to false, exception for the last one in tree order.
This should be the same, but is more concise, and keeps the tree order condition, which I think is nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not the same. If we have true, true, false we would go to false, false, false with your wording. Whereas we want false, true, false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I find it hard to read.
How about something like:
Let |options| be element's list of options.
Let |currentlySelectedOptions| be the options in |options| whose selectedness is true
... make the rest of the checks on |options" and on |currentlySelectedOptions|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's now also #12083 which is quite a bit clearer for this particular problem, but I'm not sure how it all relates anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I am going to make it a clearer algorithm. I think we can proceed in a couple different ways:
- Continue with this PR and 12083. I can deal with the merge conflicts for whichever gets merged first/second.
- Create a third PR which doesn't change behavior but changes this algorithm to make it easier to read and modify which doesn't change behavior. This PR and 12083 would be rebased on that one.
- Combine this PR with 12083 so there is only one PR.
Which would you prefer @annevk?
This PR makes sure that the contents of the selectedcontent element stay up to date when the selected option is changed in the selectedness setting algorithm.
This issue was found here: web-platform-tests/wpt#55849 (comment)
Fixes #11883 (comment)
(See WHATWG Working Mode: Changes for more details.)
/form-elements.html ( diff )