Bug 1754327 [wpt PR 32759] - Highlight API: Don't paint unstyled custom highlights...
commit05fdea4c5da1ea186a452fa964630c7b8e2c6ca0
authorDan Clark <daniec@microsoft.com>
Sat, 26 Feb 2022 22:18:49 +0000 (26 22:18 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Mon, 7 Mar 2022 14:48:58 +0000 (7 14:48 +0000)
tree63c53fb3041508da87e7e65e0f6eb42f7c8c1d84
parentef1a22ff27ad330bb2c835f45cefa35b341224f9
Bug 1754327 [wpt PR 32759] - Highlight API: Don't paint unstyled custom highlights, a=testonly

Automatic update from web-platform-tests
Highlight API: Don't paint unstyled custom highlights

The custom highlight API spec [1] currently states that an unstyled
custom highlight should inherit the styles of its originating element.
The Blink implementation follows this.

However, this behavior can lead to some unintuitive results where
unstyled highlights can affect the painting of the originating
element, or paint over other highlights. This issue was pointed out
in [2], and spec changes to fix this are pending editor review.
A goal of these changes are that unstyled custom highlights do not
affect rendering at all.

This change updates the custom highlights implementation to achieve
this by giving them a default 'transparent' foreground and background
color.

Some of our tests were validating the earlier unintuitive behavior
involving overlapping ranges. These are updated, along with the
addition of a new test to validate that a single unstyled highlight
doesn't affect rendering.

[1] https://drafts.csswg.org/css-highlight-api-1/#default-styles
[2] https://github.com/w3c/csswg-drafts/issues/6779

Bug: 1295271
Change-Id: Id7dc877c90c08240fbe79edeeeec551cdc5508c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3449336
Reviewed-by: Delan Azabani <dazabani@igalia.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#969007}

--

wpt-commits: 40d5e6da07fc061a6d81f081c3c16eafc10b54ce
wpt-pr: 32759
testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-003-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-inheritance-003.html [new file with mode: 0644]
testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-overlapping-highlights-001-ref.html
testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-overlapping-highlights-001.html
testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-overlapping-highlights-002-ref.html
testing/web-platform/tests/css/css-highlight-api/painting/custom-highlight-painting-overlapping-highlights-002.html