Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

New tests for CSS2 corresponding to the changes introduced by CSS 2.2 #1139

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d78c641
Tests for two errata for CSS 2.1.
bert-github Apr 7, 2016
f2c1de4
Merge remote-tracking branch 'upstream/master'
bert-github Apr 13, 2016
3ca3e12
Signs (+ or -) may precede numbers, but wihout intervening space or c…
bert-github Apr 13, 2016
4a13010
Added test for computed height in presence of min-height and max-height
bert-github Oct 26, 2016
b7db41d
Testing that overflow applies to elements that establish a formatting…
bert-github Oct 26, 2016
2ce0160
Testing escapes in URI tokens
bert-github Oct 26, 2016
0bd20ab
testing control characters in identifiers
bert-github Oct 26, 2016
3e18256
Testing that BOM overrides a UTF charset
bert-github Oct 26, 2016
b3c4cf4
testing height inherited as a percentage
bert-github Oct 26, 2016
ccde56c
Testing scientific notation
bert-github Oct 26, 2016
f1c22da
Testing that an element creates an inline formatting context.
bert-github Oct 26, 2016
c90c4c4
Select container by ID
bert-github Oct 26, 2016
65d5964
Just changing file permission bits
bert-github Oct 26, 2016
76f0e94
testing that fixex positioning makes a stacking context.
bert-github Oct 26, 2016
ef03ae1
Testing parsing errors involving the incorrect start of a declaration.
bert-github Oct 26, 2016
356c677
Corrected metadata.
bert-github Oct 26, 2016
e7be31f
Merge https://github.com/w3c/csswg-test
bert-github Oct 26, 2016
9352871
Removed help/match/assert tags that should not be in Reference Files
bert-github Oct 27, 2016
e98d808
Fixes in response to Geoffrey Sneddon's review, see https://github.co…
bert-github Nov 7, 2016
d031e72
Fixes in response to Geoffrey Sneddon's review, see https://github.co…
bert-github Nov 7, 2016
54e287a
Merge https://github.com/w3c/csswg-test
bert-github Nov 7, 2016
8aff98c
Point to /TR/CSS22 instead of /TR/CSS2
bert-github Dec 5, 2016
8f4f309
Point to /TR/CSS22 instead of /TR/CSS2
bert-github Dec 5, 2016
0701f4b
Point to /TR/CSS22 instead of /TR/CSS2
bert-github Dec 5, 2016
4eb0ef9
Point to /TR/CSS22 instead of /TR/CSS2
bert-github Dec 5, 2016
112e7cb
Point to /TR/CSS22 instead of /TR/CSS2
bert-github Dec 5, 2016
a272e01
Point to /TR/CSS22 instead of /TR/CSS2
bert-github Dec 5, 2016
e1798ef
Removed link headers that should not be in reference files.
bert-github Dec 5, 2016
7a4c19c
Merge https://github.com/w3c/csswg-test
bert-github Dec 5, 2016
15fb17d
Added an extra rel=help link, to the Changes section of CSS 2.2
bert-github Dec 7, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions css21/cascade/inherit-computed-001-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference File</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org">

<style>
p {font-size: larger}
p, em {border: medium solid}
</style>

<p>This line is all <span>in one font</span> size
<em></em> and there is no red.
17 changes: 17 additions & 0 deletions css21/cascade/inherit-computed-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS cascading: Inherit the computed value</title>
<link rel="help" href="http://www.w3.org/TR/CSS22/cascade.html#value-def-inherit">
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.6.2.1">
<meta name="assert" content="Each property may also have a cascaded value of 'inherit', which means that, for a given element, the property takes as specified value the computed value of the element's parent.">
<link rel="match" href="inherit-computed-001-ref.html">
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org">

<style>
p {font-size: larger; border: medium solid}
span {font-size: inherit}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using something that isn't font-size would seem better here, given if the span rule isn't applied or the font-size: inherit ignored this test will still pass. Seems much better to use a property that isn't inherited by default (border or display, maybe?).

