Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSS4Pseudo] Added 2 tests and 1 reference on selection and text-shadow #20802

Merged
merged 1 commit into from
Dec 18, 2019
Merged
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
35 changes: 35 additions & 0 deletions css/css-pseudo/selection-text-shadow-006-manual.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>

<meta charset="UTF-8">

<title>CSS Pseudo-Elements Test: partial selection done manually and multiple text-shadow (complex)</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">

<meta content="interact" name="flags">
<meta content="This test checks that text selectedness done manually must affect multiple text shadows." name="assert">

<style>
div
{
color: blue;
font-size: 300%;
margin-left: 7.16667em;
margin-top: 1.5em;
text-shadow: red 0em -1.2em 0em, red -7em 0em 0em, red 7em 0em 0em, red 0em 1.2em 0em;
}

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

<p>Instructions: select a few characters from the blue words "Text sample". Select them with mouse dragging (leftwardedly or rightwardedly) or text-highlighting them with <kbd>Shift</kbd> and keyboard arrows when keyboard navigation (also called caret browsing) is enabled.

<p>Test passes if each of the 4 correspondent red glyph counterparts disappear.

<div>Text sample</div>
21 changes: 21 additions & 0 deletions css/css-pseudo/selection-text-shadow-016-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
{
color: green;
font-size: 300%;
margin-left: 0.66667em;
margin-top: 1.5em;
}
</style>

<p>Test passes if each glyph of "Selected Text" is green and not red.

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

<meta charset="UTF-8">

<title>CSS Pseudo-Elements Test: selection and text-shadow in 4 directions (static variation)</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="selection-text-shadow-016-ref.html">

<meta content="" name="flags">
<meta content="This test checks that text selectedness must affect multiple text shadows." name="assert">

<style>
div
{
color: blue;
font-size: 300%;
margin-left: 0.66667em;
margin-top: 1.5em;
text-shadow: red 0em -0.5em 0em, red -0.5em 0em 0em, red 0.5em 0em 0em, red 0em 0.5em 0em;
}

div::selection
{
color: green;
text-shadow: none;
}
</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 each glyph of "Selected Text" is green and not red.

<div id="test">Selected Text</div>