Skip to content

Commit

Permalink
Bug 1782964 [wpt PR 35320] - [css-pseudo] rework highlight currentCol…
Browse files Browse the repository at this point in the history
…or tests, a=testonly

Automatic update from web-platform-tests
[css-pseudo] rework highlight currentColor tests (#35320)

--

wpt-commits: 0592bb24e5501533a0250e3eab98814d958ac8eb
wpt-pr: 35320
  • Loading branch information
delan authored and moz-wptsync-bot committed Aug 4, 2022
1 parent 8fbe96f commit 739d4df
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: highlight selectors inheritance getComputedStyle for currentcolor</title>
<meta name="assert" content="Checks the result of getComputedStyle for each kind of highlight pseudo, when ‘color’ and ‘background-color’ are set to ‘currentColor’ in the parent. The child should inherit both properties as if if they were directly set to ‘currentColor’, due to highlight inheritance and the fact that ‘currentColor’ computes to itself, and the result for both properties should equal the originating element ‘color’.">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-selectors">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: highlight selectors getComputedStyle for currentcolor on visited</title>
<meta name="assert" content="Checks the result of getComputedStyle for each kind of highlight pseudo, when ‘color’ is set to ‘currentColor’ for visited links (and for unvisited links, via implicit defaulting up to the root). The result for both links should equal the originating element ‘color’ as if the link was unvisited.">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-selectors">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: highlight selectors getComputedStyle for currentcolor</title>
<meta name="assert" content="Checks the result of getComputedStyle for each kind of highlight pseudo, when ‘color’ and ‘background-color’ are set to ‘currentColor’. The result for both properties should equal the originating element ‘color’.">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-selectors">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
#textshadow-currentcolor > span {
text-shadow: currentcolor 2px 2px;
}
#textfillcolor-currentcolor > span {
-webkit-text-fill-color: currentcolor;
}
#textstrokecolor-currentcolor > span {
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: currentcolor;
}
#color-currentcolor-backgroundcolor-currentcolor > span {
color: currentcolor;
background-color: currentcolor;
Expand All @@ -51,8 +44,6 @@
<div id="backgroundcolor-currentcolor" class="highlight_reftest"><span>example</span> - backgroundcolor-currentcolor</div>
<div id="textdecorationcolor-currentcolor" class="highlight_reftest"><span>example</span> - textdecorationcolor-currentcolor</div>
<div id="textshadow-currentcolor" class="highlight_reftest"><span>example</span> - textshadow-currentcolor</div>
<div id="textfillcolor-currentcolor" class="highlight_reftest"><span>example</span> - textfillcolor-currentcolor</div>
<div id="textstrokecolor-currentcolor" class="highlight_reftest"><span>example</span> - textstrokecolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-currentcolor" class="highlight_reftest"><span>example</span> - color-currentcolor-backgroundcolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-blue" class="highlight_reftest"><span>example</span> - color-currentcolor-backgroundcolor-blue</div>
<div id="color-blue-backgroundcolor-currentcolor" class="highlight_reftest"><span>example</span> - color-blue-backgroundcolor-currentcolor</div>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Pseudo-Elements Test: Custom Highlights currentcolor painting single layer</title>
<meta name="assert" content="Checks the painting for highlight pseudos (using ::highlight), when other properties are set to ‘currentColor’ (and ‘color’ is also ‘currentColor’, via implicit defaulting up to the root). The color of each property should equal the originating element ‘color’.">
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-text">
<meta name="assert" content="Checks that currentcolor is properly resolved for the different color properites allowed for highlight pseudos (using custom highlights in this test), when we have only one highlight.">
<link rel="match" href="highlight-painting-currentcolor-001-ref.html">
<link rel="match" href="highlight-currentcolor-painting-properties-001-ref.html">
<link rel="stylesheet" href="support/highlights.css">
<style>
div {
Expand All @@ -27,13 +27,6 @@
::highlight(textshadow-currentcolor) {
text-shadow: currentcolor 2px 2px;
}
::highlight(textfillcolor-currentcolor) {
-webkit-text-fill-color: currentcolor;
}
::highlight(textstrokecolor-currentcolor) {
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: currentcolor;
}
::highlight(color-currentcolor-backgroundcolor-currentcolor) {
color: currentcolor;
background-color: currentcolor;
Expand All @@ -53,8 +46,6 @@
<div id="backgroundcolor-currentcolor" class="highlight_reftest">example - backgroundcolor-currentcolor</div>
<div id="textdecorationcolor-currentcolor" class="highlight_reftest">example - textdecorationcolor-currentcolor</div>
<div id="textshadow-currentcolor" class="highlight_reftest">example - textshadow-currentcolor</div>
<div id="textfillcolor-currentcolor" class="highlight_reftest">example - textfillcolor-currentcolor</div>
<div id="textstrokecolor-currentcolor" class="highlight_reftest">example - textstrokecolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-currentcolor" class="highlight_reftest">example - color-currentcolor-backgroundcolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-blue" class="highlight_reftest">example - color-currentcolor-backgroundcolor-blue</div>
<div id="color-blue-backgroundcolor-currentcolor" class="highlight_reftest">example - color-blue-backgroundcolor-currentcolor</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@
#textshadow-currentcolor > span > span {
text-shadow: currentcolor 2px 2px;
}
#textfillcolor-currentcolor > span > span {
-webkit-text-fill-color: currentcolor;
}
#textstrokecolor-currentcolor > span > span {
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: currentcolor;
}
#color-currentcolor-backgroundcolor-currentcolor > span > span {
color: currentcolor;
background-color: currentcolor;
Expand All @@ -55,8 +48,6 @@
<div id="backgroundcolor-currentcolor" class="highlight_reftest"><span><span>ex</span>ample</span> - backgroundcolor-currentcolor</div>
<div id="textdecorationcolor-currentcolor" class="highlight_reftest"><span><span>ex</span>ample</span> - textdecorationcolor-currentcolor</div>
<div id="textshadow-currentcolor" class="highlight_reftest"><span><span>ex</span>ample</span> - textshadow-currentcolor</div>
<div id="textfillcolor-currentcolor" class="highlight_reftest"><span><span>ex</span>ample</span> - textfillcolor-currentcolor</div>
<div id="textstrokecolor-currentcolor" class="highlight_reftest"><span><span>ex</span>ample</span> - textstrokecolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-currentcolor" class="highlight_reftest"><span><span>ex</span>ample</span> - color-currentcolor-backgroundcolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-blue" class="highlight_reftest"><span><span>ex</span>ample</span> - color-currentcolor-backgroundcolor-blue</div>
<div id="color-blue-backgroundcolor-currentcolor" class="highlight_reftest"><span><span>ex</span>ample</span> - color-blue-backgroundcolor-currentcolor</div>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Pseudo-Elements Test: Custom Highlights currentcolor painting two layers</title>
<meta name="assert" content="Checks the painting for highlight pseudos (using ::highlight), when other properties are set to ‘currentColor’ (and ‘color’ is also ‘currentColor’, via implicit defaulting up to the root), and there is another active highlight below. The color of each property should equal the underlying highlight ‘color’.">
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-text">
<meta name="assert" content="Checks that currentcolor is properly resolved for the different color properites allowed for highlight pseudos (using custom highlights in this test), when we have two highlights one of top of the other.">
<link rel="match" href="highlight-painting-currentcolor-002-ref.html">
<link rel="match" href="highlight-currentcolor-painting-properties-002-ref.html">
<link rel="stylesheet" href="support/highlights.css">
<style>
div {
Expand All @@ -31,13 +31,6 @@
::highlight(textshadow-currentcolor) {
text-shadow: currentcolor 2px 2px;
}
::highlight(textfillcolor-currentcolor) {
-webkit-text-fill-color: currentcolor;
}
::highlight(textstrokecolor-currentcolor) {
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: currentcolor;
}
::highlight(color-currentcolor-backgroundcolor-currentcolor) {
color: currentcolor;
background-color: currentcolor;
Expand All @@ -57,8 +50,6 @@
<div id="backgroundcolor-currentcolor" class="highlight_reftest">example - backgroundcolor-currentcolor</div>
<div id="textdecorationcolor-currentcolor" class="highlight_reftest">example - textdecorationcolor-currentcolor</div>
<div id="textshadow-currentcolor" class="highlight_reftest">example - textshadow-currentcolor</div>
<div id="textfillcolor-currentcolor" class="highlight_reftest">example - textfillcolor-currentcolor</div>
<div id="textstrokecolor-currentcolor" class="highlight_reftest">example - textstrokecolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-currentcolor" class="highlight_reftest">example - color-currentcolor-backgroundcolor-currentcolor</div>
<div id="color-currentcolor-backgroundcolor-blue" class="highlight_reftest">example - color-currentcolor-backgroundcolor-blue</div>
<div id="color-blue-backgroundcolor-currentcolor" class="highlight_reftest">example - color-blue-backgroundcolor-currentcolor</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Pseudo-Elements Test: Custom Highlights currentcolor, initial, inherit, unset painting</title>
<meta name="assert" content="Checks the painting for highlight pseudos (using ::highlight), when ‘color’ is explicitly defaulted in a universal rule. ‘inherit’ (and ‘unset’, due to highlight inheritance) should equal the originating element ‘color’, because ‘color’ inherits through ancestor highlight pseudos up to the root, where the inherited value is defined as ‘currentColor’ for highlights. ‘initial’ should equal the initial value of ‘color’, which is ‘CanvasText’.">
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-text">
<meta name="assert" content="Checks that color currentcolor, initial, inherit, unset are properly resolved when painting highlight pseudos.">
<link rel="match" href="highlight-painting-currentcolor-003-ref.html">
<link rel="match" href="highlight-currentcolor-root-explicit-default-001-ref.html">
<link rel="stylesheet" href="support/highlights.css">
<style>
div {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<meta charset="utf-8" />
<title>CSS Pseudo-Elements Test: Custom Highlights color inherit painting</title>
<meta name="assert" content="Checks the painting for highlight pseudos (using ::highlight), when ‘color’ is universally set to ‘inherit’. When the parent is explicitly set to ‘blue’, inheritance stops there, yielding blue. Otherwise inheritance reaches the root element, where the inherited value is defined as ‘currentColor’ for highlights, yielding green.">
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-text">
<meta name="assert" content="Checks that color inherit is properly resolved when painting highlight pseudos. It works like currentcolor, unless some specific color has been defined.">
<link rel="match" href="highlight-painting-currentcolor-004-ref.html">
<link rel="match" href="highlight-currentcolor-root-explicit-default-002-ref.html">
<link rel="stylesheet" href="support/highlights.css">
<style>
.highlight_reftest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: implicit defaulting of ‘color’ in :root highlights</title>
<meta name="assert" content="Checks the painting for ::selection and ::highlight, when ‘background-color’ is set in the root element but ‘color’ is implicitly defaulted. ‘background-color’ suppresses the UA default ‘color’ for ::selection via paired cascade. The resultant ‘color’ inherits through ancestor highlight pseudos up to the root, where the inherited value is defined as ‘currentColor’ for highlights, yielding green.">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-selectors">
<link rel="match" href="reference/highlight-pseudos-currentcolor-inheritance-computed-002-ref.html">
<link rel="match" href="highlight-currentcolor-root-implicit-default-ref.html">
<p>Pass if text below is green on lime, and the text itself represents green, not initial (black).</p>
<main>FAIL</main>
<main>FAIL</main>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Pseudo-Elements Test: implicit defaulting of ‘color’ in :root highlights</title>
<meta name="assert" content="Checks the painting for ::selection and ::highlight, when ‘background-color’ is set in the target element but ‘color’ is implicitly defaulted. ‘background-color’ suppresses the UA default ‘color’ for ::selection via paired cascade. The resultant ‘color’ inherits through ancestor highlight pseudos up to the root, where the inherited value is defined as ‘currentColor’ for highlights, yielding green.">
<link rel="author" title="Delan Azabani" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#highlight-selectors">
<link rel="match" href="reference/highlight-pseudos-currentcolor-inheritance-computed-002-ref.html">
<link rel="match" href="highlight-currentcolor-root-implicit-default-ref.html">
<p>Pass if text below is green on lime, and the text itself represents green, not initial (black).</p>
<main>FAIL</main>
<main>FAIL</main>
Expand Down

0 comments on commit 739d4df

Please sign in to comment.