em {color: red; border: inherit}
</style>

<p>This line is all <span>in one font</span> size
<em></em> and there is no red.
11 changes: 11 additions & 0 deletions css21/cascade/inherit-computed-002-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference File</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org">

<style>
div {border-width: 1em; border-style: solid; padding: 0.5em}
p {font-size: 2em; border-width: 0.5em; border-style: solid}
</style>

<div><p>All borders are the same thickness.</div>
15 changes: 15 additions & 0 deletions css21/cascade/inherit-computed-002.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS cascading: Inherit the computed value</title>
<link rel="help" href="http://www.w3.org/TR/CSS22/cascade.html#value-def-inherit">
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.6.2.1">
<meta name="assert" content="Each property may also have a cascaded value of 'inherit', which means that, for a given element, the property takes as specified value the computed value of the element's parent.">
<link rel="match" href="inherit-computed-002-ref.html">
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org">

<style>
div {border-width: 1em; border-style: solid; padding: 0.5em}
p {font-size: 2em; border-width: inherit; border-style: solid}
</style>

<div><p>All borders are the same thickness.</div>
Empty file modified css21/fonts/font-044.xht
100755 → 100644
Empty file.
Empty file modified css21/fonts/font-045.xht
100755 → 100644
Empty file.
Empty file modified css21/fonts/font-family-008.xht
100755 → 100644
Empty file.
Empty file modified css21/fonts/font-size-113.xht
100755 → 100644
Empty file.
17 changes: 17 additions & 0 deletions css21/margin-padding-clear/margin-collapse-min-height-001-ref.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference File</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org" />
<style type="text/css">
body {min-width: 17em}
div.parent {height: 2em; margin: 5em 0 1em 0}
</style>
</head>
<body>
<div class="parent">
There's more space above this line than between this line and the horizontal rule
</div>
<hr />
</body>
</html>
27 changes: 27 additions & 0 deletions css21/margin-padding-clear/margin-collapse-min-height-001.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS margin: Margin collapsing and elements with min-height</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org" />
<link rel="help" href="http://www.w3.org/TR/CSS22/box.html#collapsing-margins" />
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.8.3.1c" />
<link rel="match" href="margin-collapse-min-height-001-ref.xht" />
<meta name="assert" content="If the top margin of a box with non-zero computed 'min-height' and 'auto' computed 'height' collapses with the bottom margin of its last in-flow child, then the child's bottom margin does not collapse with the parent's bottom margin." />
<style type="text/css">
body {min-width: 17em}
div.parent {min-height: 2em; height: auto; margin: 1em 0}
div.last-child {margin-bottom: 5em}
div.float {float: left}
</style>
</head>
<body>
<div class="parent">
<div></div>
<div></div>
<div class="last-child">
<div class="float">There's more space above this line than between this line and the horizontal rule</div>
</div>
</div>
<hr />
</body>
</html>
22 changes: 22 additions & 0 deletions css21/margin-padding-clear/margin-collapse-min-height-002-ref.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS margin: Margin collapsing and elements with min-height</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org" />
<style type="text/css">
#container {width: 50px; border-top: 1px solid transparent;
background: green}
#parent {height: 50px; background-color: white; margin-top: 50px}
#following-sibling {height: 50px; background-color: green}
</style>
</head>
<body>
<p>There should be two solid green squares and no red on this page</p>

