Skip to content

Add parser tests for template and the frameset-ok flag - #62485

Merged
annevk merged 1 commit into
masterfrom
html-template-frameset-ok
Sep 7, 2026
Merged

annevk merged 1 commit into
masterfrom
html-template-frameset-ok

Conversation

@annevk

@annevk annevk commented Sep 5, 2026

Copy link
Copy Markdown
Member

@annevk
annevk merged commit bc92608 into master Sep 7, 2026
29 checks passed
@annevk
annevk deleted the html-template-frameset-ok branch September 7, 2026 13:18
annevk added a commit to whatwg/html that referenced this pull request Sep 7, 2026
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants