DescriptionUse union types for HTMLSelectElement.add()'s arguments
According to the specification, the first argument should be
(HTMLOptionElement or HTMLOptGroupElement)
and the second argument should be
(HTMLElement or long)?
(and also be optional and default to null).
This changes behavior for the first argument (previously HTMLElement)
where a call was a silent no-op for invalid element types, and where
HTMLHRElement was allowed against the specification and with no
observable effects.
The new behavior is to throw TypeError for all invalid arguments, which is
compatible with Firefox and MSIE.
Also apply the same change to HTMLOptionsCollection.add(), which is little
more than a short-hand for calling add() on the owning select element.
Also drop the custom bindings implementation for that method, which was
essentially implementing the unionized second argument.
The behavior of HTMLOptionsCollection.add() is changed to ignore all
invalid (out of range) integer second arguments, rather than to throw for
negative ones below than -1. This change is also per specification and
compatible with other implementations.
BUG=430337
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185199
Patch Set 1 #
Total comments: 1
Patch Set 2 : simplify HTMLSelectElement::setLength() #Patch Set 3 : don't include GlobalEventHandlers.h in UnionTypes*.cpp #
Total comments: 2
Patch Set 4 : added FIXME #Messages
Total messages: 18 (4 generated)
|