mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Add reftests for :visited handling in layout/reftests/css-visited/ and make them run through the mochitest harness (via layout/style/test/test_visited_reftests.html) rather than the reftest harness. (Bug 147777)
This commit is contained in:
parent
3a0a941202
commit
13e72332b4
11
layout/reftests/css-visited/border-1-ref.html
Normal file
11
layout/reftests/css-visited/border-1-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
div { margin: 2px; }
|
||||
.unvis { border: medium solid olive; border-top: dashed thin blue; }
|
||||
.vis { border: medium solid fuchsia; border-top-style: dashed; border-top-width: thin; border-right-color: silver; }
|
||||
|
||||
</style>
|
||||
<div class="unvis">unvisited</div>
|
||||
<div class="vis">visited</div>
|
11
layout/reftests/css-visited/border-1.html
Normal file
11
layout/reftests/css-visited/border-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
a { text-decoration: none; color: -moz-initial; display: block; margin: 2px; }
|
||||
:link { border: medium solid olive; border-top: dashed thin blue; }
|
||||
:visited { border: thick dotted fuchsia; border-right: thin double silver; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
11
layout/reftests/css-visited/border-2-ref.html
Normal file
11
layout/reftests/css-visited/border-2-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777): default color for 'border'</title>
|
||||
<style type="text/css">
|
||||
|
||||
div { margin: 2px; }
|
||||
.link { color: maroon; border: medium solid maroon; border-top: dashed thin blue; }
|
||||
.visited { color: gray; border: medium solid fuchsia; border-top: dashed thin fuchsia; border-right-color: gray; }
|
||||
|
||||
</style>
|
||||
<div class="link">unvisited</div>
|
||||
<div class="visited">visited</div>
|
11
layout/reftests/css-visited/border-2a.html
Normal file
11
layout/reftests/css-visited/border-2a.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777): implicit default color for 'border'</title>
|
||||
<style type="text/css">
|
||||
|
||||
a { text-decoration: none; display: block; margin: 2px; }
|
||||
:link { color: maroon; border: medium solid; border-top: dashed thin blue; }
|
||||
:visited { color: gray; border: thick dotted fuchsia; border-right: thin double; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
11
layout/reftests/css-visited/border-2b.html
Normal file
11
layout/reftests/css-visited/border-2b.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777): explicit default color for 'border'</title>
|
||||
<style type="text/css">
|
||||
|
||||
a { text-decoration: none; display: block; margin: 2px; }
|
||||
:link { color: maroon; border: medium solid currentColor; border-top: dashed thin blue; }
|
||||
:visited { color: gray; border: thick dotted fuchsia; border-right: thin double currentColor; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
32
layout/reftests/css-visited/border-collapse-1-ref.html
Normal file
32
layout/reftests/css-visited/border-collapse-1-ref.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
div.table { display: table; border-collapse: collapse }
|
||||
div.row { display: table-row }
|
||||
div.link, div.visited { display: table-cell }
|
||||
|
||||
.row1 .link { border: medium solid blue }
|
||||
.row1 .visited { border: medium solid fuchsia }
|
||||
|
||||
.row2 .link { border: thin dotted black }
|
||||
.row2 .visited { border: thin dotted red }
|
||||
|
||||
.row3 .link { border: 7px double gray }
|
||||
.row3 .visited { border: 7px double olive }
|
||||
|
||||
</style>
|
||||
<div class="table">
|
||||
<div class="row row1">
|
||||
<div class="link">unvisited</div>
|
||||
<div class="visited">visited</div>
|
||||
</div>
|
||||
<div class="row row2">
|
||||
<div class="visited">visited</div>
|
||||
<div class="link">unvisited</div>
|
||||
</div>
|
||||
<div class="row row3">
|
||||
<div class="link">unvisited</div>
|
||||
<div class="visited">visited</div>
|
||||
</div>
|
||||
</div>
|
32
layout/reftests/css-visited/border-collapse-1.html
Normal file
32
layout/reftests/css-visited/border-collapse-1.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
div.table { display: table; border-collapse: collapse }
|
||||
div.row { display: table-row }
|
||||
a { text-decoration: none; color: -moz-initial; display: table-cell }
|
||||
|
||||
.row1 :link { border: medium solid blue }
|
||||
.row1 :visited { border: thick dashed fuchsia }
|
||||
|
||||
.row2 :link { border: thin dotted black }
|
||||
.row2 :visited { border: thick hidden rgba(255, 0, 0, 0.5) }
|
||||
|
||||
.row3 :link { border: 7px double gray }
|
||||
.row3 :visited { border: 4px inset olive }
|
||||
|
||||
</style>
|
||||
<div class="table">
|
||||
<div class="row row1">
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
||||
</div>
|
||||
<div class="row row2">
|
||||
<a href="visited-page.html">visited</a>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
</div>
|
||||
<div class="row row3">
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
||||
</div>
|
||||
</div>
|
10
layout/reftests/css-visited/color-choice-1-ref.html
Normal file
10
layout/reftests/css-visited/color-choice-1-ref.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
.link { background: rgba(179, 25, 87, 0.72); }
|
||||
.visited { background: rgba(28, 215, 119, 0.72); }
|
||||
|
||||
</style>
|
||||
<span class="link">unvisited</span>
|
||||
<span class="visited">visited</span>
|
11
layout/reftests/css-visited/color-choice-1.html
Normal file
11
layout/reftests/css-visited/color-choice-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
a { text-decoration: none; color: -moz-initial; }
|
||||
:link { background: rgba(179, 25, 87, 0.72); }
|
||||
:visited { background: rgba(28, 215, 119, 0.31); }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
18
layout/reftests/css-visited/color-on-bullets-1-ref.html
Normal file
18
layout/reftests/css-visited/color-on-bullets-1-ref.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
ul, ol, li { margin: 0; padding: 0 }
|
||||
li { margin-left: 4em }
|
||||
.link { color: rgba(255, 177, 83, 0.8) }
|
||||
.visited { color: rgba(128, 99, 12, 0.8) }
|
||||
|
||||
</style>
|
||||
<ol>
|
||||
<li class="link">unvisited</li>
|
||||
<li class="visited">visited</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li class="link">unvisited</li>
|
||||
<li class="visited">visited</li>
|
||||
</ul>
|
18
layout/reftests/css-visited/color-on-bullets-1.html
Normal file
18
layout/reftests/css-visited/color-on-bullets-1.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none; display: list-item; margin-left: 4em }
|
||||
:link { color: rgba(255, 177, 83, 0.8) }
|
||||
:visited { color: rgba(128, 99, 12, 0.4) }
|
||||
|
||||
</style>
|
||||
<!-- FIXME: workaround list numbering bug by using ol instead of div -->
|
||||
<ol style="list-style-type: decimal; margin: 0; padding: 0">
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
||||
</ol>
|
||||
<div style="list-style-type: disc">
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
||||
</div>
|
6
layout/reftests/css-visited/color-on-link-1-ref.html
Normal file
6
layout/reftests/css-visited/color-on-link-1-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
span { color: fuchsia; }
|
||||
</style>
|
||||
<span>link</span>
|
8
layout/reftests/css-visited/color-on-link-1.html
Normal file
8
layout/reftests/css-visited/color-on-link-1.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
a { text-decoration: none }
|
||||
:link { color: fuchsia; }
|
||||
:visited { color: purple; }
|
||||
</style>
|
||||
<a href="unvisited-page.html">link</a>
|
8
layout/reftests/css-visited/color-on-link-before-1.html
Normal file
8
layout/reftests/css-visited/color-on-link-before-1.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
a { text-decoration: none }
|
||||
:link:before { content: "link"; color: fuchsia; }
|
||||
:visited:before { content: "link"; color: purple; }
|
||||
</style>
|
||||
<a href="unvisited-page.html"></a>
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
body > span { text-decoration: underline }
|
||||
body > span > span { text-decoration: overline }
|
||||
body > span > span > span { text-decoration: line-through }
|
||||
|
||||
.link { color: olive }
|
||||
.link > span { color: fuchsia }
|
||||
.link > span > span { color: black }
|
||||
.visited { color: gray }
|
||||
.visited > span { color: maroon }
|
||||
.visited > span > span { color: purple }
|
||||
|
||||
</style>
|
||||
<span class="link"><span><span>unvisited</span></span></span>
|
||||
<span class="visited"><span><span>visited</span></span></span>
|
18
layout/reftests/css-visited/color-on-text-decoration-1.html
Normal file
18
layout/reftests/css-visited/color-on-text-decoration-1.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
body > a { text-decoration: underline }
|
||||
body > a > span { text-decoration: overline }
|
||||
body > a > span > span { text-decoration: line-through }
|
||||
|
||||
:link { color: olive }
|
||||
:link > span { color: fuchsia }
|
||||
:link > span > span { color: black }
|
||||
:visited { color: gray }
|
||||
:visited > span { color: maroon }
|
||||
:visited > span > span { color: purple }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html"><span><span>unvisited</span></span></a>
|
||||
<a href="visited-page.html"><span><span>visited</span></span></a>
|
6
layout/reftests/css-visited/color-on-visited-1-ref.html
Normal file
6
layout/reftests/css-visited/color-on-visited-1-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
span { color: purple; }
|
||||
</style>
|
||||
<span>link</span>
|
8
layout/reftests/css-visited/color-on-visited-1.html
Normal file
8
layout/reftests/css-visited/color-on-visited-1.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
a { text-decoration: none }
|
||||
:link { color: fuchsia; }
|
||||
:visited { color: purple; }
|
||||
</style>
|
||||
<a href="visited-page.html">link</a>
|
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
a { text-decoration: none }
|
||||
:link:before { content: "link"; color: fuchsia; }
|
||||
:visited:before { content: "link"; color: purple; }
|
||||
</style>
|
||||
<a href="visited-page.html"></a>
|
6
layout/reftests/css-visited/content-before-1-ref.html
Normal file
6
layout/reftests/css-visited/content-before-1-ref.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
span:before { content: "link"; }
|
||||
</style>
|
||||
<span></span>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
span:before { content: "link"; color: fuchsia; }
|
||||
</style>
|
||||
<span></span>
|
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
a { text-decoration: none }
|
||||
:link:before { content: "link"; color: fuchsia; }
|
||||
:visited:before { content: "visited"; color: purple; }
|
||||
</style>
|
||||
<a href="unvisited-page.html"></a>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
span:before { content: "link"; color: purple; }
|
||||
</style>
|
||||
<span></span>
|
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
a { text-decoration: none }
|
||||
:link:before { content: "link"; color: fuchsia; }
|
||||
:visited:before { content: "visited"; color: purple; }
|
||||
</style>
|
||||
<a href="visited-page.html"></a>
|
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
* { color: -moz-initial; text-decoration: none }
|
||||
:link:before { content: "link"; }
|
||||
:visited:before { content: "visited"; }
|
||||
</style>
|
||||
<a href="unvisited-page.html"></a>
|
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
* { color: -moz-initial; text-decoration: none }
|
||||
:link:before { content: "link"; }
|
||||
:visited:before { content: "visited"; }
|
||||
</style>
|
||||
<a href="visited-page.html"></a>
|
12
layout/reftests/css-visited/first-line-1-ref.html
Normal file
12
layout/reftests/css-visited/first-line-1-ref.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title>:visited and ::first-line (reference)</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div><span style="color: fuchsia">unvisited</span><br><span style="color: blue">link</span></div>
|
||||
<div><span style="color: maroon">visited</span><br><span style="color: purple">link</span></div>
|
||||
|
||||
</body>
|
||||
</html>
|
22
layout/reftests/css-visited/first-line-1.html
Normal file
22
layout/reftests/css-visited/first-line-1.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title>:visited and ::first-line</title>
|
||||
<style type="text/css">
|
||||
|
||||
:link, :visited { display: block; text-decoration: none; }
|
||||
|
||||
:link { color: blue }
|
||||
:link::first-line { color: fuchsia; }
|
||||
:visited { color: purple }
|
||||
:visited::first-line { color: maroon; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a href="unvisited-page.html">unvisited<br>link</a>
|
||||
<a href="visited-page.html">visited<br>link</a>
|
||||
|
||||
</body>
|
||||
</html>
|
15
layout/reftests/css-visited/inherit-keyword-1-ref.html
Normal file
15
layout/reftests/css-visited/inherit-keyword-1-ref.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML>
|
||||
<!--
|
||||
Intentionally using an HTML reference for an XHTML test, just to
|
||||
mix things up a little. :-)
|
||||
-->
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
span { text-decoration: none; color: olive }
|
||||
|
||||
</style>
|
||||
<span>unvisited / unvisited</span>
|
||||
<span>unvisited / visited</span>
|
||||
<span>visited / unvisited</span>
|
||||
<span>visited / visited</span>
|
20
layout/reftests/css-visited/inherit-keyword-1.xhtml
Normal file
20
layout/reftests/css-visited/inherit-keyword-1.xhtml
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
body > :link { color: olive; }
|
||||
body > :visited { color: fuchsia; }
|
||||
a > a { color: inherit; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a href="unvisited-page.html"><a href="unvisited-page.html">unvisited / unvisited</a></a>
|
||||
<a href="unvisited-page.html"><a href="visited-page.html">unvisited / visited</a></a>
|
||||
<a href="visited-page.html"><a href="unvisited-page.html">visited / unvisited</a></a>
|
||||
<a href="visited-page.html"><a href="visited-page.html">visited / visited</a></a>
|
||||
</body>
|
||||
</html>
|
11
layout/reftests/css-visited/outline-1-ref.html
Normal file
11
layout/reftests/css-visited/outline-1-ref.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
div { margin: 8px; }
|
||||
.unvis { outline: medium dotted blue; }
|
||||
.vis { outline: medium dotted silver; }
|
||||
|
||||
</style>
|
||||
<div class="unvis">unvisited</div>
|
||||
<div class="vis">visited</div>
|
11
layout/reftests/css-visited/outline-1.html
Normal file
11
layout/reftests/css-visited/outline-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
|
||||
a { text-decoration: none; color: -moz-initial; display: block; margin: 8px; }
|
||||
:link { outline: medium dotted blue; }
|
||||
:visited { outline: thick dashed silver; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
4
layout/reftests/css-visited/reftest.list
Normal file
4
layout/reftests/css-visited/reftest.list
Normal file
@ -0,0 +1,4 @@
|
||||
# Because coloring of visited links is asynchronous and does not block
|
||||
# or fire any events, the tests in this directory are not run through
|
||||
# the reftest harness. Instead, they are run through
|
||||
# layout/style/tests/test_visited_reftests.html .
|
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
span { color: olive; }
|
||||
</style>
|
||||
<span>unvisited</span>
|
||||
<span>visited</span>
|
11
layout/reftests/css-visited/selector-adj-sibling-1.html
Normal file
11
layout/reftests/css-visited/selector-adj-sibling-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link + span { color: olive; }
|
||||
:visited + span { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html"></a><span>unvisited</span>
|
||||
<a href="visited-page.html"></a><span>visited</span>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<span style="color: olive">unvisited + unvisited</span>
|
||||
<span style="color: fuchsia">unvisited + visited</span>
|
||||
<span style="color: olive">visited + unvisited</span>
|
||||
<span style="color: fuchsia">visited + visited</span>
|
15
layout/reftests/css-visited/selector-adj-sibling-2.html
Normal file
15
layout/reftests/css-visited/selector-adj-sibling-2.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link + :link { color: olive; }
|
||||
:visited + :link { color: red; }
|
||||
:link + :visited { color: fuchsia; }
|
||||
:visited + :visited { color: red; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html"></a><a href="unvisited-page.html">unvisited + unvisited</a>
|
||||
<a href="unvisited-page.html"></a><a href="visited-page.html">unvisited + visited</a>
|
||||
<a href="visited-page.html"></a><a href="unvisited-page.html">visited + unvisited</a>
|
||||
<a href="visited-page.html"></a><a href="visited-page.html">visited + visited</a>
|
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
div { color: olive; }
|
||||
</style>
|
||||
<div>unvisited</div>
|
||||
<div>visited</div>
|
11
layout/reftests/css-visited/selector-any-sibling-1.html
Normal file
11
layout/reftests/css-visited/selector-any-sibling-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link ~ span { color: olive; }
|
||||
:visited ~ span { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<div><a href="unvisited-page.html"></a><span>unvisited</span></div>
|
||||
<div><a href="visited-page.html"></a><span>visited</span></div>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<div style="color: olive">unvisited + unvisited</div>
|
||||
<div style="color: fuchsia">unvisited + visited</div>
|
||||
<div style="color: olive">visited + unvisited</div>
|
||||
<div style="color: fuchsia">visited + visited</div>
|
15
layout/reftests/css-visited/selector-any-sibling-2.html
Normal file
15
layout/reftests/css-visited/selector-any-sibling-2.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link ~ :link { color: olive; }
|
||||
:visited ~ :link { color: red; }
|
||||
:link ~ :visited { color: fuchsia; }
|
||||
:visited ~ :visited { color: red; }
|
||||
|
||||
</style>
|
||||
<div><a href="unvisited-page.html"></a><a href="unvisited-page.html">unvisited + unvisited</a></div>
|
||||
<div><a href="unvisited-page.html"></a><a href="visited-page.html">unvisited + visited</a></div>
|
||||
<div><a href="visited-page.html"></a><a href="unvisited-page.html">visited + unvisited</a></div>
|
||||
<div><a href="visited-page.html"></a><a href="visited-page.html">visited + visited</a></div>
|
4
layout/reftests/css-visited/selector-child-1-ref.html
Normal file
4
layout/reftests/css-visited/selector-child-1-ref.html
Normal file
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<span style="color: olive">unvisited</span>
|
||||
<span style="color: fuchsia">visited</span>
|
11
layout/reftests/css-visited/selector-child-1.html
Normal file
11
layout/reftests/css-visited/selector-child-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link > span { color: olive; }
|
||||
:visited > span { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html"><span>unvisited</span></a>
|
||||
<a href="visited-page.html"><span>visited</span></a>
|
12
layout/reftests/css-visited/selector-child-2-ref.xhtml
Normal file
12
layout/reftests/css-visited/selector-child-2-ref.xhtml
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
</head>
|
||||
<body>
|
||||
<span style="color: olive">unvisited / unvisited</span>
|
||||
<span style="color: fuchsia">unvisited / visited</span>
|
||||
<span style="color: olive">visited / unvisited</span>
|
||||
<span style="color: fuchsia">visited / visited</span>
|
||||
</body>
|
||||
</html>
|
21
layout/reftests/css-visited/selector-child-2.xhtml
Normal file
21
layout/reftests/css-visited/selector-child-2.xhtml
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link > :link { color: olive; }
|
||||
:visited > :link { color: red; }
|
||||
:link > :visited { color: fuchsia; }
|
||||
:visited > :visited { color: red; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<a href="unvisited-page.html"><a href="unvisited-page.html">unvisited / unvisited</a></a>
|
||||
<a href="unvisited-page.html"><a href="visited-page.html">unvisited / visited</a></a>
|
||||
<a href="visited-page.html"><a href="unvisited-page.html">visited / unvisited</a></a>
|
||||
<a href="visited-page.html"><a href="visited-page.html">visited / visited</a></a>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<span style="color: olive">unvisited</span>
|
||||
<span style="color: fuchsia">visited</span>
|
11
layout/reftests/css-visited/selector-descendant-1.html
Normal file
11
layout/reftests/css-visited/selector-descendant-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link span { color: olive; }
|
||||
:visited span { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html"><span>unvisited</span></a>
|
||||
<a href="visited-page.html"><span>visited</span></a>
|
36
layout/reftests/css-visited/selector-descendant-2-ref.xhtml
Normal file
36
layout/reftests/css-visited/selector-descendant-2-ref.xhtml
Normal file
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
body { color: black }
|
||||
span.l { color: olive; background: rgba(0, 255, 255, 0.5); }
|
||||
span.v { color: fuchsia; background: rgba(0, 0, 255, 0.5) }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<span class="l">unvisited</span> (<span class="l">unvisited</span>)
|
||||
<span class="l">unvisited</span> (<span class="v">visited</span>)
|
||||
<span class="v">visited</span> (<span class="l">unvisited</span>)
|
||||
<span class="v">visited</span> (<span class="v">visited</span>)
|
||||
|
||||
<span class="u">unvisited</span> (<span class="l">unvisited</span>)
|
||||
<span class="u">unvisited</span> (<span class="v">visited</span>)
|
||||
<span class="u">visited</span> (<span class="l">unvisited</span>)
|
||||
<span class="u">visited</span> (<span class="v">visited</span>)
|
||||
|
||||
<span class="l">unvisited</span> (<span class="l">unvisited</span>)
|
||||
<span class="l">unvisited</span> (<span class="l">visited</span>)
|
||||
<span class="v">visited</span> (<span class="l">unvisited</span>)
|
||||
<span class="v">visited</span> (<span class="l">visited</span>)
|
||||
|
||||
<span class="u">unvisited</span> (<span class="u">unvisited</span>)
|
||||
<span class="u">unvisited</span> (<span class="u">visited</span>)
|
||||
<span class="u">visited</span> (<span class="u">unvisited</span>)
|
||||
<span class="u">visited</span> (<span class="u">visited</span>)
|
||||
|
||||
</body>
|
||||
</html>
|
36
layout/reftests/css-visited/selector-descendant-2.xhtml
Normal file
36
layout/reftests/css-visited/selector-descendant-2.xhtml
Normal file
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none; color: black }
|
||||
.styled:link span { color: olive; background: rgba(0, 255, 255, 0.5); }
|
||||
.styled:visited span { color: fuchsia; background: rgba(0, 0, 255, 0.5) }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a class="styled" href="unvisited-page.html"><span>unvisited</span> (<a class="styled" href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a class="styled" href="unvisited-page.html"><span>unvisited</span> (<a class="styled" href="visited-page.html"><span>visited</span></a>)</a>
|
||||
<a class="styled" href="visited-page.html"><span>visited</span> (<a class="styled" href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a class="styled" href="visited-page.html"><span>visited</span> (<a class="styled" href="visited-page.html"><span>visited</span></a>)</a>
|
||||
|
||||
<a href="unvisited-page.html"><span>unvisited</span> (<a class="styled" href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a href="unvisited-page.html"><span>unvisited</span> (<a class="styled" href="visited-page.html"><span>visited</span></a>)</a>
|
||||
<a href="visited-page.html"><span>visited</span> (<a class="styled" href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a href="visited-page.html"><span>visited</span> (<a class="styled" href="visited-page.html"><span>visited</span></a>)</a>
|
||||
|
||||
<a class="styled" href="unvisited-page.html"><span>unvisited</span> (<a href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a class="styled" href="unvisited-page.html"><span>unvisited</span> (<a href="visited-page.html"><span>visited</span></a>)</a>
|
||||
<a class="styled" href="visited-page.html"><span>visited</span> (<a href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a class="styled" href="visited-page.html"><span>visited</span> (<a href="visited-page.html"><span>visited</span></a>)</a>
|
||||
|
||||
<a href="unvisited-page.html"><span>unvisited</span> (<a href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a href="unvisited-page.html"><span>unvisited</span> (<a href="visited-page.html"><span>visited</span></a>)</a>
|
||||
<a href="visited-page.html"><span>visited</span> (<a href="unvisited-page.html"><span>unvisited</span></a>)</a>
|
||||
<a href="visited-page.html"><span>visited</span> (<a href="visited-page.html"><span>visited</span></a>)</a>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,4 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<span style="color: olive">unvisited</span>
|
||||
<span style="color: fuchsia">visited</span>
|
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
span + :link { color: olive; }
|
||||
span + :visited { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<span></span><a href="unvisited-page.html">unvisited</a>
|
||||
<span></span><a href="visited-page.html">visited</a>
|
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
span ~ :link { color: olive; }
|
||||
span ~ :visited { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<span><span></span><a href="unvisited-page.html">unvisited</a></span>
|
||||
<span><span></span><a href="visited-page.html">visited</a></span>
|
11
layout/reftests/css-visited/subject-of-selector-child-1.html
Normal file
11
layout/reftests/css-visited/subject-of-selector-child-1.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
body > :link { color: olive; }
|
||||
body > :visited { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
body :link { color: olive; }
|
||||
body :visited { color: fuchsia; }
|
||||
|
||||
</style>
|
||||
<a href="unvisited-page.html">unvisited</a>
|
||||
<a href="visited-page.html">visited</a>
|
@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
.unstylink { color: blue }
|
||||
.unstyvis { color: purple }
|
||||
|
||||
.stylink { color: olive; background: rgba(0, 255, 255, 0.5); }
|
||||
.styvis { color: fuchsia; background: rgba(0, 0, 255, 0.5) }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<span class="stylink">unvisited (<span class="stylink">unvisited</span>)</span>
|
||||
<span class="stylink">unvisited (<span class="styvis">visited</span>)</span>
|
||||
<span class="styvis">visited (<span class="stylink">unvisited</span>)</span>
|
||||
<span class="styvis">visited (<span class="styvis">visited</span>)</span>
|
||||
|
||||
<span class="unstylink">unvisited (<span class="stylink">unvisited</span>)</span>
|
||||
<span class="unstylink">unvisited (<span class="styvis">visited</span>)</span>
|
||||
<span class="unstyvis">visited (<span class="stylink">unvisited</span>)</span>
|
||||
<span class="unstyvis">visited (<span class="styvis">visited</span>)</span>
|
||||
|
||||
<span class="stylink">unvisited (<span class="unstylink">unvisited</span>)</span>
|
||||
<span class="stylink">unvisited (<span class="unstyvis">visited</span>)</span>
|
||||
<span class="styvis">visited (<span class="unstylink">unvisited</span>)</span>
|
||||
<span class="styvis">visited (<span class="unstyvis">visited</span>)</span>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style>
|
||||
|
||||
a { text-decoration: none }
|
||||
:link { color: blue }
|
||||
:visited { color: purple }
|
||||
body .styled:link { color: olive; background: rgba(0, 255, 255, 0.5); }
|
||||
body .styled:visited { color: fuchsia; background: rgba(0, 0, 255, 0.5) }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<a class="styled" href="unvisited-page.html">unvisited (<a class="styled" href="unvisited-page.html">unvisited</a>)</a>
|
||||
<a class="styled" href="unvisited-page.html">unvisited (<a class="styled" href="visited-page.html">visited</a>)</a>
|
||||
<a class="styled" href="visited-page.html">visited (<a class="styled" href="unvisited-page.html">unvisited</a>)</a>
|
||||
<a class="styled" href="visited-page.html">visited (<a class="styled" href="visited-page.html">visited</a>)</a>
|
||||
|
||||
<a href="unvisited-page.html">unvisited (<a class="styled" href="unvisited-page.html">unvisited</a>)</a>
|
||||
<a href="unvisited-page.html">unvisited (<a class="styled" href="visited-page.html">visited</a>)</a>
|
||||
<a href="visited-page.html">visited (<a class="styled" href="unvisited-page.html">unvisited</a>)</a>
|
||||
<a href="visited-page.html">visited (<a class="styled" href="visited-page.html">visited</a>)</a>
|
||||
|
||||
<a class="styled" href="unvisited-page.html">unvisited (<a href="unvisited-page.html">unvisited</a>)</a>
|
||||
<a class="styled" href="unvisited-page.html">unvisited (<a href="visited-page.html">visited</a>)</a>
|
||||
<a class="styled" href="visited-page.html">visited (<a href="unvisited-page.html">unvisited</a>)</a>
|
||||
<a class="styled" href="visited-page.html">visited (<a href="visited-page.html">visited</a>)</a>
|
||||
|
||||
</body>
|
||||
</html>
|
2
layout/reftests/css-visited/visited-page.html
Normal file
2
layout/reftests/css-visited/visited-page.html
Normal file
@ -0,0 +1,2 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Visited page for tests for privacy restrictions on :visited (Bug 147777)</title>
|
12
layout/reftests/css-visited/width-1-ref.html
Normal file
12
layout/reftests/css-visited/width-1-ref.html
Normal file
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="width: 100px"></div>
|
||||
</td>
|
||||
<td>
|
||||
text in next cell
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
17
layout/reftests/css-visited/width-on-link-1.html
Normal file
17
layout/reftests/css-visited/width-on-link-1.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
:link, :visited { display: block }
|
||||
:link { width: 100px; }
|
||||
:visited { width: 200px; }
|
||||
</style>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="unvisited-page.html"></a>
|
||||
</td>
|
||||
<td>
|
||||
text in next cell
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
17
layout/reftests/css-visited/width-on-visited-1.html
Normal file
17
layout/reftests/css-visited/width-on-visited-1.html
Normal file
@ -0,0 +1,17 @@
|
||||
<!DOCTYPE HTML>
|
||||
<title>Test for privacy restrictions on :visited (Bug 147777)</title>
|
||||
<style type="text/css">
|
||||
:link, :visited { display: block }
|
||||
:link { width: 100px; }
|
||||
:visited { width: 200px; }
|
||||
</style>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="visited-page.html"></a>
|
||||
</td>
|
||||
<td>
|
||||
text in next cell
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
@ -62,6 +62,10 @@ include css-transitions/reftest.list
|
||||
# css values and units
|
||||
include css-valuesandunits/reftest.list
|
||||
|
||||
# Reftests in css-visited are run using
|
||||
# layout/style/test/test_visited_reftests instead of using the reftest
|
||||
# harness.
|
||||
|
||||
# columns/
|
||||
include columns/reftest.list
|
||||
|
||||
|
@ -177,6 +177,7 @@ _TEST_FILES = test_acid3_test46.html \
|
||||
test_value_computation.html \
|
||||
test_value_storage.html \
|
||||
test_visited_pref.html \
|
||||
test_visited_reftests.html \
|
||||
css_properties.js \
|
||||
property_database.js \
|
||||
descriptor_database.js \
|
||||
@ -203,6 +204,10 @@ _TEST_FILES = test_acid3_test46.html \
|
||||
visited-pref-iframe.html \
|
||||
$(NULL)
|
||||
|
||||
_VISITED_REFTEST_FILES = \
|
||||
$(shell find $(topsrcdir)/layout/reftests/css-visited/ -name '*.html' -o -name '*.xhtml') \
|
||||
$(NULL)
|
||||
|
||||
_BROWSER_FILES = \
|
||||
browser_bug453896.js \
|
||||
bug453896_iframe.html \
|
||||
@ -212,5 +217,8 @@ _BROWSER_FILES = \
|
||||
libs:: $(_TEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||
|
||||
libs:: $(_VISITED_REFTEST_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)/css-visited/
|
||||
|
||||
libs:: $(_BROWSER_FILES)
|
||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
|
||||
|
181
layout/style/test/test_visited_reftests.html
Normal file
181
layout/style/test/test_visited_reftests.html
Normal file
@ -0,0 +1,181 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=147777
|
||||
-->
|
||||
<head>
|
||||
<title>Test for Bug 147777</title>
|
||||
<script type="application/javascript" src="/MochiKit/packed.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=147777">Mozilla Bug 147777</a>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 147777 **/
|
||||
|
||||
// Because link-coloring for visited links is asynchronous, running
|
||||
// reftests that involve link coloring requires that we poll for the
|
||||
// correct result until all links are styled correctly.
|
||||
|
||||
// A requirement of these reftests is that the reference rendering is
|
||||
// styled correctly when loaded. We only poll for the tests.
|
||||
|
||||
var gTests = [
|
||||
// there's also an implicit "load visited-page.html" at the start,
|
||||
// thanks to the code below.
|
||||
|
||||
// IMPORTANT NOTE: For these tests, the test and reference are not
|
||||
// snapshotted in the same way. The REFERENCE (second file) is
|
||||
// assumed to be complete when loaded, but we poll for visited link
|
||||
// coloring on the TEST (first file) until the test passes.
|
||||
"!= color-on-link-1-ref.html color-on-visited-1-ref.html",
|
||||
"== color-on-link-1.html color-on-link-1-ref.html",
|
||||
"== color-on-link-before-1.html color-on-link-1-ref.html",
|
||||
"== color-on-visited-1.html color-on-visited-1-ref.html",
|
||||
"== color-on-visited-before-1.html color-on-visited-1-ref.html",
|
||||
"!= content-color-on-link-before-1-ref.html content-color-on-visited-before-1-ref.html",
|
||||
"== content-color-on-link-before-1.html content-color-on-link-before-1-ref.html",
|
||||
"== content-color-on-visited-before-1.html content-color-on-visited-before-1-ref.html",
|
||||
"== content-on-link-before-1.html content-before-1-ref.html",
|
||||
"== content-on-visited-before-1.html content-before-1-ref.html",
|
||||
"== color-on-text-decoration-1.html color-on-text-decoration-1-ref.html",
|
||||
"== color-on-bullets-1.html color-on-bullets-1-ref.html",
|
||||
// NOTE: background-color is tested by all the selector tests (and
|
||||
// also color-choice-1) and therefore doesn't have its own tests.
|
||||
// FIXME: Maybe add a test for selection colors (foreground and
|
||||
// background), if possible.
|
||||
"== width-on-link-1.html width-1-ref.html",
|
||||
"== width-on-visited-1.html width-1-ref.html",
|
||||
"== border-1.html border-1-ref.html",
|
||||
"== border-2a.html border-2-ref.html",
|
||||
"== border-2b.html border-2-ref.html",
|
||||
// FIXME: Commented out because of dynamic change handling bugs in
|
||||
// border-collapse tables that mean we get an incorrect rendering when
|
||||
// the asynchronous restyle-from-history arrives.
|
||||
//"== border-collapse-1.html border-collapse-1-ref.html",
|
||||
"== outline-1.html outline-1-ref.html",
|
||||
"== color-choice-1.html color-choice-1-ref.html",
|
||||
"== selector-descendant-1.html selector-descendant-1-ref.html",
|
||||
"== selector-descendant-2.xhtml selector-descendant-2-ref.xhtml",
|
||||
"== selector-child-1.html selector-child-1-ref.html",
|
||||
"== selector-child-2.xhtml selector-child-2-ref.xhtml",
|
||||
"== selector-adj-sibling-1.html selector-adj-sibling-1-ref.html",
|
||||
"== selector-adj-sibling-2.html selector-adj-sibling-2-ref.html",
|
||||
"== selector-any-sibling-1.html selector-any-sibling-1-ref.html",
|
||||
"== selector-any-sibling-2.html selector-any-sibling-2-ref.html",
|
||||
"== subject-of-selector-descendant-1.html subject-of-selector-1-ref.html",
|
||||
"== subject-of-selector-descendant-2.xhtml subject-of-selector-descendant-2-ref.xhtml",
|
||||
"== subject-of-selector-child-1.html subject-of-selector-1-ref.html",
|
||||
"== subject-of-selector-adj-sibling-1.html subject-of-selector-1-ref.html",
|
||||
"== subject-of-selector-any-sibling-1.html subject-of-selector-1-ref.html",
|
||||
"== inherit-keyword-1.xhtml inherit-keyword-1-ref.html",
|
||||
// FIXME: commented out because dynamic changes on the non-first-line
|
||||
// part of the test don't work right when the link becomes visited.
|
||||
//"== first-line-1.html first-line-1-ref.html",
|
||||
];
|
||||
|
||||
// Maintain a reference count of how many things we're waiting for until
|
||||
// we can say the tests are done.
|
||||
var gDelayCount = 0;
|
||||
function AddFinishDependency()
|
||||
{ ++gDelayCount; }
|
||||
function RemoveFinishDependency()
|
||||
{ if (--gDelayCount == 0) SimpleTest.finish(); }
|
||||
|
||||
function loadVisitedPage()
|
||||
{
|
||||
var element = document.createElement("iframe");
|
||||
element.addEventListener("load", visitedPageLoad, false);
|
||||
element.src = "css-visited/visited-page.html";
|
||||
document.body.appendChild(element);
|
||||
AddFinishDependency();
|
||||
}
|
||||
|
||||
function visitedPageLoad()
|
||||
{
|
||||
for (var i = 0; i < gTests.length; ++i) {
|
||||
startTest(i);
|
||||
}
|
||||
RemoveFinishDependency();
|
||||
}
|
||||
|
||||
function takeSnapshot(iframe_element)
|
||||
{
|
||||
return snapshotWindow(iframe_element.contentWindow, false);
|
||||
}
|
||||
|
||||
function passes(op, shot1, shot2)
|
||||
{
|
||||
var [correct, s1, s2] = compareSnapshots(shot1, shot2, op == "==");
|
||||
return correct;
|
||||
}
|
||||
|
||||
function startTest(i)
|
||||
{
|
||||
var testLine = gTests[i];
|
||||
var splitData = testLine.split(" ");
|
||||
var testData =
|
||||
{ op: splitData[0], test: splitData[1], reference: splitData[2] };
|
||||
|
||||
// Maintain state specific to this test in the closure exposed to all
|
||||
// the functions nested inside this one.
|
||||
|
||||
function startIframe(url)
|
||||
{
|
||||
var element = document.createElement("iframe");
|
||||
element.addEventListener("load", handleLoad, false);
|
||||
// smaller than normal reftests, but enough for these
|
||||
element.setAttribute("style", "width: 30em; height: 10em");
|
||||
element.src = "css-visited/" + url;
|
||||
document.body.appendChild(element);
|
||||
function handleLoad(event)
|
||||
{
|
||||
iframe.loaded = true;
|
||||
if (iframe == reference) {
|
||||
reference.snapshot = takeSnapshot(element);
|
||||
}
|
||||
var other = (iframe == test) ? reference : test;
|
||||
if (other.loaded) {
|
||||
// Always wait at least 100ms, so that any test that switches
|
||||
// from passing to failing when the asynchronous link coloring
|
||||
// happens should fail at least some of the time.
|
||||
setTimeout(checkTest, 100);
|
||||
}
|
||||
}
|
||||
function checkTest()
|
||||
{
|
||||
var test_snapshot = takeSnapshot(test.element);
|
||||
if (passes(testData.op, test_snapshot, reference.snapshot)) {
|
||||
reportSuccess();
|
||||
} else {
|
||||
// Links might not have been colored yet. Try again in 100ms.
|
||||
setTimeout(checkTest, 100);
|
||||
}
|
||||
}
|
||||
function reportSuccess()
|
||||
{
|
||||
RemoveFinishDependency();
|
||||
ok(true, "(" + i + ") " +
|
||||
testData.op + " " + testData.test + " " + testData.reference);
|
||||
}
|
||||
var iframe = { element: element, loaded: false };
|
||||
|
||||
return iframe;
|
||||
}
|
||||
|
||||
AddFinishDependency();
|
||||
var test = startIframe(testData.test);
|
||||
var reference = startIframe(testData.reference);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
loadVisitedPage();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user