[wpt-sync] Sync PR 61890 - [highlights] Preserve insertion order when setting an existing name
Categories
(Core :: CSS Parsing and Computation, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox156 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 61890 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/61890
Details from upstream follow.
Fernando Fiori <ffiori@microsoft.com> wrote:
[highlights] Preserve insertion order when setting an existing name
HighlightRegistry is a maplike\<DOMString, Highlight>, so setForBinding()
must follow Map.prototype.set semantics: when the name is already in the
registry, the value is replaced and the order of entries is not affected
(ECMA-262 24.1.3.9).Instead, HighlightRegistry::SetForTesting() erased the existing entry
and inserted a new one, which moved it to the end of the
HeapLinkedHashSet and therefore to the end of the iteration order. Two
consequences:
- CSS.highlights.keys()/values()/entries() reported the wrong order
after overwriting an existing name.- Overwriting the name an iterator is currently pointing at moved that
entry behind the cursor, so the iteration restarted and never
terminated.Update the existing entry in place instead. The registration position is
still bumped, so the highlight keeps stacking above previously
registered ones (highlights are stacked with
CompareOverlayStackingPosition(), which reads registration_position and
not the position in the set), and painting behavior is unchanged.
Notifying the iterators is no longer needed because nothing is removed:
they keep pointing at the same entry.Bug: 544197475
Change-Id: I79b44f4c39b86a658e6e26b86c8e5c94b2cdff6bReviewed-on: https://chromium-review.googlesource.com/8227847
WPT-Export-Revision: 72b551347357c599310ba25df822550af93a60bf
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 1•3 months ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/#/jobs?repo=try&revision=18937564e64f64146703e841c626f59201b88ec4
| 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 122 tests
Status Summary
Firefox
OK : 2[GitHub] 18[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: 4[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 11[GitHub] 166[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 260[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-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 6
Chrome
OK : 2
PASS: 8
FAIL: 3
Safari
OK : 2
PASS: 11
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /css/css-highlight-api/highlight-image-currentcolor.html [wpt.fyi]:
FAIL - /css/css-highlight-api/highlight-image-stacked.html [wpt.fyi]:
FAIL - /css/css-highlight-api/highlight-text-cascade.html [wpt.fyi]:
FAIL - /css/css-highlight-api/painting/custom-highlight-painting-below-grammar.html [wpt.fyi]:
FAIL - /css/css-highlight-api/painting/custom-highlight-painting-inheritance-001.html [wpt.fyi]:
FAIL - /css/css-highlight-api/painting/custom-highlight-painting-inheritance-002.html [wpt.fyi]:
FAIL
Comment 4•3 months ago
|
||
| bugherder | ||
Description
•