forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These tests were written when ::target-text was implemented, but changing window.location.hash for target text was not allowed at that time, and did not allow for automated testing. Submit since that is now possible. target-text-004.html fails because currentColor for ::selection does not fall back to using the text color from ::target-text. Bug: 1136817, 1147859 Change-Id: Id512caec6ef7df8380f75fe82c79af27975991d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521513 Reviewed-by: Manuel Rego <[email protected]> Commit-Queue: Rune Lillesveen <[email protected]> Cr-Commit-Position: refs/heads/main@{#933854}
- Loading branch information
Showing
11 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
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
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
18 changes: 18 additions & 0 deletions
18
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-001.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,18 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Pseudo-Elements Test: ::target-text color rendering - basic</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text"> | ||
<link rel="match" href="target-text-lime-green-ref.html"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> | ||
<style> | ||
.ahem { font-family: Ahem; } | ||
p::target-text { | ||
color: lime; | ||
background-color: green; | ||
} | ||
</style> | ||
<p>PASS if there are two segments of lime squares with a green square between below.</p> | ||
<p class="ahem">match me</p> | ||
<script> | ||
window.location.hash = "#:~:text=match%20me"; | ||
</script> |
18 changes: 18 additions & 0 deletions
18
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-002.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,18 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Pseudo-Elements Test: ::target-text color rendering - match across elements</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text"> | ||
<link rel="match" href="target-text-lime-green-ref.html"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> | ||
<style> | ||
.ahem { font-family: Ahem; } | ||
::target-text { | ||
color: lime; | ||
background-color: green; | ||
} | ||
</style> | ||
<p>PASS if there are two segments of lime squares with a green square between below.</p> | ||
<p class="ahem">ma<span>tch </span>me</p> | ||
<script> | ||
window.location.hash = "#:~:text=match%20me"; | ||
</script> |
18 changes: 18 additions & 0 deletions
18
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-003.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,18 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Pseudo-Elements Test: ::target-text color rendering - two matches</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text"> | ||
<link rel="match" href="target-text-lime-ref.html"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> | ||
<style> | ||
.ahem { font-family: Ahem; } | ||
p::target-text { | ||
color: lime; | ||
background-color: green; | ||
} | ||
</style> | ||
<p>PASS if there are two segments of lime squares below.</p> | ||
<p class="ahem">match me</p> | ||
<script> | ||
window.location.hash = "#:~:text=match&text=me"; | ||
</script> |
27 changes: 27 additions & 0 deletions
27
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-004.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 Pseudo-Elements Test: ::target-text color rendering - with selection</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text"> | ||
<link rel="match" href="target-text-lime-green-ref.html"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> | ||
<style> | ||
p::target-text { | ||
background-color: red; | ||
color: lime; | ||
} | ||
p::selection { | ||
background-color: green; | ||
color: currentColor; | ||
} | ||
#sel { | ||
font-family: Ahem; | ||
} | ||
</style> | ||
<p>PASS if there are two segments of lime squares with a green square between below.</p> | ||
<p id="sel">match me</p> | ||
<script> | ||
window.location.hash = "#:~:text=match%20me"; | ||
let range = document.createRange(); | ||
range.selectNodeContents(sel); | ||
window.getSelection().addRange(range); | ||
</script> |
27 changes: 27 additions & 0 deletions
27
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-005.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 Pseudo-Elements Test: ::target-text color rendering - with transparent selection</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text"> | ||
<link rel="match" href="target-text-lime-green-ref.html"> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> | ||
<style> | ||
p::target-text { | ||
background-color: green; | ||
color: transparent; | ||
} | ||
p::selection { | ||
background-color: transparent; | ||
color: lime; | ||
} | ||
#sel { | ||
font-family: Ahem; | ||
} | ||
</style> | ||
<p>PASS if there are two segments of lime squares with a green square between below.</p> | ||
<p id="sel">match me</p> | ||
<script> | ||
window.location.hash = "#:~:text=match%20me"; | ||
let range = document.createRange(); | ||
range.selectNodeContents(sel); | ||
window.getSelection().addRange(range); | ||
</script> |
17 changes: 17 additions & 0 deletions
17
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-006.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,17 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>CSS Pseudo-Elements Test: ::target-text color rendering - text rendered once</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-target-text"> | ||
<link rel="match" href="target-text-two-words-ref.html"> | ||
<style> | ||
p.white { color: white; } | ||
p::target-text { | ||
color: black; | ||
background-color: orange; | ||
} | ||
</style> | ||
<p>PASS if the text below is rendered black on an orange background.</p> | ||
<p class="white">match me</p> | ||
<script> | ||
window.location.hash = "#:~:text=match%20me"; | ||
</script> |
4 changes: 4 additions & 0 deletions
4
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-lime-green-ref.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,4 @@ | ||
<!doctype html> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> | ||
<p>PASS if there are two segments of lime squares with a green square between below.</p> | ||
<p style="font-family:Ahem"><span style="color:lime;background:green">match me</span></p> |
11 changes: 11 additions & 0 deletions
11
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-lime-ref.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,11 @@ | ||
<!doctype html> | ||
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"> | ||
<style> | ||
.ahem { font-family: Ahem; } | ||
span { | ||
color: lime; | ||
background-color: green; | ||
} | ||
</style> | ||
<p>PASS if there are two segments of lime squares below.</p> | ||
<p class="ahem"><span>match</span> <span>me</span></p> |
4 changes: 4 additions & 0 deletions
4
third_party/blink/web_tests/external/wpt/css/css-pseudo/target-text-two-words-ref.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,4 @@ | ||
<!doctype html> | ||
<title>CSS Test Reference</title> | ||
<p>PASS if the text below is rendered black on an orange background.</p> | ||
<p><span style="color:black;background:orange">match me<span></p> |