Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize frame/iframe insertion and removal #9906

Merged
merged 2 commits into from
Nov 6, 2023
Merged

Conversation

domenic
Copy link
Member

@domenic domenic commented Nov 2, 2023

As noted in #9148 (comment), frame's processing model has not kept up with iframe's. It defined an "active frame element" concept which resulted in action-at-a-distance whenever the browsing context was cleared, which is hard to reason about. Instead, we can have it mimick iframe and have explicit actions on insertion and removal.

Additionally, iframe itself was not using the most-modern techniques for handling insertion and removal. This updates both iframe and frame to use "HTML element insertion steps" and "HTML element removal steps".

Finally, this makes the normative change of processing iframes when they are in shadow DOM. For some reason the specification was only handling them when they were in a document tree. frame elements are left as only handled when in a document tree.


/iframe-embed-object.html ( diff )
/obsolete.html ( diff )

As noted in #9148 (comment), frame's processing model has not kept up with iframe's. It defined an "active frame element" concept which resulted in action-at-a-distance whenever the browsing context was cleared, which is hard to reason about. Instead, we can have it mimick iframe and have explicit actions on insertion and removal.

Additionally, iframe itself was not using the most-modern techniques for handling insertion and removal. This updates both iframe and frame to use "HTML element insertion steps" and "HTML element removal steps".

Finally, this makes the normative change of processing iframes when they are in shadow DOM. For some reason the specification was only handling them when they were in a document tree. frame elements are left as only handled when in a document tree.
@domenic domenic added topic: shadow Relates to shadow trees (as defined in DOM) topic: browsing context labels Nov 2, 2023
@domenic domenic requested a review from annevk November 2, 2023 07:07
@annevk
Copy link
Member

annevk commented Nov 2, 2023

Not handling them for shadow trees is "intentional" as #763 is still open.

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but let's add an XXX marker for that open issue around shadow trees while here.

@domenic domenic merged commit 5c4846d into main Nov 6, 2023
2 checks passed
@domenic domenic deleted the frame-element-removal branch November 6, 2023 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: browsing context topic: shadow Relates to shadow trees (as defined in DOM)
Development

Successfully merging this pull request may close these issues.

2 participants