Bug 773296 - Part 26: Tests. r=dbaron

This commit is contained in:
Cameron McCormack 2013-12-12 13:09:47 +11:00
parent 930a09233d
commit 0a1eedfeea
189 changed files with 3849 additions and 10 deletions

View File

@ -0,0 +1,4 @@
default-preferences pref(layout.css.variables.enabled,true)
== variables-ruletree-cache-01.html variables-ruletree-cache-01-ref.html
== variables-ruletree-cache-02.html variables-ruletree-cache-02-ref.html

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<style>
p { background-color: purple; }
p#myid { background-color: blue; }
</style>
<p>This should be purple, and might cache background in the rule tree.</p>
<p id="myid">This should be blue, and can't used that cached struct,
which really shouldn't be cached anyway.</p>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<style>
p { var-foo: purple; background-color: var(foo) }
p#myid { var-foo: blue }
</style>
<p>This should be purple, and might cache background in the rule tree.</p>
<p id="myid">This should be blue, and can't used that cached struct,
which really shouldn't be cached anyway.</p>

View File

@ -0,0 +1,7 @@
<!DOCTYPE html>
<style>
div#a { background-color: purple; }
div#b { background-color: blue; }
</style>
<div id="a"><p>This should be purple.</p></div>
<div id="b"><p>This should be blue.</p></div>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<style>
div#a { var-foo: purple }
div#b { var-foo: blue }
p { background-color: var(foo) }
</style>
<div id="a"><p>This should be purple.</p></div>
<div id="b"><p>This should be blue.</p></div>

View File

@ -117,6 +117,9 @@ skip-if(Android||B2G) include css-ui-valid/reftest.list
# css values and units
skip-if(B2G) include css-valuesandunits/reftest.list
# css variables
include css-variables/reftest.list
# Reftests in css-visited are run using
# layout/style/test/test_visited_reftests instead of using the reftest
# harness.

View File

@ -54,3 +54,6 @@ include ui3/reftest.list
# Values and Units Level 3
include values3/reftest.list
# Variables Level 1
include variables/reftest.list

View File

