-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some tests for color-mix() and currentColor.
This adds a test that passes and a test that doesn't. The first one checks that we inherit currentColor correctly. The second one checks that currentColor is mixed in the right color-space (bug 1770829). Differential Revision: https://phabricator.services.mozilla.com/D147107 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1770830 gecko-commit: 658d0c192f719ca04bc7d7c81d3b9fa431d43607 gecko-reviewers: boris
- Loading branch information
1 parent
b293894
commit f6b8809
Showing
4 changed files
with
67 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!doctype html> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
color: red; | ||
background-color: green; | ||
} | ||
</style> | ||
<div></div> |
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> | ||
<link rel="match" href="color-mix-currentcolor-001-ref.html"> | ||
<title>currentColor is inherited correctly in color-mix()</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-color-5/#color-mix"> | ||
<link rel="author" href="mailto:[email protected]" title="Emilio Cobos Álvarez"> | ||
<link rel="author" href="https://mozilla.org" title="Mozilla"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
color: red; | ||
background-color: color-mix(in srgb, currentColor 50%, green); | ||
} | ||
div div { | ||
color: green; | ||
background-color: inherit; | ||
} | ||
</style> | ||
<div> | ||
<div></div> | ||
</div> |
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> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
color: red; | ||
background-color: color-mix(in lch, green 50%, blue); | ||
} | ||
</style> | ||
<div></div> |
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,22 @@ | ||
<!doctype html> | ||
<link rel="match" href="color-mix-currentcolor-002-ref.html"> | ||
<title>currentColor is mixed with the correct color-space in color-mix()</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-color-5/#color-mix"> | ||
<link rel="author" href="mailto:[email protected]" title="Emilio Cobos Álvarez"> | ||
<link rel="author" href="https://mozilla.org" title="Mozilla"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background-color: red; | ||
color: red; | ||
background-color: color-mix(in lch, currentColor 50%, blue); | ||
} | ||
div div { | ||
color: green; | ||
background-color: inherit; | ||
} | ||
</style> | ||
<div> | ||
<div></div> | ||
</div> |