[go: nahoru, domu]

Skip to content

Commit

Permalink
Highlight API: Don't paint text-shadow for custom ::highlight pseudos
Browse files Browse the repository at this point in the history
There are some uncertanties [1] [2] [3] about how text-shadow should
work for highlight pseudos. Until these are resolved, disable
text-shadow for custom ::highlight so that when custom Highlight API
ships, developers don't take dependencies on text-shadow behavior that
may change or be removed entirely.

[1] w3c/csswg-drafts#3932
[2] https://chromium-review.googlesource.com/c/chromium/src/+/2658617/
[3] https://hackmd.io/@dazabani/cr-highlight-pseudos-2021-06#text-shadow-property

Bug: 1164461
Change-Id: I8253ad2f3054320c5aba452296be0c72f0015a6c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3222139
Commit-Queue: Dan Clark <daniec@microsoft.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Fernando Fiori <ffiori@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#931761}
  • Loading branch information
dandclark authored and chromium-wpt-export-bot committed Oct 14, 2021
1 parent d819c0a commit dc8f97b
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<meta charset="UTF-8">
<title>CSS Highlight API Test: text-decoration</title>
<link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/">
<link rel="match" href="custom-highlight-painting-001-ref.html">
<meta name="assert" value="::highlight overlay does not paint text-shadow">
<style>
::highlight(example-highlight) {
background-color: yellow;
color: blue;
text-shadow: 1px 2px rgba(255, 0, 0, 0.5);
}
</style>
<body><span>One </span><span>two </span><span>three…</span>
<script>
let r = new Range();
r.setStart(document.body, 0);
r.setEnd(document.body, 2);

CSS.highlights.set("example-highlight", new Highlight(r));
</script>

0 comments on commit dc8f97b

Please sign in to comment.