Fix naming of diff png files when multiple reftest lists in use. Import a few css21 reftests.

This commit is contained in:
Glenn Watson 2014-08-21 09:20:22 +10:00
parent 2ce5b46bba
commit 39611bd2bb
23 changed files with 631 additions and 6 deletions

View file

@ -54,7 +54,7 @@ fn main() {
Some(extension) => {
if extension.to_ascii_lower().as_slice() == "list" && file.is_file() {
let manifest = file.as_str().unwrap();
let tests = parse_lists(manifest, servo_args, render_mode);
let tests = parse_lists(manifest, servo_args, render_mode, all_tests.len());
println!("\t{} [{} tests]", manifest, tests.len());
all_tests.push_all_move(tests);
}
@ -107,9 +107,8 @@ struct TestLine<'a> {
file_right: &'a str,
}
fn parse_lists(file: &str, servo_args: &[String], render_mode: RenderMode) -> Vec<TestDescAndFn> {
fn parse_lists(file: &str, servo_args: &[String], render_mode: RenderMode, id_offset: uint) -> Vec<TestDescAndFn> {
let mut tests = Vec::new();
let mut next_id = 0;
let file_path = Path::new(file);
let contents = File::open_mode(&file_path, io::Open, io::Read)
.and_then(|mut f| f.read_to_string())
@ -163,14 +162,12 @@ fn parse_lists(file: &str, servo_args: &[String], render_mode: RenderMode) -> Ve
name: test_line.file_left.to_string().append(" / ").append(test_line.file_right),
kind: kind,
files: [file_left, file_right],
id: next_id,
id: id_offset + tests.len(),
render_mode: render_mode,
servo_args: servo_args.iter().map(|x| x.clone()).collect(),
flakiness: flakiness,
};
next_id += 1;
tests.push(make_test(reftest));
}
tests

View file

@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
div
{
background-color: black;
height: 50px;
width: 100px;
}
</style>
</head>
<body>
<p>Test passes if there is a black rectangle which is wider than it is tall.</p>
<div></div>
</body>
</html>

View file

@ -0,0 +1,48 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Block formatting context auto height with floated descendants outside the normal flow and bottom margins</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#root-height">
<link rel="match" href="reference/block-formatting-context-height-003-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="The auto height of a block formatting context element does not account for bottom margins of floated content descendents of out of flow blocks.">
<style type="text/css">
#container
{
width: 100px;
height: auto;
background: black;
position: absolute;
}
#sibling
{
height: 50px;
width: 100px;
}
#absolute
{
position: absolute;
width: 100px;
height: 50px;
}
#float
{
margin-bottom: 50px;
height: 50px;
width: 100%;
}
</style>
</head>
<body>
<p>Test passes if there is a black rectangle which is wider than it is tall.</p>
<div id="container">
<div id="sibling"></div>
<div id="absolute">
<div id="float"></div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
table
{
border: black solid 1px;
border-spacing: 0px;
width: 100%;
}
td {padding: 0px;}
</style>
</head>
<body>
<p>Test passes if there are 3 lines of "Filler Text".</p>
<table>
<tr><td>Filler Text</td></tr>
<tr><td>Filler Text</td></tr>
<tr><td>Filler Text</td></tr>
</table>
</body>
</html>

View file

@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Vertical layout of boxes</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-001-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="Boxes are vertically laid out one after the other beginning at the top of a containing block.">
<style type="text/css">
#div1
{
border: solid 1px black;
}
</style>
</head>
<body>
<p>Test passes if there are 3 lines of "Filler Text".</p>
<div id="div1">
<div>Filler Text</div>
<div>Filler Text</div>
<div>Filler Text</div>
</div>
</body>
</html>

View file

@ -0,0 +1,59 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
table
{
border-collapse: collapse;
width: 100%;
}
tbody
{
border-bottom: black solid 1px;
border-top: black solid 1px;
}
thead {border-bottom: black solid 1px;}
/*
Necessary otherwise ( 0 + 1 ) divided by 2 may give unpredictable
measurements affecting vertical alignment
*/
tfoot {border-top: black solid 1px;}
/*
Necessary otherwise ( 0 + 1 ) divided by 2 may give unpredictable
measurements affecting vertical alignment
*/
/*
"
User agents must find a consistent rule for rounding off in the
case of an odd number of discrete units (screen pixels, printer dots).
"
http://www.w3.org/TR/CSS21/tables.html#collapsing-borders
*/
td {padding: 0px;}
</style>
</head>
<body>
<p>Test passes if there are 3 lines of "Filler Text" separated by 2 thin black lines.</p>
<table>
<thead> <tr><td>Filler Text</td></tr> </thead>
<tfoot> <tr><td>Filler Text</td></tr> </tfoot>
<tbody> <tr><td>Filler Text</td></tr> </tbody>
</table>
</body>
</html>

View file

@ -0,0 +1,32 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Vertical distance with margins</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-003-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="The vertical distance between two sibling boxes is determined by the margin property.">
<style type="text/css">
#div1
{
background: black;
}
div div
{
background: white;
margin-top: 1px;
}
</style>
</head>
<body>
<p>Test passes if there are 3 lines of "Filler Text" separated by 2 thin black lines.</p>
<div id="div1">
<div>Filler Text</div>
<div>Filler Text</div>
<div>Filler Text</div>
</div>
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- same as /margin-padding-clear/margin-collapse-002-ref.xht -->
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
div
{
border-bottom: black solid 20px;
border-top: black solid 20px;
height: 40px;
width: 100px;
}
</style>
</head>
<body>
<p>Test passes if there is <strong>no red</strong>.</p>
<div></div>
</body>
</html>

View file

@ -0,0 +1,37 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Block Formatting Contexts: Margin Collapsing</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-004-ref.htm">
<meta name="flags" content="ahem image">
<meta name="assert" content="Margins collapse between adjacent block boxes in a block formatting context.">
<style type="text/css">
#div1
{
background: url("support/margin-collapse-2em-space.png");
font: 20px/1em Ahem;
height: 4em;
width: 5em;
}
#div2
{
margin-bottom: 1em;
}
#div3
{
margin-top: 2em;
}
</style>
</head>
<body>
<p>Test passes if there is <strong>no red</strong>.</p>
<div id="div1">
<div id="div2">XXXXX</div>
<div id="div3">XXXXX</div>
</div>
</body>
</html>

View file

@ -0,0 +1,31 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<!-- same as margin-padding-clear/margin-left-004-ref.xht -->
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
div
{
background-color: blue;
border-right: orange solid 5px;
height: 96px;
width: 5px;
}
</style>
</head>
<body>
<p>Test passes if there is <strong>no space between</strong> the blue and orange lines.</p>
<div></div>
</body>
</html>

View file

@ -0,0 +1,33 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: No padding or margin, left edges touch</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-005-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="When there is no padding or margins on elements the left outer edge of the child box will touch the left edge of the containing block.">
<style type="text/css">
div
{
height: 1in;
}
#div1
{
border-left: solid 5px blue;
}
div div
{
border-left: solid 5px orange;
}
</style>
</head>
<body>
<p>Test passes if there is <strong>no space between</strong> the blue and orange lines.</p>
<div id="div1">
<div></div>
</div>
</body>
</html>

View file

@ -0,0 +1,30 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
div
{
background-color: orange;
border-right: blue solid 5px;
height: 96px;
margin-left: 91px;
width: 5px;
}
</style>
</head>
<body>
<p>Test passes if there is <strong>no space between</strong> the blue and orange lines.</p>
<div></div>
</body>
</html>

View file

@ -0,0 +1,34 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: No padding and margin, right edges touch</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-006-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="When there is no padding or margins on elements the right outer edge of the child box will touch the right edge of the containing block.">
<style type="text/css">
div
{
height: 1in;
}
#div1
{
border-right: solid 5px blue;
width: 1in;
}
div div
{
border-right: solid 5px orange;
}
</style>
</head>
<body>
<p>Test passes if there is <strong>no space between</strong> the blue and orange lines.</p>
<div id="div1">
<div></div>
</div>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
div
{
border: black solid medium;
height: 200px;
width: 200px;
}
</style>
</head>
<body>
<p>Test passes if the upper-half of the square is blue.</p>
<div><img src="support/blue15x15.png" width="200" height="100" alt="Image download support must be enabled"></div>
</body>
</html>

View file

@ -0,0 +1,35 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: New block formatting context with floated elements</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-008-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="Floated elements establish new block formatting context.">
<style type="text/css">
#div1
{
border: solid;
height: 200px;
width: 200px;
}
div div
{
background: blue;
display: inline;
float: right;
height: 50%;
width: 100%;
}
</style>
</head>
<body>
<p>Test passes if the upper-half of the square is blue.</p>
<div id="div1">
<div></div>
</div>
</body>
</html>

View file

@ -0,0 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
<style type="text/css">
div
{
background-color: blue;
float: left;
width: 100px;
}
div + div
{
background-color: transparent;
clear: left;
}
</style>
</head>
<body>
<p>Test passes if the "Filler Text" is below the blue stripe.</p>
<div>&nbsp;</div>
<div>Filler Text</div>
</body>
</html>

View file

@ -0,0 +1,28 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Table-cell elements establish a new block formatting context</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-011-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="Elements defined as table-cell elements establish a new block formatting context.">
<style type="text/css">
#span1
{
background-color: blue;
display: table-cell;
width: 100px;
}
</style>
</head>
<body>
<p>Test passes if the "Filler Text" is below the blue stripe.</p>
<div>
<span id="span1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
<span>Filler Text</span>
</div>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
</head>
<body>
<p>Test passes if the blue and orange squares have the same size.</p>
<div><img src="support/blue15x15.png" width="50" height="50" alt="Image download support must be enabled"><img src="support/swatch-orange.png" width="50" height="50" alt="Image download support must be enabled"></div>
</body>
</html>

View file

@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>CSS Test: Overflow set to 'hidden' establishes a new block formatting context</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/">
<link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2012-09-26 -->
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#block-formatting">
<link rel="match" href="reference/block-formatting-contexts-015-ref.htm">
<meta name="flags" content="">
<meta name="assert" content="A new block formatting context is established when overflow is set to 'hidden'.">
<style type="text/css">
#div1
{
height: 200px;
width: 200px;
}
div div
{
height: 50px;
width: 50px;
}
#div2
{
background: blue;
float: left;
}
#div3
{
overflow: hidden;
}
div div div
{
background: orange;
height: 1in;
width: 1in;
}
</style>
</head>
<body>
<p>Test passes if the blue and orange squares have the same size.</p>
<div id="div1">
<div id="div2"></div>
<div id="div3">
<div></div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,9 @@
# == block-formatting-context-height-003.htm block-formatting-context-height-003-ref.htm
# == block-formatting-contexts-001.htm block-formatting-contexts-001-ref.htm
# == block-formatting-contexts-003.htm block-formatting-contexts-003-ref.htm
# == block-formatting-contexts-004.htm block-formatting-contexts-004-ref.htm
== block-formatting-contexts-005.htm block-formatting-contexts-005-ref.htm
== block-formatting-contexts-006.htm block-formatting-contexts-006-ref.htm
# == block-formatting-contexts-008.htm block-formatting-contexts-008-ref.htm
# == block-formatting-contexts-011.htm block-formatting-contexts-011-ref.htm
# == block-formatting-contexts-015.htm block-formatting-contexts-015-ref.htm

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 B