Skip to content

Reset frameset-ok when the body element is inserted implicitly - #12908

Open
annevk wants to merge 1 commit into
mainfrom
frameset-ok-implicit-body
Open

Reset frameset-ok when the body element is inserted implicitly#12908
annevk wants to merge 1 commit into
mainfrom
frameset-ok-implicit-body

Conversation

@annevk

@annevk annevk commented Sep 5, 2026

Copy link
Copy Markdown
Member

Reset frameset-ok when the body element is inserted implicitly

The <template> start tag sets the frameset-ok flag to "not ok" in the
"in head" insertion mode and nothing ever sets it back, so the standard
says the <frameset> is ignored in
<head><template></template></head><p><frameset>, whereas engines create
a frameset document. The same goes for anything inside a head-level
template that sets the flag, such as <template>x</template><p><frameset>.

The "after head" insertion mode's "anything else" entry now sets the flag
back to "ok" when it inserts the body element. Nothing seen up to that
point can have been body content; before template there was no way to set
the flag to "not ok" while still in the head, which is presumably why this
was missed.

A <frameset> inside a template stays ignored. The flag is read in exactly
one place, the <frameset> start tag in the "in body" insertion mode, and
it can now only be reset at the moment the body element is inserted. A
template element can never be on the stack of open elements at that moment,
so whenever a template is open and the second element on the stack of open
elements is a body element the flag is still "not ok".

Tests: web-platform-tests/wpt#62485

Fixes #3178.


(See WHATWG Working Mode: Changes for more details.)

The `<template>` start tag sets the frameset-ok flag to "not ok" in the
"in head" insertion mode and nothing ever sets it back, so the standard
says the `<frameset>` is ignored in
`<head><template></template></head><p><frameset>`, whereas engines create
a frameset document. The same goes for anything inside a head-level
template that sets the flag, such as `<template>x</template><p><frameset>`.

The "after head" insertion mode's "anything else" entry now sets the flag
back to "ok" when it inserts the body element. Nothing seen up to that
point can have been body content; before template there was no way to set
the flag to "not ok" while still in the head, which is presumably why this
was missed.

A `<frameset>` inside a template stays ignored. The flag is read in exactly
one place, the `<frameset>` start tag in the "in body" insertion mode, and
it can now only be reset at the moment the body element is inserted. A
template element can never be on the stack of open elements at that moment,
so whenever a template is open and the second element on the stack of open
elements is a body element the flag is still "not ok".

Tests: web-platform-tests/wpt#62485

Fixes #3178.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Should <head><template> set frameset-ok flag to "not ok"?

1 participant