Closed Bug 1899532 Opened 5 months ago Closed 5 months ago

Instance of checks fail for HTML elements moved into child windows

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 126
defect

Tracking

()

RESOLVED DUPLICATE of bug 1470017

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".

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.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core

Unfortunately, this is due to the (non-standard) re-parenting steps we currently perform when adopting an element across documents.

Status: UNCONFIRMED → NEW
Depends on: 1502814
Ever confirmed: true
Status: NEW → RESOLVED
Closed: 5 months ago
No longer depends on: 1502814
Duplicate of bug: 1470017
Resolution: --- → DUPLICATE
See Also: → 1502814
You need to log in before you can comment on or make changes to this bug.