@ -0,0 +1,168 @@
default-preferences pref(layout.css.variables.enabled,true)
== variable-declaration-01.html support/color-green-ref.html
== variable-declaration-02.html support/color-green-ref.html
== variable-declaration-03.html support/color-green-ref.html
== variable-declaration-04.html support/color-green-ref.html
== variable-declaration-05.html support/color-green-ref.html
== variable-declaration-06.html support/color-green-ref.html
== variable-declaration-07.html support/color-green-ref.html
== variable-declaration-08.html support/color-green-ref.html
== variable-declaration-09.html support/color-green-ref.html
== variable-declaration-10.html support/color-green-ref.html
== variable-declaration-11.html support/color-green-ref.html
== variable-declaration-12.html support/color-green-ref.html
== variable-declaration-13.html support/color-green-ref.html
== variable-declaration-14.html support/color-green-ref.html
== variable-declaration-15.html variable-declaration-15-ref.html
== variable-declaration-16.html variable-declaration-16-ref.html
== variable-declaration-17.html variable-declaration-17-ref.html
== variable-declaration-18.html variable-declaration-18-ref.html
== variable-declaration-19.html support/color-green-ref.html
== variable-declaration-20.html support/color-green-ref.html
== variable-declaration-21.html support/color-green-ref.html
== variable-declaration-22.html support/color-green-ref.html
== variable-declaration-23.html support/color-green-ref.html
== variable-declaration-24.html support/color-green-ref.html
== variable-declaration-25.html support/color-green-ref.html
== variable-declaration-26.html support/color-green-ref.html
== variable-declaration-28.html support/color-green-ref.html
== variable-declaration-29.html support/color-green-ref.html
== variable-declaration-30.html support/color-green-ref.html
== variable-declaration-31.html support/color-green-ref.html
== variable-declaration-32.html support/color-green-ref.html
== variable-declaration-33.html support/color-green-ref.html
== variable-declaration-34.html support/color-green-ref.html
== variable-declaration-35.html support/color-green-ref.html
== variable-declaration-36.html support/color-green-ref.html
== variable-declaration-37.html support/color-green-ref.html
== variable-declaration-38.html support/color-green-ref.html
== variable-declaration-39.html support/color-green-ref.html
== variable-declaration-40.html support/color-green-ref.html
== variable-declaration-41.html support/color-green-ref.html
== variable-declaration-42.html support/color-green-ref.html
== variable-declaration-43.html support/color-green-ref.html
== variable-declaration-44.html support/color-green-ref.html
== variable-declaration-45.html support/color-green-ref.html
== variable-declaration-46.html support/color-green-ref.html
== variable-declaration-47.html support/color-green-ref.html
== variable-declaration-48.html support/color-green-ref.html
== variable-declaration-49.html support/color-green-ref.html
== variable-declaration-50.html support/color-green-ref.html
== variable-declaration-51.html support/color-green-ref.html
== variable-declaration-52.html support/color-green-ref.html
== variable-declaration-53.html support/color-green-ref.html
== variable-declaration-54.html support/color-green-ref.html
== variable-declaration-55.html support/color-green-ref.html
== variable-declaration-56.html support/color-green-ref.html
== variable-declaration-57.html support/color-green-ref.html
== variable-declaration-58.html support/color-green-ref.html
== variable-declaration-59.html support/color-green-ref.html
== variable-declaration-60.html support/color-green-ref.html
== variable-font-face-01.html variable-font-face-01-ref.html
== variable-font-face-02.html variable-font-face-02-ref.html
== variable-reference-01.html support/color-green-ref.html
== variable-reference-02.html support/color-green-ref.html
== variable-reference-03.html support/color-green-ref.html
== variable-reference-04.html support/color-green-ref.html
== variable-reference-05.html support/color-green-ref.html
== variable-reference-06.html support/color-green-ref.html
== variable-reference-07.html support/color-green-ref.html
== variable-reference-08.html support/color-green-ref.html
== variable-reference-09.html support/color-green-ref.html
== variable-reference-10.html support/color-green-ref.html
== variable-reference-11.html support/color-green-ref.html
== variable-reference-12.html variable-reference-12-ref.html
== variable-reference-13.html support/color-green-ref.html
== variable-reference-14.html support/color-green-ref.html
== variable-reference-15.html support/color-green-ref.html
== variable-reference-16.html support/color-green-ref.html
== variable-reference-17.html support/color-green-ref.html
== variable-reference-18.html support/color-green-ref.html
== variable-reference-19.html support/color-green-ref.html
== variable-reference-20.html support/color-green-ref.html
== variable-reference-21.html support/color-green-ref.html
== variable-reference-22.html support/color-green-ref.html
== variable-reference-23.html support/color-green-ref.html
== variable-reference-24.html support/color-green-ref.html
== variable-reference-25.html support/color-green-ref.html
== variable-reference-26.html support/color-green-ref.html
== variable-reference-27.html support/color-green-ref.html
== variable-reference-28.html support/color-green-ref.html
== variable-reference-29.html support/color-green-ref.html
== variable-reference-30.html support/color-green-ref.html
== variable-reference-31.html support/color-green-ref.html
== variable-reference-32.html support/color-green-ref.html
== variable-reference-33.html support/color-green-ref.html
== variable-reference-34.html support/color-green-ref.html
== variable-reference-35.html support/color-green-ref.html
== variable-reference-36.html variable-reference-36-ref.html
== variable-reference-37.html variable-reference-37-ref.html
== variable-reference-38.html variable-reference-38-ref.html
== variable-supports-01.html support/color-green-ref.html
== variable-supports-02.html support/color-green-ref.html
== variable-supports-03.html support/color-green-ref.html
== variable-supports-04.html support/color-green-ref.html
== variable-supports-05.html support/color-green-ref.html
== variable-supports-06.html support/color-green-ref.html
== variable-supports-07.html support/color-green-ref.html
== variable-supports-08.html support/color-green-ref.html
== variable-supports-09.html support/color-green-ref.html
== variable-supports-10.html support/color-green-ref.html
== variable-supports-11.html support/color-green-ref.html
== variable-supports-12.html support/color-green-ref.html
== variable-supports-13.html support/color-green-ref.html
== variable-supports-14.html support/color-green-ref.html
== variable-supports-15.html support/color-green-ref.html
== variable-supports-16.html support/color-green-ref.html
== variable-supports-17.html support/color-green-ref.html
== variable-supports-18.html support/color-green-ref.html
== variable-supports-19.html support/color-green-ref.html
== variable-supports-20.html support/color-green-ref.html
== variable-supports-21.html support/color-green-ref.html
== variable-supports-22.html support/color-green-ref.html
== variable-supports-23.html support/color-green-ref.html
== variable-supports-24.html support/color-green-ref.html
== variable-supports-25.html support/color-green-ref.html
== variable-supports-26.html support/color-green-ref.html
== variable-supports-27.html support/color-green-ref.html
== variable-supports-28.html support/color-green-ref.html
== variable-supports-29.html support/color-green-ref.html
== variable-supports-30.html support/color-green-ref.html
== variable-supports-31.html support/color-green-ref.html
== variable-supports-32.html support/color-green-ref.html
== variable-supports-33.html support/color-green-ref.html
== variable-supports-34.html support/color-green-ref.html
== variable-supports-35.html support/color-green-ref.html
== variable-supports-36.html support/color-green-ref.html
== variable-supports-37.html support/color-green-ref.html
== variable-supports-38.html support/color-green-ref.html
== variable-supports-39.html support/color-green-ref.html
== variable-supports-40.html support/color-green-ref.html
== variable-supports-41.html support/color-green-ref.html
== variable-supports-42.html support/color-green-ref.html
== variable-supports-43.html support/color-green-ref.html
== variable-supports-44.html support/color-green-ref.html
== variable-supports-45.html support/color-green-ref.html
== variable-supports-46.html support/color-green-ref.html
== variable-supports-47.html support/color-green-ref.html
== variable-supports-48.html support/color-green-ref.html
== variable-supports-49.html support/color-green-ref.html
== variable-supports-50.html support/color-green-ref.html
== variable-supports-51.html support/color-green-ref.html
== variable-supports-52.html support/color-green-ref.html
== variable-supports-53.html support/color-green-ref.html
== variable-supports-54.html support/color-green-ref.html
== variable-supports-55.html support/color-green-ref.html
== variable-supports-56.html support/color-green-ref.html
== variable-supports-57.html support/color-green-ref.html
== variable-supports-58.html support/color-green-ref.html
== variable-supports-59.html support/color-green-ref.html
== variable-supports-60.html support/color-green-ref.html
== variable-supports-61.html support/color-green-ref.html
== variable-supports-62.html support/color-green-ref.html
== variable-supports-63.html support/color-green-ref.html
== variable-supports-64.html support/color-green-ref.html
== variable-supports-65.html support/color-green-ref.html
== variable-supports-66.html support/color-green-ref.html
== variable-supports-67.html support/color-green-ref.html

