Bug 210111

Summary: documentFragment.getElementById() should not work for empty-string IDs
Product: WebKit Reporter: Domenic Denicola <d>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, esprehn+autocc, ews-watchlist, ggaren, kangil.han, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Domenic Denicola
Reported 2020-04-07 07:28:02 PDT
(This is tested using the bots on wpt.fyi; I do not have a Mac available in these working from home times.) URL: http://wpt.live/dom/nodes/DocumentFragment-getElementById.html Per spec, documentFragment.getElementById("") should return null, even if there is a <div id=""></div> inside the DocumentFragment. Safari passes the same test for document.getElementById(""): http://wpt.live/dom/nodes/Document-getElementById.html . Other browsers: Chrome fails, Firefox passes Spec reference: https://dom.spec.whatwg.org/#concept-id ("value is null or the empty string").
Attachments
Patch (6.18 KB, patch)
2020-04-07 10:28 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-04-07 10:28:44 PDT
Geoffrey Garen
Comment 2 2020-04-07 11:19:59 PDT
Comment on attachment 395702 [details] Patch r=me
EWS
Comment 3 2020-04-07 11:40:12 PDT
Committed r259651: <https://trac.webkit.org/changeset/259651> All reviewed patches have been landed. Closing bug and clearing flags on attachment 395702 [details].
Radar WebKit Bug Importer
Comment 4 2020-04-07 11:41:19 PDT
Note You need to log in before you can comment on or make changes to this bug.