forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix text painting for ::target-text & ::highlight
::target-text & ::highlight pseudo-elements were not painting the text if the originating element color was transparent. This patch fixes this removing two checks in NGHighlightPainter::Paint(). BUG=1273943 TEST=web_tests/external/wpt/css/css-highlight-api/painting/custom-highlight-painting-017.html TEST=web_tests/external/wpt/css/css-pseudo/target-text-007.html Change-Id: Ie8198e8cf37d6ef89cdee341e84b6bc36ad6ec84 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3302311 Reviewed-by: Rune Lillesveen <futhark@chromium.org> Commit-Queue: Manuel Rego <rego@igalia.com> Cr-Commit-Position: refs/heads/main@{#945638}
- Loading branch information
1 parent
ce8e732
commit 9263c77
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
css/css-highlight-api/painting/custom-highlight-painting-017.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>CSS Highlight API Test: ::highlight color with transparent originating color</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-highlight-api-1/#custom-highlight-pseudo"> | ||
<link rel="help" href="https://crbug.com/1273943"> | ||
<meta name="assert" content="This test checks that ::highlight pseudo-element uses the specified color even when the originating element text color was trasnparent."> | ||
<link rel="match" href="/css/reference/pass_if_pass_below.html"> | ||
<style> | ||
div { | ||
color: transparent; | ||
} | ||
::highlight(example-highlight) { | ||
color: black; | ||
} | ||
</style> | ||
|
||
<p>Test passes if there is the word "PASS" below.</p> | ||
<div id="target">PASS</div> | ||
|
||
<script> | ||
let r = new Range(); | ||
r.setStart(target, 0); | ||
r.setEnd(target, 1); | ||
|
||
CSS.highlights.set("example-highlight", new Highlight(r)); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<title>CSS Pseudo-Elements Test: ::target-text text color with transparent originating color</title> | ||
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text"> | ||
<link rel="help" href="https://crbug.com/1273943"> | ||
<meta name="assert" content="This test checks that ::target-text pseudo-element uses the specified color even when the originating element text color was trasnparent."> | ||
<link rel="match" href="/css/reference/pass_if_pass_below.html"> | ||
<style> | ||
div { | ||
color: transparent; | ||
} | ||
::target-text { | ||
color: black; | ||
} | ||
</style> | ||
|
||
<p>Test passes if there is the word "PASS" below.</p> | ||
<div>PASS </div> | ||
|
||
<script> | ||
window.location.hash = "#:~:text=PASS%20"; | ||
</script> |