View File

@ -0,0 +1,4 @@
@font-face {
font-family: "Ahem";
src: url(../../../../fonts/Ahem.ttf);
}

View File

@ -0,0 +1,13 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<style>
p {
color: green;
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable consisting of a single token preceded by white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable consisting of a single token with no preceding white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a:green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,18 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that references another variable.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: var(b);
var-b: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,18 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable consisting of a variable reference followed by white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: var(b) ;
var-b: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,18 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable consisting of a variable reference that includes white space around the variable name.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: var( b ) ;
var-b: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,18 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test overriding an existing variable declaration.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: orange;
var-a: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with invalid syntax due to a variable reference having no tokens in its fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
var-b: crimson;
var-a: var(b,);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a variable reference whose fallback is white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: orange;
var-b: green;
var-a: var(b, );
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with invalid syntax due to a variable reference having only a comment in its fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
var-b: crimson;
var-a: var(b,/**/);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a variable reference with a fallback that includes a comment and an identifier.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: orange;
var-b: green;
var-a: var(b,/**/a);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with invalid syntax due to a variable reference having a '!' token at the top level of its fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
var-b: crimson;
var-a: var(b,!);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with invalid syntax due to a variable reference having a ';' token at the top level of its fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
var-b: crimson;
var-a: var(b,;);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with invalid syntax due to a variable reference having "!important" the top level of its fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
var-b: crimson;
var-a: var(b,!important);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a variable reference and a following identifier with no intervening white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: green;
}
span {
color: red;
var-a:var(b)red;
var-b:orange;
color: var(a);
}
</style>
<p><span>This text must be green.</span></p>

View File

