Files
sousa-gecko/testing/web-platform/tests/css/css-highlight-api/highlight-image-stacked-ref.html
T
Fernando Fiori 9d8cedec22 Bug 2052279 [wpt PR 61044] - [highlights] Paint custom highlight backgrounds over replaced elements, a=testonly
Automatic update from web-platform-tests
[highlights] Paint custom highlight backgrounds over replaced elements

Build on the replaced-element tracking added by the parent CL to
actually paint custom ::highlight() background tints over replaced
elements such as <img>.

- ReplacedPainter::PaintCustomHighlights() fills the area the replaced
  content occupies (the content box, or the replaced object's rect when
  it overflows the content box) with the active custom-highlight
  backgrounds, in the foreground phase, after the replaced content and
  below the existing ::selection tint in the highlight overlay order.

- Stacked highlights resolve background-color: currentColor against
  the previous highlight layer, mirroring HighlightOverlay::
  ComputeParts() for text, so a higher-priority layer's currentColor
  reflects the lower layer's resolved color rather than the host
  element's color.

- The cached drawing is consulted before resolving any colors, so
  cache hits skip the stacking sort and per-layer color resolution.

Bug: 357946492
Change-Id: I5b9b4e9a4189c90c45c81690d2d734b5dbea2683
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7830521
Commit-Queue: Fernando Fiori <ffiori@microsoft.com>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/main@{#1656173}

--

wpt-commits: 1d2752ae73c88ec922c0112843ef4f5732a2a4d6
wpt-pr: 61044
2026-07-10 09:24:26 +00:00

11 lines
343 B
HTML

<!DOCTYPE html>
<meta charset="utf-8">
<title>Custom highlight: stacked highlights over a replaced element (reference)</title>
<link rel="author" title="Fernando Fiori" href="mailto:ffiori@microsoft.com">
<style>
#tint { width: 100px; height: 100px; background-color: green; }
</style>
<body>
<div id="d"><div id="tint"></div></div>
</body>