[Webkit-unassigned] [Bug 146566] REGRESSION (r178097): HTMLSelectElement.add(option, undefined) prepends option to the list of options; should append to the end of the list of options

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 2 20:18:57 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=146566

--- Comment #3 from Chris Dumez <cdumez at apple.com> ---
Relevant specs:
https://html.spec.whatwg.org/multipage/forms.html#dom-select-add

which points to:
https://html.spec.whatwg.org/multipage/infrastructure.html#dom-htmloptionscollection-add

which says in this case to call the DOM insertBefore() method on the parent node, with element as the first argument and null (in our case) as the second argument.

https://dom.spec.whatwg.org/#dom-node-insertbefore
->
https://dom.spec.whatwg.org/#concept-node-insert

"
For each newNode in nodes, in tree order, run these substeps:
1. Insert newNode into parent before child or at the end of parent if child is null.
2. Run the insertion steps with newNode.
"

Ok, so even though it is hard to follow, the spec does say to insert "at the end of parent if child is null".

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150703/641dee57/attachment-0001.html>


More information about the webkit-unassigned mailing list