Skip to content

Commit

Permalink
Add CSS system colors Mark and MarkText.
Browse files Browse the repository at this point in the history
CSS Color Module Level 4 defines new system colors
(https://www.w3.org/TR/css-color-4/#css-system-colors).
This CL implements Mark and MarkText.

Bug: 1299441
Change-Id: Id184ee58c49e7d55a32b3776e5d0d9489eb4e9cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3536909
Reviewed-by: Stephen Chenney <[email protected]>
Commit-Queue: Stephen Chenney <[email protected]>
Cr-Commit-Position: refs/heads/main@{#983348}
  • Loading branch information
Jan Keitel authored and chromium-wpt-export-bot committed Mar 21, 2022
1 parent 07201da commit 0e9eddc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions css/css-color/parsing/system-color-valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
test_valid_value("color", "Highlight", "highlight");
test_valid_value("color", "HighlightText", "highlighttext");
test_valid_value("color", "LinkText", "linktext");
test_valid_value("color", "Mark", "mark");
test_valid_value("color", "MarkText", "marktext");
test_valid_value("color", "VisitedText", "visitedtext");
test_valid_value("color", "SelectedItem", "selecteditem");
test_valid_value("color", "SelectedItemText", "selecteditemtext");
Expand Down
6 changes: 5 additions & 1 deletion css/css-color/system-color-consistency.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
<div id="buttons">
<button name="button"></button><input type="submit" name="submit button"><input type="reset" name="reset button">
</div>
<mark id="mark">Marked text</mark>
<script>
for (let element of document.getElementById("buttons").children) {
style = document.defaultView.getComputedStyle(element);
test_computed_value(`color`, `ButtonText`, style.getPropertyValue('color'), 'has the same color as text on a ' + element.name);
}
// Test with no specified target contrast
// Mark and MarkText
style = document.defaultView.getComputedStyle(document.getElementById('mark'));
test_computed_value('color', 'Mark', style.getPropertyValue('background-color'), 'has the same color as the background-color of a mark element');
test_computed_value('color', 'MarkText', style.getPropertyValue('color'), 'has the same color as the color of a mark element');
</script>
</body>

Expand Down

0 comments on commit 0e9eddc

Please sign in to comment.