-
Notifications
You must be signed in to change notification settings - Fork 9
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
innerText should be supported for the <option> elements in a <select> #5
Comments
I think we need to modify the spec to say that for the purposes of this algorithm, |
@zcorpan is upstreaming this spec in whatwg/html#1678 so I think those changes should probably be applied there and this version retired. |
The proposed change sounds good to me - thanks. |
Tests: I believe the behavior of Chromium is non-sensical and inconsistent, I think we shouldn't spec it. It appears the Gecko people reached the same conclusion and didn't want to copy it. It looks like IE and Edge almost match the new behavior of Gecko. IE/Edge (edit: up to and including 14.14300 but not 14.14393; see comment below) behave like |
When considering a |
That is fine reasoning but I believe we also need to consider if Edge is able to change this. Edge/IE has had this API and the same behavior since like forever, as far as I can tell. Gecko implemented the new behavior a few days ago. :-) |
Sure, that's a fair question. Though considering the wide variation in behavior we currently see among browsers, it seems unlikely that much of the web is dependent on this. |
Yeah. (I'm trying to test some more to help inform what to do here.) It appears that I suggest we specify Gecko's behavior for this issue (at least until new information suggests we need to do something else). Separately we should figure out what the default styles for |
Hmmm, @domenic tested Edge 14 ( If this was a recent change in Edge, would be interesting to know what caused the change |
It doesn't completely match Chrome; the second |
Ah yes, sorry. It does match WebKit Technology Preview though. |
The WebKit/Edge 14.14393 behavior can be explained (in the spec) by |
We rewrote our select control for Edge 14 primarily for accessibility reasons but we also wanted to open it up a bit more for styling as it is a common request from webdevs. Any API changes are probably a result of that work, specific changes I would need to look through all of the changelists to track down what changed and why. Here's a testcase, try it in Edge 13/IE in comparison to Edge 14: http://jsbin.com/yugonaduva/edit?html,output |
Thanks for the info @gregwhitworth! So maybe it was accidental that it changed Also cc-ing @tkent-google, @cdumez |
`select` is a replaced element, but for Web compat we need to include the text of `option` elements in innerText. The new text is intended to match the behavior of Gecko, which in turn is very close to the legacy IE/Edge behavior. Fixes rocallahan/innerText-spec#5
Please see PR at whatwg/html#1717 |
`select` is a replaced element, but for Web compat we need to include the text of `option` elements in innerText. The new text is intended to match the behavior of Gecko, which in turn is very close to the legacy IE/Edge behavior. Fixes rocallahan/innerText-spec#5
<select> is a replaced element, but for Web compat we need to include the text of <option> elements in innerText. The new text is intended to match the behavior of Gecko, which in turn is very close to the legacy IE/Edge behavior. Fixes rocallahan/innerText-spec#5.
This issue can be closed now |
<select> is a replaced element, but for Web compat we need to include the text of <option> elements in innerText. The new text is intended to match the behavior of Gecko, which in turn is very close to the legacy IE/Edge behavior. Fixes rocallahan/innerText-spec#5.
I think the
<option>
descendants of a<select>
should be able to return their text, just like<button>
can. (See note about replaced elements in the section on Getting innerText.)According to bug 1290937 this is required for web compatibility, and both Chrome and Edge apparently support it. (I didn't test Edge personally.)
In addition, once the
<option>
elements support innerText, the only reasonable behavior (IMO) for the parent<select>
is to return the concatenated list of innerTexts of its children.In bug 1290937, we're fixing Gecko to implement these changes (and updating the web-platform tests accordingly).
(Blink currently returns empty for the
<select>
's innerText, even when it returns the actual text for an<option>
within it, but I've filed a Chromium issue about that.)The text was updated successfully, but these errors were encountered: