Skip to content

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

Closed

Description

@zcorpan

https://html.spec.whatwg.org/multipage/parsing.html#scriptTag

A start tag whose tag name is "template"
Insert an HTML element for the token.

Insert a marker at the end of the list of active formatting elements.

Set the frameset-ok flag to "not ok".

See http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5470

<head><template></template></head><p><frameset>

AFAICT from the spec, the <template> start tag in "in head" sets frameset-ok to "not ok", then <p> in "after head" will insert a body element and switch to "in body" and reprocess the <p>, then the <frameset> in "in body" should be ignored because frameset-ok is "not ok".

Right?

Gecko/Chromium/WebKit/Edge end up with a frameset element in the DOM for the above, so maybe template-in-head shouldn't flip the flag.

cc @whatwg/html-parser

Activity

  1. added
    topic: parser
    on Oct 30, 2017
  2. inikulin commented on Oct 31, 2017

    @inikulin
    Member

    With such a change if we encounter a<frameset> in a <template> it will implicitly close the <template> and detach all nodes from the document up to the <html> element which doesn't feels right. It will be surprising and even concerning from the security perspective that <template> content can modify ambient AST in such a manner.

    BTW, how we determine which elements modify frameset-ok flag? From quick search in W3C mail archive it seems like it was just back-ported from IE.

  3. zcorpan commented on Oct 31, 2017

    @zcorpan
    MemberAuthor

    Right, frameset in template needs to be ignored.

    http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=5471

    How do browsers do this? Do they reset the flag for </template> "in head"? Or use more insertion modes instead of a flag?

    IIRC, frameset-ok was indeed modeled after mostly IE's behavior.

  4. added a commit that references this issue on Sep 7, 2026
    83c0aa8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: parser

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions