Closed Bug 1888296 Opened 6 months ago Closed 6 months ago

Adding an element to a different document changes the constructor

Categories

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

Firefox 124
defect

Tracking

()

RESOLVED DUPLICATE of bug 1470017

People

(Reporter: firefox, Unassigned)

Details

Attachments

(1 file)

Steps to reproduce:

  1. Open the inspector console
  2. Open the attached html file

The sample html file creates a video element in an about:blank iframe and then appends the video to the body of the main frame. When the element changes documents, Firefox changes the video's constructor to the HTMLVideoElement associated with the main frame rather than the iframe. This differs from Chrome and Safari, which preserve the element's original constructor.

This behavior is not specific to videos; itoccurs with any element type.

I don't know whether this is technically a bug. Perhaps it's undefined behavior by the HTML spec? It's certainly an inconsistency between the web browsers.

Actual results:

top constructor? false
iframe constructor? true
top constructor? false
iframe constructor? true

Expected results:

top constructor? false
iframe constructor? true
top constructor? true
iframe constructor? false

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Component: Audio/Video: Playback → DOM: Core & HTML

Unfortunately, this is a known issue, dating back to before this behaviour had been specified.

Status: UNCONFIRMED → RESOLVED
Closed: 6 months ago
Duplicate of bug: 1470017
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: