-
Notifications
You must be signed in to change notification settings - Fork 295
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
HTMLCollection.namedItem() vs supported property names #104
Comments
@bzbarsky (I hate asking you every time, if there's someone better, please let me know), it seems we should change Gecko to check the namespace for the |
Me again, this is small test case:
Firefox 45: Chrome 48: IE 11: I try research Web IDL to see what is corelation beetwen method and supported property names (if we use getter in IDL definition for method) but still have some question:
|
@annevk Not sure who would be better. Maybe @Ms2ger in some cases. Maybe Olli, but not sure what his Github account is. I had not realized that the handling of the "name" attribute in Hilariously, Gecko does check for HTML (though with some "XXX, is this part of the spec stable" comments) if you ask the object for its supported names directly. So for example:
logs, in Gecko:
In Chrome it logs:
which is at least self-consistent. In Safari it logs:
so it's got a buggy @ArkadiuszMichalski as far as your questions go:
|
Oh, and @annevk if/when the spec gets updated here please file a bug on Gecko to deal with this? Esp. if there are wpt tests too.. ;) |
Thx @bzbarsky, now it is more understandable, I had to finally ask:) Chrome: Firefox: IE11: Maybe for someone with the Chrome team this ifnos will be useful. |
@ArkadiuszMichalski would you be interested in working on https://github.com/w3c/web-platform-tests for these? It seems you already have some tests written, just need to wrap them in the JavaScript framework. |
I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1223716 against Gecko. |
@annevk not anytime soon, firstly I must read and learned how do this correctly, but when it happens I'll write them a little more for DOM, especially those where current browsers work differently. But if the matter is urgent then feel free to use all of my examples that I put here. |
I added some web platform tests in the Gecko patch, for what it's worth. |
@ArkadiuszMichalski alright, not a problem. If you have any questions feel free to drop by on https://wiki.whatwg.org/wiki/IRC. We're happy to help. |
At the beginning, in supported property names definition I see this:
"2.1. If element has an ID which is neither the empty string nor is in result, append element’s ID to result." << why this " empty string" exist here? We operate on ID (as concept, not
id
attribute) so it's possible that ID will ever be empty string?Second is about how this two definitions handle attribute name (for element in not HTML namespce), this is intentional? I see that Firefox and Chrome have different behaviour. In the middle I also try check IE11 but this browser has other problem (when we create element inside script it produces different results) so focus only Firefox and Chrome.
Firefox - works the same for
HTMLCollection.namedItem()
and[]
, treat all elements in the same way, without paying attention to the HTML namespace for element withname
attribute.Chrome - works the same for
HTMLCollection.namedItem()
and[]
, treat all elements in the same way, paying attention to the HTML namespace for element withname
attribute.And spec:
https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem
HTMLCollection.namedItem()
- without paying attention to the HTML namespace for element withname
attributehttps://dom.spec.whatwg.org/#dom-htmlcollection-item
Supported property names - paying attention to the HTML namespace for element with
name
attributeIt concerns only
name
attribute (content attribute),id
attribute (content attribute) works correct in Firefox and Chrome (as we have in DOM).The text was updated successfully, but these errors were encountered: