Closed Bug 1791827 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 35996 - Fix :has() invalidation bug on wiping an element by means of innerHTML

Categories

(Core :: CSS Parsing and Computation, task, P4)

task

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 35996 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/35996
Details from upstream follow.

Byungwoo Lee <blee@igalia.com> wrote:

Fix :has() invalidation bug on wiping an element by means of innerHTML

There is a bug on :has() invalidation when removing both element and
non-element nodes by assigning new text to element.innerHTML because
ChildrenChangeType::kAllChildrenRemoved is not handled in
Element::ChildChanged().

\<style>
div:has(span) { color: red }
\</style>
\<div id="target"> This is a text \<span> with span \</span>\</div>
\<script>
target.innerHTML = "This is a text";
\</script>

Fixed the bug by handling the ChildrenChangeType::kAllChildrenRemoved
in Element::ChildChanged().

Bug: 1366369
Change-Id: Ibe450fcd37005dd892c4939188aa39428a8565c3
Reviewed-on: https://chromium-review.googlesource.com/3910212
WPT-Export-Revision: 984b2950769aa1b0606bf077c4953f0469c49766

Component: web-platform-tests → CSS Parsing and Computation
Product: Testing → Core

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 1 tests and 5 subtests

Status Summary

Firefox

OK : 1
PASS: 3
FAIL: 2

Chrome

OK : 1
PASS: 3
FAIL: 2

Safari

OK : 1
PASS: 5

Links

GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/0335251f50a1 [wpt PR 35996] - Fix :has() invalidation bug on wiping an element by means of innerHTML, a=testonly https://hg.mozilla.org/integration/autoland/rev/e8f88c2c1154 [wpt PR 35996] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
You need to log in before you can comment on or make changes to this bug.