-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change updates the selection and search text/background colors in forced colors mode to HighlightText and Highlight. Bug: 970285 Change-Id: I170fdce8be02e31c26273e4eab5390427e672065 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1735471 Reviewed-by: Stephen Chenney <schenney@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Kevin Babbitt <kbabbitt@microsoft.com> Commit-Queue: Alison Maher <almaher@microsoft.com> Cr-Commit-Position: refs/heads/master@{#687276}
- Loading branch information
1 parent
a67cadf
commit 12bb018
Showing
21 changed files
with
259 additions
and
22 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
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
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
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
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
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
14 changes: 14 additions & 0 deletions
14
third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-14-expected.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,14 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
span { | ||
background-color: rgba(255, 0, 0, 0.99); | ||
color: blue; | ||
display: inline-block; | ||
forced-color-adjust: none; | ||
} | ||
</style> | ||
<body> | ||
<span class="select">AAA</span> | ||
<br> | ||
<span class="select" id="adjust-none">AAA</span> | ||
</body> |
36 changes: 36 additions & 0 deletions
36
third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-14.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,36 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Forced colors mode - active selection. | ||
</title> | ||
<style> | ||
br::selection { | ||
background-color: transparent; | ||
forced-color-adjust: none; | ||
} | ||
span { | ||
/* inline-block to ensure the selection bounding rectangle matches that of the | ||
span. This allows us to test selection using a reference test. */ | ||
display: inline-block; | ||
} | ||
.select::selection { | ||
background-color: rgba(255, 0, 0, 0.99); /* alpha < 1 so that we don't blend the background color with white. */ | ||
color: blue; | ||
} | ||
#adjust-none::selection { | ||
forced-color-adjust: none; | ||
} | ||
</style> | ||
<body> | ||
<span class="select">AAA</span> | ||
<br> | ||
<span class="select" id="adjust-none">AAA</span> | ||
</body> | ||
|
||
<script> | ||
var node1 = document.getElementsByClassName('select')[0].firstChild; | ||
var node2 = document.getElementsByClassName('select')[1].firstChild; | ||
var range = document.createRange(); | ||
range.setStart(node1, 0); | ||
range.setEnd(node2, node2.length); | ||
window.getSelection().addRange(range); | ||
</script> |
14 changes: 14 additions & 0 deletions
14
third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-15-expected.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,14 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
span { | ||
background-color: rgba(255, 0, 0, 0.99); | ||
color: blue; | ||
display: inline-block; | ||
forced-color-adjust: none; | ||
} | ||
</style> | ||
<body> | ||
<span class="select">AAA</span> | ||
<br> | ||
<span class="select" id="adjust-none">AAA</span> | ||
</body> |
40 changes: 40 additions & 0 deletions
40
third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-15.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,40 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Forced colors mode - inactive selection. | ||
</title> | ||
<style> | ||
br::selection:window-inactive { | ||
background-color: transparent; | ||
forced-color-adjust: none; | ||
} | ||
span { | ||
/* inline-block to ensure the selection bounding rectangle matches that of the | ||
span. This allows us to test selection using a reference test. */ | ||
display: inline-block; | ||
} | ||
.select::selection:window-inactive { | ||
background-color: rgba(255, 0, 0, 0.99); /* alpha < 1 so that we don't blend the background color with white. */ | ||
color: blue; | ||
} | ||
#adjust-none::selection:window-inactive { | ||
forced-color-adjust: none; | ||
} | ||
</style> | ||
<body> | ||
<span class="select">AAA</span> | ||
<br> | ||
<span class="select" id="adjust-none">AAA</span> | ||
</body> | ||
|
||
<script> | ||
var node1 = document.getElementsByClassName('select')[0].firstChild; | ||
var node2 = document.getElementsByClassName('select')[1].firstChild; | ||
var range = document.createRange(); | ||
range.setStart(node1, 0); | ||
range.setEnd(node2, node2.length); | ||
window.getSelection().addRange(range); | ||
|
||
// Make the window inactive. | ||
if (window.testRunner) | ||
testRunner.setWindowIsKey(false); | ||
</script> |
8 changes: 8 additions & 0 deletions
8
third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-16-expected.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,8 @@ | ||
<!DOCTYPE html> | ||
<div> | ||
<br><span style="background-color: rgb(255, 255, 0)">AAA</span> | ||
</div> | ||
|
||
<div> | ||
<br><span style="background-color: rgb(255, 150, 50)">AAA</span> | ||
</div> |
28 changes: 28 additions & 0 deletions
28
third_party/blink/web_tests/fast/css/forced-colors-mode/forced-colors-mode-16.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,28 @@ | ||
<!DOCTYPE html> | ||
<title> | ||
Forced colors mode - search. | ||
</title> | ||
<link rel=match href=forced-colors-mode-16-expected.html> | ||
<div> | ||
<br id='b1'>AAA | ||
</div> | ||
<div> | ||
<br id='b2'>AAA | ||
</div> | ||
|
||
<script> | ||
function highlightRange(element, start, end, active) { | ||
var range = document.createRange(); | ||
range.setStart(element, start); | ||
range.setEnd(element, end); | ||
internals.addTextMatchMarker(range, active); | ||
} | ||
|
||
if (window.internals) { | ||
onload = function() { | ||
highlightRange(document.getElementById('b1').nextSibling, 0, 3, 'kInactive'); | ||
highlightRange(document.getElementById('b2').nextSibling, 0, 3, 'kActive'); | ||
internals.setMarkedTextMatchesAreHighlighted(document, true); | ||
}; | ||
} | ||
</script> |
18 changes: 18 additions & 0 deletions
18
...sts/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-14-expected.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> | ||
<style> | ||
span { | ||
background-color: Highlight; | ||
color: HighlightText; | ||
display: inline-block; | ||
forced-color-adjust: none; | ||
} | ||
#adjust-none { | ||
background-color: rgba(255, 0, 0, 0.99); | ||
color: blue; | ||
} | ||
</style> | ||
<body> | ||
<span class="select">AAA</span> | ||
<br> | ||
<span class="select" id="adjust-none">AAA</span> | ||
</body> |
18 changes: 18 additions & 0 deletions
18
...sts/virtual/forced-colors/fast/css/forced-colors-mode/forced-colors-mode-15-expected.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> | ||
<style> | ||
span { | ||
background-color: Highlight; | ||
color: HighlightText; | ||
display: inline-block; | ||
forced-color-adjust: none; | ||
} | ||
#adjust-none { | ||
background-color: rgba(255, 0, 0, 0.99); | ||
color: blue; | ||
} | ||
</style> | ||
<body> | ||
<span class="select">AAA</span> | ||
<br> | ||
<span class="select" id="adjust-none">AAA</span> | ||
</body> |
Oops, something went wrong.