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
11 lines
343 B
HTML
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>
|