Open Bug 1907731 Opened 1 year ago Updated 1 year ago

Align node insertion with HTML & DOM Standard semantics

Categories

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

defect

Tracking

()

UNCONFIRMED

People

(Reporter: domfarolino, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

Steps to reproduce:

See https://github.com/whatwg/dom/issues/808 & https://github.com/whatwg/html/pull/10188.

We've aligned the DOM Standard's node insertion model to one that resembles Chrome + Firefox's, however there are a few small differences between Firefox's behavior and what the spec expects. Firefox fails a few tests listed under https://wpt.fyi/results/dom/nodes/insertion-removing-steps. There appear to be a few differences:

  • Firefox appears to not fire the iframe load event synchronously after insertion.
  • Firefox does not process <meta> elements in the post-connection steps, and we're pursuing https://github.com/whatwg/html/issues/10241 to make HTML do this, to align it with Blink & WebKit. See 1 specifically, for example.
  • Script-processing-specific changes: In https://github.com/whatwg/html/pull/10188 we update the script processing model to explicitly call the script post-connection steps from the child changed steps, and we do not block the execution of a "parent" script on any nested "children" scripts elements that get inserted at the same time. See 2

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
Severity: -- → S3

One interesting change here too that came up late is that Firefox seems to be the only browser that follows the old spec condition where, for non-parser-inserted scripts, we only "prepare" them in response to null => value src attribute assignments. Firefox (and the old spec, I believe) would not "prepare" non-parser-inserted scripts that experienced a value => value src attribute changes. Chrome and Safari would, however, so I've updated the HTML Standard to do the same.

The test is in https://chromium-review.googlesource.com/c/chromium/src/+/5809759.

You need to log in before you can comment on or make changes to this bug.