<div id="container" >
<div id="parent">
</div>
<div id="following-sibling"></div>
</div>
</body>
</html>
29 changes: 29 additions & 0 deletions css21/margin-padding-clear/margin-collapse-min-height-002.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS margin: Margin collapsing and elements with min-height</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org" />
<link rel="help" href="http://www.w3.org/TR/CSS22/box.html#collapsing-margins" />
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.8.3.1c" />
<link rel="match" href="margin-collapse-min-height-002-ref.xht" />
<meta name="assert" content="If the top margin of a box with non-zero computed 'min-height' and 'auto' computed 'height' collapses with the bottom margin of its last in-flow child, then the child's bottom margin does not collapse with the parent's bottom margin." />
<style type="text/css">
#container {width: 50px; height: 50px; border-top: 1px solid transparent;
border-bottom: 100px solid red; background: green}
#parent {height: auto; min-height: 50px; background-color: white}
#child {margin-bottom: 50px}
#following-sibling {height: 50px; background-color: green}
</style>
</head>
<body>
<!-- Credit for this test goes to Anton Prowse, see
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16036#c4 -->
<p>There should be two solid green squares and no red on this page</p>
<div id="container" >
<div id="parent">
<div id="child"></div>
</div>
<div id="following-sibling"></div>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions css21/syntax/character-encoding-041-ref.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>CSS Test: Stylesheet encodings UTF with a BOM override</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org"/>
<style type="text/css">
p { color: white; background: green; }
</style>
</head>
<body>
<p class="test">This line should be green.</p>
</body>
</html>
20 changes: 20 additions & 0 deletions css21/syntax/character-encoding-041.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>CSS Test: Stylesheet encodings UTF with a BOM override</title>
<link rel="help" href="http://www.w3.org/TR/CSS22/syndata.html#charset" />
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.4.4" />
<link rel="match" href="character-encoding-041-ref.xht" />
<meta content="http" name="flags" />
<meta name="assert" content='If rule 1 above (an HTTP "charset" parameter or similar) yields a character encoding and it is one of UTF-8, UTF-16 or UTF-32, then a BOM, if any, at the start of the file overrides that character encoding, as follows: [...]'/>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org"/>
<style type="text/css">
p { color: white; background: red; }
</style>
<link rel="stylesheet" href="support/character-encoding-041.css"/>
</head>
<body>
<p class="t&#xE9;st">This line should be green.</p>
</body>
</html>
26 changes: 26 additions & 0 deletions css21/syntax/characters-0080-009F-001-ref.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Valid control characters in identifiers</title>

<link rel="author" title="Bert Bos" href="mailto:bert@w3.org/" />

<style type="text/css">
div p::before {content: counter(item, lower-latin) ". "}
div p {counter-increment: item}
</style>
</head>

<body>
<p>The next items should be numbered a to f.</p>
<div>
<p>Item</p>
<p>Item</p>
<p>Item</p>
<p>Item</p>
<p>Item</p>
<p>Item</p>
</div>
</body>
</html>
32 changes: 32 additions & 0 deletions css21/syntax/characters-0080-009F-001.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Valid control characters in identifiers</title>

<link rel="help" href="http://www.w3.org/TR/CSS22/syndata.html#characters" />
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.4.1.3d" />
<link rel="match" href="characters-0080-009F-001-ref.xht" />
<meta name="assert" content="identifiers [...] can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+0080 and higher, [...]" />
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org/" />