@ -0,0 +1,15 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<meta name="flags" content="ahem">
<style>
p {
font-family: Ahem, sans-serif;
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a comma-separated font family list.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="variable-declaration-15-ref.html">
<meta name="flags" content="ahem">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<style>
body {
font-family: serif;
}
p {
font-family: monospace;
var-a: Ahem, sans-serif;
font-family: var(a);
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,15 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<meta name="flags" content="ahem">
<style>
p {
font-family: Ahem, sans-serif;
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a comma-separated font family list with the first item being a variable reference.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="variable-declaration-16-ref.html">
<meta name="flags" content="ahem">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<style>
body {
font-family: serif;
}
p {
font-family: monospace;
var-a: var(b), sans-serif;
var-b: Ahem;
font-family: var(a);
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,15 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<meta name="flags" content="ahem">
<style>
p {
font-family: SomeUnknownFont, Ahem;
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a comma-separated font family list with the last item being a variable reference.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="variable-declaration-17-ref.html">
<meta name="flags" content="ahem">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<style>
body {
font-family: serif;
}
p {
font-family: monospace;
var-a: SomeUnknownFont, var(b);
var-b: Ahem;
font-family: var(a);
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,15 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<meta name="flags" content="ahem">
<style>
p {
font-family: Ahem, sans-serif;
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a comma-separated font family list with the comma coming from a variable reference.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="variable-declaration-18-ref.html">
<meta name="flags" content="ahem">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<style>
body {
font-family: serif;
}
p {
font-family: monospace;
var-a: Ahem var(b) sans-serif;
var-b: ,;
font-family: var(a);
}
</style>
<p>This text must be in Ahem.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a function where one of the arguments is a variable reference.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: rgb(0, var(b), 0);
var-b: 128;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with "!important".</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: var(b) !important;
var-b: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a function where all of the arguments and commas are made up of variable references.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: rgb(var(b)var(c)var(d));
var-b: 0,;
var-c: 128,;
var-d: 0;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a variable reference with a number of levels of variable reference fallbacks.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: var(b, var(c, var(d, green)));
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with invalid syntax due to having two "!important" priorities.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: green;
var-b: crimson;
var-a: var(b) !important !important;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,25 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that contains a CDO token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: green;
}
p {
color: red;
}
p {
color: orange;
var-a: green;
var-b: crimson;
var-a: var(b) <!--;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,25 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that contains a CDC token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: green;
}
p {
color: red;
}
p {
color: orange;
var-a: green;
var-b: crimson;
var-a: --> var(b);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that contains only a white space token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: ;
color: var(a) green;
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with invalid syntax due to having no tokens.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: green;
var-a:;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with an invalid custom property name "var-".</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-: crimson;
var-a: var();
color: var(a,green);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that contains a variable reference to itself.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#cycles">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: crimson;
var-a: var(a);
color: var(a,green);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the variable name begins with a digit.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-0: green;
color: var(\30);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the variable name begins with an escaped digit.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-\30: green;
color: var(\30);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the variable name begins with an escaped letter.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-\61: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the variable name begins with a lone surrogate.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-\d800: green;
color: var(\fffd);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the variable name begins with U+FFFD.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-\fffd: green;
color: var(\fffd);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the variable name begins with an out-of-range Unicode character escape.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-\ffffff: green;
color: var(\fffd);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable consisting of a variable reference where white space surrounds the comma separating the variable name and fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: var(b , );
color: var(a) green;
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring two variables in the same declaration block that differ only in case, with lowercase first.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: green;
var-A: crimson;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring two variables in the same declaration block that differ only in case, with uppercase first.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-A: green;
var-a: crimson;
color: var(A);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with an invalid custom property name due to it beginning with "VAR-".</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: green;
VAR-a: crimson;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the 'a' in the "var-" prefix of the custom property name is escaped.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
v\61r-a: green;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable where the custom property name includes an unescaped Chinese character and an escape that is terminated by a space character.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<meta charset=utf-8>
<style>
p {
color: red;
}
p {
color: orange;
var-a-长-name-that-might-be-longer-than-you\27 d-normally-use: green;
color: var(a-长-name-that-might-be-longer-than-you\27 d-normally-use);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable whose value is "initial".</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: initial;
color: var(a,green);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable whose value is "inherit" where there is no variable to inherit from.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
}
p {
color: orange;
var-a: inherit;
color: var(a,green);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,24 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable whose value is "inherit" where there is a variable to inherit from.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: green;
color: crimson;
}
p {
color: red;
}
p {
color: orange;
var-a: inherit;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable whose value is "initial" where there is a variable to inherit from.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: crimson;
}
p {
color: red;
}
p {
color: orange;
var-a: initial;
color: var(a,green);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,25 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable whose value consists of a reference to a variable whose value is "inherit".</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-b: green;
color: crimson;
}
p {
color: red;
}
p {
color: orange;
var-a: var(b);
var-b: inherit;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,25 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a number of variables in a cycle.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#cycles">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: green;
}
p {
color: crimson;
var-a: red var(b);
var-b: var(c);
var-c: var(d);
var-d: var(e);
var-e: var(a);
var-f: var(e);
color: var(f);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,26 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that is a dependent of a variable involved in a cycle but which itself is not involved in a cycle.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#cycles">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: orange;
}
p {
color: crimson;
var-a: red var(b) var(g);
var-b: var(c);
var-c: var(d);
var-d: var(e);
var-e: var(a);
var-f: var(e);
var-g: green;
color: var(g);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,25 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a number of variables in a chain, where the final element of the chain uses its fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#cycles">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: green;
}
p {
color: crimson;
var-a: var(b,red);
var-b: var(c);
var-c: var(d);
var-d: var(e);
var-e: var(a);
var-f: var(e);
color: var(f);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,24 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a reference to an invalid inherited variable.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#invalid-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: orange;
var-c: var(a);
}
p {
var-a: var(b);
}
p {
color: red;
var-b: var(c,green);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,24 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of a reference to an inherited variable whose value was a variable reference that used its fallback.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: orange;
var-c: var(a,green);
}
p {
var-a: var(b);
}
p {
color: red;
var-b: var(c,crimson);
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of two variable references without fallback and with no intervening white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: green;
}
span {
color: red;
var-a:var(b)var(c);
var-b:orange;
var-c:red;
color: var(a);
}
</style>
<p><span>This text must be green.</span></p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of two variable references with the first variable reference using fallback and with no intervening white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: green;
}
span {
color: red;
var-a:var(b,orange)var(c);
var-c:red;
color: var(a);
}
</style>
<p><span>This text must be green.</span></p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable that consists of two variable references with the second variable reference using fallback and with no intervening white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: green;
}
span {
color: red;
var-a:var(b)var(c,red);
var-b:orange;
color: var(a);
}
</style>
<p><span>This text must be green.</span></p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a variable with a trailing invalid token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: var(a);
var-a: green;
var-a: red);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<meta charset=utf-8>
<title>CSS Test: Test declaring a variable with a value whose name is "initial" but using Turkish dotted/dotless 'i's.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#syntax">
<link rel="match" href="support/color-green-ref.html">
<style>
div {
color: orange;
var-a: green;
color: var(a);
}
p {
var-b: İnitial;
var-c: ınitial;
color: var(b,var(c,red));
}
</style>
<div><p>This text must be green.</p></div>

View File

@ -0,0 +1,11 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<meta name="flags" content="ahem">
<p>This text must not be in Ahem.</p>
<p style="font-family: Ahem">But this text must be in Ahem.</p>

View File

@ -0,0 +1,29 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the invalid declaration and use of a variable in an @font-face rule.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="variable-font-face-01-ref.html">
<meta name="flags" content="ahem">
<style>
@font-face {
var-a: MyTestFontName;
font-family: var(a);
src: url(../../../fonts/Ahem.ttf);
}
@font-face {
font-family: MyTestFontName2;
src: url(../../../fonts/Ahem.ttf);
}
#a {
font-family: MyTestFontName;
}
#b {
font-family: MyTestFontName2;
}
</style>
<p id=a>This text must not be in Ahem.</p>
<p id=b>But this text must be in Ahem.</p>

View File

@ -0,0 +1,11 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="stylesheet" href="support/ahem.css" type="text/css">
<meta name="flags" content="ahem">
<p>This text must not be in Ahem.</p>
<p style="font-family: Ahem">But this text must be in Ahem.</p>

View File

@ -0,0 +1,31 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the invalid use of a variable in an @font-face rule where the variable is defined on the root element.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="variable-font-face-02-ref.html">
<meta name="flags" content="ahem">
<style>
:root {
var-a: MyTestFontName;
}
@font-face {
font-family: var(a);
src: url(../../../fonts/Ahem.ttf);
}
@font-face {
font-family: MyTestFontName2;
src: url(../../../fonts/Ahem.ttf);
}
#a {
font-family: MyTestFontName;
}
#b {
font-family: MyTestFontName2;
}
</style>
<p id=a>This text must not be in Ahem.</p>
<p id=b>But this text must be in Ahem.</p>

