Closed Bug 2069381 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 62235 - Implement ::highlight(*)

Categories

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

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Seokho Song <seokho@chromium.org> wrote:

Implement ::highlight(*)

CSSWG decided to allow '*' as the argument of the ::highlight(); that
can style every registered custom highlight [1].

Parse the '*' delimiter token as the ::highlight() argument, store it as
CSSSelector::UniversalSelectorAtom(), which contributes 0 specificity.
Therefore, named custom highlights win conflicting declarations
regardless of source order.

Make ::highlight(*) match every named custom highlight under the normal
cascade algorithm. A new HasCustomHighlightUniversalSelector field in
computed_style_extra_fields records whether an element has a universal
selector, and StyleHighlightData stores the resolved related style.

Handle some extra cases explicitly:

  • When the parent has no style for the named highlight but does have
    ::highlight(*), inherit from that.

[1] https://github.com/w3c/csswg-drafts/issues/9091

Spec PR: https://github.com/w3c/csswg-drafts/pull/14301
Intent to Prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/hEy4cr4iowU/m/ZW5l_bikAwAJ
Feature Entry: https://chromestatus.com/feature/5174965228929024

Bug: 408003366
Change-Id: I9c77fef6710a2450084d2cfcb70caceaeda8b988
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8235619
Commit-Queue: Seokho Song \<seokho@chromium.org>
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Reviewed-by: Stephen Chenney \<schenney@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1689587}

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

CI Results

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

Total 131 tests and 33 subtests

Status Summary

Firefox

OK : 2[GitHub] 19[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] 22[GitHub] 174[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 267[Gecko-linux2404-64-debug] 269[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-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 6[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 13[GitHub] 19[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-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt] 21[Gecko-linux2404-64-debug]

Chrome

OK : 2
PASS: 22
FAIL: 13

Safari

OK : 2
PASS: 19
FAIL: 16

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.