<style type="text/css">
/* Warning: the next lines contain control characters \201..\237 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this is XHTML and not HTML, can we not just use character references for them?

div p::before {content: counter(item) ". "}
div p::before {content: counter(‚ƒžŸ, lower-latin) ". "}
div p {counter-increment: ‚ƒžŸ}
</style>
</head>

<body>
<p>The next items should be numbered a to f.</p>
<div>
<p>Item</p>
<p>Item</p>
<p>Item</p>
<p>Item</p>
<p>Item</p>
<p>Item</p>
</div>
</body>
</html>
23 changes: 23 additions & 0 deletions css21/syntax/escaped-url-001-ref.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Escapes in a URI token</title>

<link rel="author" title="Bert Bos" href="mailto:bert@w3.org/" />

<style type="text/css">
div {width: 5em; height: 1em; background: url(support/1x1-green.png)}
</style>
</head>

<body>
<p>There should be no red.</p>
<div id="div0"></div>
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
<div id="div4"></div>
<div id="div5"></div>
</body>
</html>
34 changes: 34 additions & 0 deletions css21/syntax/escaped-url-001.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Escapes in a URI token</title>

<link rel="help" href="http://www.w3.org/TR/CSS22/syndata.html#tokenization" />
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.4.1.1a" />
<link rel="match" href="escaped-url-001-ref.xht" />
<meta name="assert" content="URI {U}{R}{L}\({w}{string}{w}\)|
{U}{R}{L}\({w}([!#$%&amp;*-\[\]-~]|{nonascii}|{escape})*{w}\)" />
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org/" />

<style type="text/css">
div {background: red; width: 5em; height: 1em}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri-015 tests much of this already, though not with the variation in case.

#div0 {background: url(support/1x1-green.png)}
#div1 {background: \url(support/1x1-green.png)}
#div2 {background: U\Rl(support/1x1-green.png)}
#div3 {background: U\R\l(support/1x1-green.png)}
#div4 {background: \55Rl(support/1x1-green.png)}
#div5 {background: \000075 rl(support/1x1-green.png)}
</style>
</head>

<body>
<p>There should be no red.</p>
<div id="div0"></div>
<div id="div1"></div>
<div id="div2"></div>
<div id="div3"></div>
<div id="div4"></div>
<div id="div5"></div>
</body>
</html>
22 changes: 22 additions & 0 deletions css21/syntax/malformed-decl-block-001-ref.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference File</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org" />

<style type="text/css">
body {background: white; color: green}
</style>
</head>

<body>
<p id="p1">This text must be green.</p>
<p id="p2">This text must be green.</p>
<p id="p3">This text must be green.</p>
<p id="p4">This text must be green.</p>
<p id="p5">This text must be green.</p>
<p id="p6">This text must be green.</p>
<p id="p7">This text must be green.</p>
</body>
</html>
34 changes: 34 additions & 0 deletions css21/syntax/malformed-decl-block-001.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Parsing malformed declaration blocks</title>
<link rel="help" href="http://www.w3.org/TR/CSS22/syndata.html#parsing-errors" />
<link rel="help" href="http://www.w3.org/TR/CSS22/changes.html#s.4.1.1e" />
<link rel="match" href="malformed-decl-block-001-ref.xht"/>
<meta name="flags" content="invalid" />
<meta name="assert" content="When the UA expects the start of a declaration or at-rule (i.e., an IDENT token or an ATKEYWORD token) but finds an unexpected token instead, that token is considered to be the first token of a malformed declaration. I.e., the rule for malformed declarations, rather than malformed statements is used to determine which tokens to ignore in that case." />
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org" />

<style type="text/css">
body {background: white; color: red}
#p1 {color: green}
#p2 {@charset utf-8; color: green}
#p3 {@foo {color: red} color: green}
#p4 {12; color: green}
#p5 {color: green; 12 color: red}
#p6 {color: green; 12 @page {color: red} color: red}
#p7 {@foo {color: red}; color: green}
</style>
</head>

<body>
<p id="p1">This text must be green.</p>
<p id="p2">This text must be green.</p>
<p id="p3">This text must be green.</p>
<p id="p4">This text must be green.</p>
<p id="p5">This text must be green.</p>
<p id="p6">This text must be green.</p>
<p id="p7">This text must be green.</p>
</body>
</html>
23 changes: 23 additions & 0 deletions css21/syntax/scientific-notation-001-ref.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reference File</title>
<link rel="author" title="Bert Bos" href="mailto:bert@w3.org" />

<style type="text/css">
#container {height: 2em; background: red}
#child1 {height: 1em; background: green}
#child2 {height: 1em; background: green}
</style>
</head>

<body>
<p>There should be no red.</p>

<div id="container">
<div id="child1"></div>
<div id="child2"></div>
</div>
</body>
</html>
Loading