View File

@ -0,0 +1,18 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the use of a variable in a non-custom property where the variable value is inherited.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
:root {
var-a: green;
}
p {
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,23 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the use of a variable in a non-custom property where the value is invalid at computed-value time due to referencing a non-existent variable.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#invalid-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
:root {
var-a: crimson;
color: red;
}
body {
color: green;
}
p {
color: orange;
color: var(a) var(b);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the use of two variables in a non-custom property where the variable values are inherited and one of the variable values consists only of white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
:root {
var-a: green;
var-b: ;
color: red;
}
p {
color: crimson;
color: var(a) var(b);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the use of two variables in a non-custom property where one variable is inherited and the other references a non-existing variable with fallback that consists only of white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
:root {
var-a: green;
color: red;
}
p {
color: crimson;
color: var(a) var(b, );
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the use of a variable in a non-custom property where the values contains no tokens other than the variable reference.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: green;
color: red;
}
p {
color: crimson;
color:var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property with invalid syntax due to having a variable reference whose fallback contains no tokens.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: crimson;
color: red;
}
p {
color: green;
color: var(a,);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property with invalid syntax due to having a variable reference whose fallback contains a top level ';' token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: crimson;
color: red;
}
p {
color: green;
color: var(a,;);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property with invalid syntax due to having a variable reference whose fallback contains a top level '!' token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: crimson;
color: red;
}
p {
color: green;
color: var(a,!);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property with a variable reference that has a non-top level ';' token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: green;
color: crimson;
}
p {
color: red;
color: var(a,(;));
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property with a variable reference that has a non-top level '!' token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: green;
color: crimson;
}
p {
color: red;
color: var(a,(!));
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property with invalid syntax due to having a variable reference whose fallback contains nothing but a comment.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
var-a: crimson;
color: red;
}
p {
color: green;
color: var(a,/**/);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,9 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Reftest Reference</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<p>The words "hello there" must appear below:</p>
<p>hello there</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test the use of variable references in the 'content' property.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="variable-reference-12-ref.html">
<style>
:root {
var-a: "hello";
var-b: "there";
}
#a:before {
content: var(a) " " var(b);
}
</style>
<p>The words "hello there" must appear below:</p>
<p id=a></p>

View File

@ -0,0 +1,18 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test that important variable declarations are not overwritten by subsequent non-important variable declarations in the one declaration block.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green !important;
var-a: crimson;
color: var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test that important variable declarations cascade correctly.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#defining-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
#a {
var-a: green !important;
}
p {
color: red;
var-a: crimson;
color: var(a);
}
</style>
<p id=a>This text must be green.</p>

View File

@ -0,0 +1,21 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property with two variable references with no intervening white space.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: green;
}
p {
color: crimson;
var-a: orange;
var-b: red;
color: var(a)var(b);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that consists of a variable reference with a number of levels of variable reference fallbacks.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: red;
}
p {
color: crimson;
color: var(a, var(b, var(c, green)));
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,20 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that consists of a variable reference whose fallback contains a CDO token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: red;
}
p {
color: crimson;
var-a: green;
color: var(a, <!--);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a variable reference and balanced braces and square brackets.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: green;
}
p {
color: red;
color: { [ var(a) ] };
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,19 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a variable reference and a non-top level ';' token.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
body {
color: green;
}
p {
color: red;
color: [;] var(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a variable reference whose function token is in uppercase.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
color: VAR(a);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a reference to a variable whose name must be escaped.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-0: green;
color: var(\30);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a reference to a variable whose name is U+FFFD but which was declared and referenced using a lone surrogate.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-\d800: green;
color: var(\d800);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a reference to a variable whose name is U+FFFD but which was declared using a lone surrogate.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-\d800: green;
color: var(\fffd);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,17 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a reference to a variable whose name is U+FFFD but which was declared using an out-of-range Unicode character escape.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-\ffffff: green;
color: var(\fffd);
}
</style>
<p>This text must be green.</p>

View File

@ -0,0 +1,15 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<title>CSS Test: Test declaring a non-custom property that contains a variable reference with no fallback and which is implicitly closed due to EOF.</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="http://dev.w3.org/csswg/css-variables/#using-variables">
<link rel="match" href="support/color-green-ref.html">
<style>
p {
color: red;
var-a: green;
color: var(a</style>
<p>This text must be green.</p>

Some files were not shown because too many files have changed in this diff Show More