Instance of checks fail for HTML elements moved into child windows
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
People
(Reporter: benjpas, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Steps to reproduce:
Open https://bpasero.github.io/firefox-element-owner/ and click the button to open a new window. Notice how "false" is printed in the console. In other browsers, "true" is printed.
Actual results:
Sources are at https://github.com/bpasero/firefox-element-owner/blob/main/index.html. There is a "console.log(container instanceof HTMLElement);" which reports "false" even though the element was created on the main global window.
Expected results:
Like other browsers, I would have expected the instanceof check to return "true".
Comment 1•5 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•5 months ago
|
||
Unfortunately, this is due to the (non-standard) re-parenting steps we currently perform when adopting an element across documents.
Updated•5 months ago
|
Description
•