[Webkit-unassigned] [Bug 266894] 'getElementsByName' not work on non-HTML namespaces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 27 00:39:44 PST 2023


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

Karl Dubost <karlcow at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |annevk at annevk.nl,
                   |                            |karlcow at apple.com

--- Comment #1 from Karl Dubost <karlcow at apple.com> ---
text of the spec:
===========
The getElementsByName(elementName) method steps are 
to return a live NodeList containing all the HTML elements 
in that document that have a name attribute 
whose value is identical to the elementName argument, in tree order. 
When the method is invoked on a Document object again with the same argument, 
the user agent may return the same as the object returned by the earlier call. 
In other cases, a new NodeList object must be returned.
===========

And

===========
  NodeList getElementsByName(DOMString elementName);
  readonly attribute HTMLOrSVGScriptElement? currentScript; // classic scripts in a document tree only

https://html.spec.whatwg.org/multipage/dom.html#the-document-object:dom-document-getelementsbyname
===========


The test is 
https://github.com/web-platform-tests/wpt/blob/58d32991e2/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-namespace.html

# Safari

> document.getElementsByName("math")
< NodeList [<p>, <math>] (2)

> document.getElementsByName("math")[0]
< <p name="math">…</p>

> document.getElementsByName("svg")
< NodeList [<p>, <svg>] (2)

> document.getElementsByName("svg")[0]
< <p name="svg">…</p>

# Firefox

> document.getElementsByName("math")
< NodeList [ p ]

> document.getElementsByName("math")[0]
< <p name="math">

> document.getElementsByName("svg")
< NodeList [ p ]

> document.getElementsByName("svg")[0]
< <p name="svg">

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20231227/c7f0cfc2/attachment.htm>


More information about the webkit-unassigned mailing list