[Webkit-unassigned] [Bug 246899] New: DOM api document.adoptNode doesn't assign ownerDocument correctly
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 21 23:36:46 PDT 2022
https://bugs.webkit.org/show_bug.cgi?id=246899
Bug ID: 246899
Summary: DOM api document.adoptNode doesn't assign
ownerDocument correctly
Product: WebKit
Version: Safari 16
Hardware: All
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: DOM
Assignee: webkit-unassigned at lists.webkit.org
Reporter: huocp at me.com
Safari 16+ (including 16.1 beta and Safari Technology Preview) seems didn't assign ownerDocument correctly in DOM api document.adoptNode.
Reproducible on both mac and iPhone.
In Safari 16+ browser console, reproduce it with following code:
> const div = document.createElement('div')
div.innerHTML = '<template><p></p></template>';
const fragment = div.firstChild.content;
< "<template><p></p></template>"
> fragment.ownerDocument.documentElement
< null
> document.adoptNode(fragment);
< Document Fragment
> fragment.ownerDocument.documentElement
< null
In comparison, in other browser (Chrome, Firefox or older Safari), the ownerDocument is assigned after adoptNode.
> const div = document.createElement('div')
div.innerHTML = '<template><p></p></template>';
const fragment = div.firstChild.content;
< '<template><p></p></template>'
> fragment.ownerDocument.documentElement
< null
> document.adoptNode(fragment);
< #document-fragment
> fragment.ownerDocument.documentElement
< <html ...>
--
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/20221022/bbd8e55a/attachment.htm>
More information about the webkit-unassigned
mailing list