Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions css/css-pseudo/active-selection-021-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Reftest Reference</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">

<style>
div
{
color: green;
font-size: 300%;
text-decoration: underline overline line-through;
}
</style>

<p>Test passes if each glyph of "Selected Text" is green and <strong>not red</strong> and if the underline, the overline and the line-through are also green and not red.

<div>Selected Text</div>
54 changes: 54 additions & 0 deletions css/css-pseudo/active-selection-021.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Pseudo-Elements Test: active selection, color and 'text-decoration: underline overline line-through'</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-styling">
<link rel="match" href="active-selection-021-ref.html">

<meta content="" name="flags">

<style>
div
{
color: red;
font-size: 300%;
text-decoration: underline overline line-through;
}

div::selection
{
color: green;
}
</style>

<!--
"
The element's own text decorations (both line decorations
and emphasis marks) are thus drawn in the pseudo-element's
own color when that is not currentColor, regardless of
their original color or fill specifications.
"
coming from
https://www.w3.org/TR/css-pseudo-4/#highlight-painting
-->

<script>
function startTest()
{
var targetRange = document.createRange();
/* We first create an empty range */
targetRange.selectNodeContents(document.getElementById("test"));
/* Then we set the range boundaries to the children of div#test */
window.getSelection().addRange(targetRange);
/* Finally, we now select such range of content */
}
</script>

<body onload="startTest();">

<p>Test passes if each glyph of "Selected Text" is green and <strong>not red</strong> and if the underline, the overline and the line-through are also green and not red.

<div id="test">Selected Text</div>
21 changes: 21 additions & 0 deletions css/css-pseudo/active-selection-024-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Reftest Reference</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">

<style>
div
{
background-color: yellow;
color: green;
display: inline;
font-size: 300%;
}
</style>

<p>Test passes if background color of "Selected Text" is yellow and if each glyph of "Selected Text" is green.

<div>Selected Text</div>
49 changes: 49 additions & 0 deletions css/css-pseudo/active-selection-024.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Pseudo-Elements Test: active selection and first-letter pseudo-element</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-selectors">
<link rel="match" href="active-selection-024-ref.html">

<meta content="" name="flags">
<meta name="assert" content="In this test, the ::selection pseudo-element must paint over the ::first-letter pseudo-element since the first letter is being selected.">

<style>
div
{
color: black;
font-size: 300%;
}

div::first-letter
{
color: red;
}

div::selection
{
background-color: yellow;
color: green;
}
</style>

<script>
function startTest()
{
var targetRange = document.createRange();
/* We first create an empty range */
targetRange.selectNodeContents(document.getElementById("test"));
/* Then we set the range boundaries to the children of div#test */
window.getSelection().addRange(targetRange);
/* Finally, we now select such range of content */
}
</script>

<body onload="startTest();">

<p>Test passes if background color of "Selected Text" is yellow and if each glyph of "Selected Text" is green.

<div id="test">Selected Text</div>
26 changes: 26 additions & 0 deletions css/css-pseudo/active-selection-025-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Reftest Reference</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">

<style>
div
{
background-color: yellow;
color: green;
display: inline;
font-size: 300%;
}

span
{
color: purple;
}
</style>

<p>Test passes if background color of "Selected Text" is yellow, if the "S" glyph is purple and if the other glyphs are green.

<div><span>S</span>elected Text</div>
60 changes: 60 additions & 0 deletions css/css-pseudo/active-selection-025.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Pseudo-Elements Test: active selection and first-letter pseudo-element</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-selectors">
<link rel="match" href="active-selection-025-ref.html">

<meta content="" name="flags">
<meta name="assert" content="In this test, the div::selection selector has no 'color' declaration. The div::selection selector should use the 'color' declaration from the div rule and, for the first letter only, it should use the 'color' declaration from the ::first-letter pseudo-element. Therefore the first letter 'S' should be purple and the rest of the words should be green.">

<!--

More info:
[css-pseudo-4] Original color of highlight pseudo inside
::first-letter/::first-line
https://github.com/w3c/csswg-drafts/issues/4625

RESOLVED: Whatever highlight being applied uses colors from before
even if came from pseudo element like ::first-letter/::first-line

-->

<style>
div
{
color: green;
font-size: 300%;
}

div::first-letter
{
color: purple;
}

div::selection
{
background-color: yellow;
}
</style>

<script>
function startTest()
{
var targetRange = document.createRange();
/* We first create an empty range */
targetRange.selectNodeContents(document.getElementById("test"));
/* Then we set the range boundaries to the children of div#test */
window.getSelection().addRange(targetRange);
/* Finally, we now select such range of content */
}
</script>

<body onload="startTest();">

<p>Test passes if background color of "Selected Text" is yellow, if the "S" glyph is purple and if the other glyphs are green.

<div id="test">Selected Text</div>
26 changes: 26 additions & 0 deletions css/css-pseudo/active-selection-026-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Reftest Reference</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">

<style>
div
{
font-size: 300%;
}

span
{
background-color: yellow;
color: green;
}
</style>

<p>Test passes if the background color of both "selected text" is yellow and if both "selected text" are green and <strong>not red</strong>.

<div><span>1st selected text</span></div>

<div><span>2nd selected text</span></div>
49 changes: 49 additions & 0 deletions css/css-pseudo/active-selection-026.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Pseudo-Elements Test: active selection and first-line pseudo-element</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<link rel="help" href="https://www.w3.org/TR/css-pseudo-4/#highlight-selectors">
<link rel="match" href="active-selection-026-ref.html">

<meta content="" name="flags">
<meta name="assert" content="In this test, the div::selection pseudo-element must paint over the ::first-line pseudo-element since the first line is being selected.">

<style>
div
{
color: black;
font-size: 300%;
}

div::first-line
{
color: red;
}

div::selection
{
background-color: yellow;
color: green;
}
</style>

<script>
function startTest()
{
var targetRange = document.createRange();
/* We first create an empty range */
targetRange.selectNodeContents(document.getElementById("test"));
/* Then we set the range boundaries to the children of div#test */
window.getSelection().addRange(targetRange);
/* Finally, we now select such range of content */
}
</script>

<body onload="startTest();">

<p>Test passes if the background color of both "selected text" is yellow and if both "selected text" are green and <strong>not red</strong>.

<div id="test">1st selected text<br>2nd selected text</div>
35 changes: 35 additions & 0 deletions css/css-pseudo/active-selection-027-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Reftest Reference</title>

<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">

<style>
div
{
font-size: 300%;
}

span
{
background-color: yellow;
}

span#first
{
color: purple;
}

span#second
{
color: green;
}
</style>

<p>Test passes if both "selected text" have a yellow background, if the glyphs of "1st selected text" are purple and if the glyphs of "2nd selected text" are green.

<div><span id="first">1st selected text</span></div>

<div><span id="second">2nd selected text</span></div>
Loading