Open Bug 2053472 Opened 4 months ago Updated 11 hours ago

Out of order streaming with <template for>

Categories

(Core :: DOM: HTML Parser, task)

task

Tracking

()

REOPENED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: noam.j.rosenthal, Assigned: helmut)

References

(Blocks 2 open bugs)

Details

(Keywords: parity-chrome)

Attachments

(2 external files, 1 obsolete file)

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

Steps to reproduce:

See https://github.com/whatwg/html/pull/11818 and https://github.com/mozilla/standards-positions/issues/1369

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Security' component, but is not confident enough to move the bug to that component.

Component: Untriaged → General
User Story: (updated)
Keywords: web-feature
Type: enhancement → task
Component: General → DOM: HTML Parser
Product: Firefox → Core
User Story: (updated)

Add a dom.template_for.enabled pref (default off) implementing the
declarative partial updates proposal:

  • Parse pref-gated HTML <?...> bogus comments as ProcessingInstruction
    nodes so <?marker>, <?start> and <?end> patch targets exist in the
    DOM, and serialize HTML processing instructions with "?>".
  • Give HTMLTemplateElement an htmlFor reflection of the for attribute
    plus marker lookup and patching state. A parser-inserted
    <template for> removes the old content between the markers, redirects
    parser output into the target before the end marker, and drops the
    markers when the template element is popped.
  • Suppress patching when the parsed fragment will be sanitized after
    parsing, so setHTML and setHTMLUnsafe with a sanitizer cannot patch
    content the sanitizer would have removed. When the sanitizer runs
    while parsing, it already sees tokens before patching.
  • Update the template-for WPT metadata: enable the prefs, drop the
    feature-off expectations, and document the remaining expected
    failures: missing stream/setter APIs, the pagehide timing spec gap
    (whatwg/html#13036), and three upstream test issues.

Working on this - implementation is up for review as https://phabricator.services.mozilla.com/D331109, behind the dom.template_for.enabled pref (off by default). The HTML parser changes go through the upstream htmlparser repo first: https://github.com/validator/htmlparser/pull/130.

Assignee: nobody → helmut
Attachment #9653523 - Attachment description: WIP: Bug 2053472 - Implement out-of-order streaming with <template for> → Bug 2053472 - Implement out-of-order streaming with <template for>
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Add the dom.template_for.enabled pref (default off, on in fuzzing
builds) and reflect the template "for" content attribute as
HTMLTemplateElement.htmlFor, gated on the pref. Import the upstream
reflect-html-for WPT.

This is the IDL surface for out-of-order streaming with <template for>;
the parser and patching land on top.

Attachment #9653523 - Attachment description: Bug 2053472 - Implement out-of-order streaming with <template for> → WIP: Bug 2053472 - Implement <template for> out-of-order streaming patching
Attachment #9661207 - Attachment description: WIP: Bug 2053472 - Add dom.template_for.enabled pref and HTMLTemplateElement.htmlFor → Bug 2053472 - Add dom.template_for.enabled pref and HTMLTemplateElement.htmlFor
Attachment #9653523 - Attachment description: WIP: Bug 2053472 - Implement <template for> out-of-order streaming patching → Bug 2053472 - Implement <template for> out-of-order streaming patching
Attachment #9661207 - Attachment description: Bug 2053472 - Add dom.template_for.enabled pref and HTMLTemplateElement.htmlFor → Bug 2053472 - Add dom.template_for.enabled pref and HTMLTemplateElement.htmlFor r=keithamus
Attachment #9653523 - Attachment description: Bug 2053472 - Implement <template for> out-of-order streaming patching → Bug 2053472 - Implement <template for> out-of-order streaming patching r=keithamus
Attachment #9661207 - Attachment description: Bug 2053472 - Add dom.template_for.enabled pref and HTMLTemplateElement.htmlFor r=keithamus → Bug 2053472 - Add dom.template-for.enabled pref and HTMLTemplateElement.htmlFor r=keithamus
Attachment #9661614 - Attachment is obsolete: true
Pushed by kcirkel@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/125777bd7b86 https://hg.mozilla.org/integration/autoland/rev/133026a3835d Add dom.template-for.enabled pref and HTMLTemplateElement.htmlFor r=webidl,keithamus,smaug
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch

Bug was resolved, but the web-feature template-for (definition file) is not yet marked as supported in Firefox.

Feature bugs are usually automatically closed once the corresponding web-features are marked as supported; this typically happens after the feature reaches release.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blocks: 2083283

I've moved the web-feature metadata to a meta bug for the bot to track, so we can re-close this one.

Status: REOPENED → RESOLVED
Closed: 1 month ago → 1 month ago
User Story: (updated)
Keywords: web-feature
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blocks: 2082304
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: