[wpt-sync] Sync PR 62217 - Add parser tests for foster parenting into a template
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox156 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Attachments
(1 file)
|
68.02 KB,
text/plain
|
Details |
Sync web-platform-tests PR 62217 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/62217
Details from upstream follow.
Anne van Kesteren <annevk@annevk.nl> wrote:
Add parser tests for foster parenting into a template
Three foster parenting paths that had no coverage. Found while reviewing https://github.com/whatwg/html/pull/12831, which rewrites "appropriate place for inserting a node".
template-for-foster-parenting.htmlgains a second case: foster parenting out of a<tr>inside a<template for>, where the template is the lasttemplateon the stack of open elements and there is notableon the stack at all. The content has to go to the template's insertion target — a<template for>element is never inserted into the DOM, so resolving to its template contents loses the content, which is the same failure the existing case in that file was written to catch. The existing case only covers the shape where the template is older than the table and foster parenting therefore resolves through the last table instead.
template.datgains<table><template><tr><div></div></tr></template>, the same shape for a plain<template>nested in a<table>so that the last table is non-null. It sits next to the existing<body><template><tr><div></div></tr></template>case, which has no table.
foster-parenting-into-template-element.htmlis new: script makes atemplateelement the parent of the last table, so foster parenting resolves to a template element and has to redirect into its contents. The template has no insertion target, so the position before the table is dropped and the content appended.Results in the three engines:
Chrome Canary 154 Safari Firefox template-for-foster-parenting.htmlpass — — template.datpass — — foster-parenting-into-template-element.htmlfail (dropped) pass fail The last row is a known divergence, not a new requirement: Chrome and Firefox drop the element rather than inserting it. That is what keeping the reference child across the template redirect would produce, since the table is not a child of the template contents; the spec resets it to null. Filed here as-is since Safari matches the specification.
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 1•3 months ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/#/jobs?repo=try&revision=876fa92046a507a6871b8cf1a6fad9b7fad01ccd
| Assignee | ||
Comment 2•3 months ago
|
||
CI Results
Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 278 tests and 14 subtests
Status Summary
Firefox
OK : 2[GitHub] 270[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 6[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 7771[Gecko-android-em-14-x86_64-lite-opt-geckoview] 7777[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 7[GitHub] 785[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
Chrome
OK : 2
PASS: 6
FAIL: 1
Safari
OK : 2
PASS: 1
FAIL: 6
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
(See attachment for full changes)
Comment 4•3 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/57a8c2cc2004
https://hg.mozilla.org/mozilla-central/rev/34a9939e3752
Description
•