DescriptionMake HTMLOptionsCollection's named property getter behave more according to spec
Make HTMLOptionsCollection's named property getter behave more according to spec:
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmloptionscollection
The changes are:
- namedGetter() method should be marked as a named property getter in IDL. As a
result, we can remove the anonymous named property getter from our IDL.
- namedGetter() argument is now mandatory. This is consistent with Firefox 27
and other HTML Collections' namedGetter. The argument is optional in IE11
though.
- The named getter should be enumerable as per Web IDL, meaning that
elements id / names should be enumerated. The supported property names
are spec'd at:
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmloptionscollection
This is consistent with the behavior of Firefox 27. In IE11,
HTMLSelectElement.options seems to return an HTMLSelectElement instead of
an HTMLOptionsCollection.
This CL also gets rid of the custom bindings code for the named property getter
as our bindings generator now has better support for returning union types.
The named property getter still does not completely match the specification
though (or the behavior of Firefox 27). It is supposed to always return the
first matching Element. However, in case of duplicates, we currently return a
NodeList type containing all matching Elements. I did not change this behavior
as this was our previous behavior and IE11 also seems to return all matching
Elements in this case.
R=haraken, arv, tkent
BUG=341269
TEST=fast/dom/htmloptionscollection-enumerated-properties.html
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=166976
Patch Set 1 #Patch Set 2 : Update copyright #Patch Set 3 : Fix tiny typo #
Messages
Total messages: 7 (0 generated)
|