mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update CSS tests to revision d674587d6ae7d2e231d632785559f2613d554eb0
This commit is contained in:
parent
7c45ff8e05
commit
f235d49372
6623 changed files with 267392 additions and 10061 deletions
|
@ -13,7 +13,7 @@
|
|||
<body>
|
||||
|
||||
<h1>CSS Object Model Level 1 CR Test Suite</h1>
|
||||
<h2>Selectors (0 tests)</h2>
|
||||
<h2>Selectors (1 tests)</h2>
|
||||
<table width="100%">
|
||||
<col id="test-column">
|
||||
<col id="refs-column">
|
||||
|
@ -46,7 +46,15 @@
|
|||
<tr><th colspan="4" scope="rowgroup">
|
||||
<a href="#s5.2">+</a>
|
||||
<a href="http://www.w3.org/TR/cssom/#serializing-selectors">5.2 Serializing Selectors</a></th></tr>
|
||||
<!-- 0 tests -->
|
||||
<!-- 1 tests -->
|
||||
<tr id="selectorserialize-5.2" class="primary dom script">
|
||||
<td><strong>
|
||||
<a href="selectorSerialize.htm">selectorserialize</a></strong></td>
|
||||
<td></td>
|
||||
<td><abbr class="dom" title="Requires Document Object Model support">DOM/JS</abbr><abbr class="script" title="Executes tests in script">Script</abbr></td>
|
||||
<td>test serialized selector which is only one simple selector in the sequence of simple selectors
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="s5.2.#serialize-a-group-of-selectors">
|
||||
<!-- 0 tests -->
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<body>
|
||||
|
||||
<h1>CSS Object Model Level 1 CR Test Suite</h1>
|
||||
<h2>CSS (17 tests)</h2>
|
||||
<h2>CSS (18 tests)</h2>
|
||||
<table width="100%">
|
||||
<col id="test-column">
|
||||
<col id="refs-column">
|
||||
|
@ -739,7 +739,18 @@
|
|||
<!-- 0 tests -->
|
||||
</tbody>
|
||||
<tbody id="s6.6.1.#dom-cssstyledeclaration-csstext">
|
||||
<!-- 0 tests -->
|
||||
<!-- 1 tests -->
|
||||
<tr id="cssstyledeclaration-csstext-6.6.1.#dom-cssstyledeclaration-csstext" class="primary dom script">
|
||||
<td><strong>
|
||||
<a href="cssstyledeclaration-csstext.htm">cssstyledeclaration-csstext</a></strong></td>
|
||||
<td></td>
|
||||
<td><abbr class="dom" title="Requires Document Object Model support">DOM/JS</abbr><abbr class="script" title="Executes tests in script">Script</abbr></td>
|
||||
<td>CSSStyleDeclaration.cssText Test
|
||||
<ul class="assert">
|
||||
<li>CSS declarations is serialized as expected</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="s6.6.1.#dom-cssstyledeclaration-getpropertypriority">
|
||||
<!-- 0 tests -->
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<body>
|
||||
|
||||
<h1>CSS Object Model Level 1 CR Test Suite</h1>
|
||||
<h2>Utility APIs (0 tests)</h2>
|
||||
<h2>Utility APIs (1 tests)</h2>
|
||||
<table width="100%">
|
||||
<col id="test-column">
|
||||
<col id="refs-column">
|
||||
|
@ -37,7 +37,15 @@
|
|||
<tr><th colspan="4" scope="rowgroup">
|
||||
<a href="#s8.1">+</a>
|
||||
<a href="http://www.w3.org/TR/cssom/#the-css.escape()-method">8.1 The CSS.escape() Method</a></th></tr>
|
||||
<!-- 0 tests -->
|
||||
<!-- 1 tests -->
|
||||
<tr id="escape-8.1" class="primary script">
|
||||
<td><strong>
|
||||
<a href="escape.htm">escape</a></strong></td>
|
||||
<td></td>
|
||||
<td><abbr class="script" title="Executes tests in script">Script</abbr></td>
|
||||
<td>CSS#escape
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody id="s8.1.#dom-css-escape">
|
||||
<!-- 0 tests -->
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
<title>CSSOM Test: CSSStyleDeclaration.cssText Test</title>
|
||||
<link href="coarse.ground@gmail.com" rel="author" title="kkoichi">
|
||||
<link href="simonp@opera.com" rel="reviewer" title="Simon Pieters"><!-- 06-27-2013 -->
|
||||
<link href="https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-csstext" rel="help">
|
||||
<meta content="CSS declarations is serialized as expected" name="assert">
|
||||
<meta content="dom" name="flags">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function newElm() {
|
||||
return document.body.appendChild(document.createElement('div'));
|
||||
}
|
||||
|
||||
test(function(){
|
||||
var style = newElm().style;
|
||||
style.COLOR = 'red';
|
||||
|
||||
assert_equals(style.cssText, '');
|
||||
|
||||
}, 'uppercase property');
|
||||
|
||||
test(function(){
|
||||
var style = newElm().style;
|
||||
style.color = 'RED';
|
||||
|
||||
assert_equals(style.cssText, 'color: red;');
|
||||
|
||||
}, 'uppercase value');
|
||||
|
||||
test(function(){
|
||||
var style = newElm().style;
|
||||
|
||||
style.color = 'red';
|
||||
|
||||
style.color = 'unknown color';
|
||||
|
||||
assert_equals(style.cssText, 'color: red;');
|
||||
|
||||
}, 'overwriting with invalid value');
|
||||
|
||||
test(function(){
|
||||
var style = newElm().style;
|
||||
style.color = 'rgb(255, 0, 0)';
|
||||
|
||||
assert_equals(style.cssText, 'color: rgb(255, 0, 0);');
|
||||
|
||||
}, 'use rgb');
|
||||
|
||||
test(function(){
|
||||
var e = newElm();
|
||||
var style = e.style;
|
||||
|
||||
style.color = 'red';
|
||||
style.fontSize = '10pt';
|
||||
style.fontWeight = 'bold';
|
||||
|
||||
assert_equals(style.cssText, 'color: red; font-size: 10pt; font-weight: bold;');
|
||||
|
||||
}, 'cssText order');
|
||||
|
||||
test(function(){
|
||||
var e = newElm();
|
||||
var style = e.style;
|
||||
|
||||
style.fontWeight = 'bold';
|
||||
style.color = 'red';
|
||||
style.fontSize = '10pt';
|
||||
|
||||
assert_equals(style.cssText, 'font-weight: bold; color: red; font-size: 10pt;');
|
||||
|
||||
}, 'another cssText order (non-alphabetical order)');
|
||||
|
||||
test(function(){
|
||||
var style = newElm().style;
|
||||
|
||||
style.color = ' red';
|
||||
style.fontSize = '10pt ';
|
||||
|
||||
assert_equals(style.cssText, 'color: red; font-size: 10pt;');
|
||||
|
||||
}, 'whitespaces in value');
|
||||
|
||||
test(function(){
|
||||
var style = newElm().style;
|
||||
|
||||
style.color = 'red';
|
||||
style.unknown = 'unknown';
|
||||
style.fontSize = '10pt';
|
||||
assert_equals(style.cssText, 'color: red; font-size: 10pt;');
|
||||
|
||||
}, 'invalid property does not appear');
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body></html>
|
92
tests/wpt/css-tests/cssom-1_dev/html/escape.htm
Normal file
92
tests/wpt/css-tests/cssom-1_dev/html/escape.htm
Normal file
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html>
|
||||
<html><head><meta charset="utf-8">
|
||||
<title>CSS#escape</title>
|
||||
<link href="https://drafts.csswg.org/cssom-1/#the-css.escape()-method" rel="help">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head><body><div id="log"></div>
|
||||
<script>
|
||||
test(function() {
|
||||
assert_equals(CSS.escape.length, 1);
|
||||
assert_throws(new TypeError(), function() { CSS.escape(); });
|
||||
}, "Number of arguments");
|
||||
|
||||
test(function() {
|
||||
assert_equals(CSS.escape(true), 'true');
|
||||
assert_equals(CSS.escape(false), 'false');
|
||||
assert_equals(CSS.escape(null), 'null');
|
||||
assert_equals(CSS.escape(''), '');
|
||||
}, "String conversion");
|
||||
|
||||
test(function() {
|
||||
assert_throws('InvalidCharacterError', function() { CSS.escape('\0'); });
|
||||
assert_throws('InvalidCharacterError', function() { CSS.escape('a\0'); });
|
||||
assert_throws('InvalidCharacterError', function() { CSS.escape('\0b'); });
|
||||
assert_throws('InvalidCharacterError', function() { CSS.escape('a\0b'); });
|
||||
}, "Null bytes");
|
||||
|
||||
test(function() {
|
||||
assert_equals(CSS.escape('0a'), '\\30 a');
|
||||
assert_equals(CSS.escape('1a'), '\\31 a');
|
||||
assert_equals(CSS.escape('2a'), '\\32 a');
|
||||
assert_equals(CSS.escape('3a'), '\\33 a');
|
||||
assert_equals(CSS.escape('4a'), '\\34 a');
|
||||
assert_equals(CSS.escape('5a'), '\\35 a');
|
||||
assert_equals(CSS.escape('6a'), '\\36 a');
|
||||
assert_equals(CSS.escape('7a'), '\\37 a');
|
||||
assert_equals(CSS.escape('8a'), '\\38 a');
|
||||
assert_equals(CSS.escape('9a'), '\\39 a');
|
||||
}, "Number prefix");
|
||||
|
||||
test(function() {
|
||||
assert_equals(CSS.escape('a0b'), 'a0b');
|
||||
assert_equals(CSS.escape('a1b'), 'a1b');
|
||||
assert_equals(CSS.escape('a2b'), 'a2b');
|
||||
assert_equals(CSS.escape('a3b'), 'a3b');
|
||||
assert_equals(CSS.escape('a4b'), 'a4b');
|
||||
assert_equals(CSS.escape('a5b'), 'a5b');
|
||||
assert_equals(CSS.escape('a6b'), 'a6b');
|
||||
assert_equals(CSS.escape('a7b'), 'a7b');
|
||||
assert_equals(CSS.escape('a8b'), 'a8b');
|
||||
assert_equals(CSS.escape('a9b'), 'a9b');
|
||||
}, "Letter number prefix");
|
||||
|
||||
test(function() {
|
||||
assert_equals(CSS.escape('-0a'), '-\\30 a');
|
||||
assert_equals(CSS.escape('-1a'), '-\\31 a');
|
||||
assert_equals(CSS.escape('-2a'), '-\\32 a');
|
||||
assert_equals(CSS.escape('-3a'), '-\\33 a');
|
||||
assert_equals(CSS.escape('-4a'), '-\\34 a');
|
||||
assert_equals(CSS.escape('-5a'), '-\\35 a');
|
||||
assert_equals(CSS.escape('-6a'), '-\\36 a');
|
||||
assert_equals(CSS.escape('-7a'), '-\\37 a');
|
||||
assert_equals(CSS.escape('-8a'), '-\\38 a');
|
||||
assert_equals(CSS.escape('-9a'), '-\\39 a');
|
||||
}, "Dash number prefix");
|
||||
|
||||
test(function() {
|
||||
assert_equals(CSS.escape('--a'), '--a');
|
||||
}, "Double dash prefix");
|
||||
|
||||
test(function() {
|
||||
assert_equals(CSS.escape('\x01\x02\x1E\x1F'), '\\1 \\2 \\1e \\1f ');
|
||||
|
||||
assert_equals(CSS.escape('\x80\x2D\x5F\xA9'), '\x80\x2D\x5F\xA9');
|
||||
assert_equals(CSS.escape('\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F'), '\\7f \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F');
|
||||
assert_equals(CSS.escape('\xA0\xA1\xA2'), '\xA0\xA1\xA2');
|
||||
assert_equals(CSS.escape('a0123456789b'), 'a0123456789b');
|
||||
assert_equals(CSS.escape('abcdefghijklmnopqrstuvwxyz'), 'abcdefghijklmnopqrstuvwxyz');
|
||||
assert_equals(CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
||||
|
||||
assert_equals(CSS.escape('\x20\x21\x78\x79'), '\\ \\!xy');
|
||||
}, "Various tests");
|
||||
|
||||
test(function() {
|
||||
// astral symbol (U+1D306 TETRAGRAM FOR CENTRE)
|
||||
assert_equals(CSS.escape('\uD834\uDF06'), '\uD834\uDF06');
|
||||
// lone surrogates
|
||||
assert_equals(CSS.escape('\uDF06'), '\uDF06');
|
||||
assert_equals(CSS.escape('\uD834'), '\uD834');
|
||||
}, "Surrogates");
|
||||
</script>
|
||||
</body></html>
|
107
tests/wpt/css-tests/cssom-1_dev/html/selectorSerialize.htm
Normal file
107
tests/wpt/css-tests/cssom-1_dev/html/selectorSerialize.htm
Normal file
|
@ -0,0 +1,107 @@
|
|||
<!DOCTYPE html>
|
||||
<html><head>
|
||||
<title>CSSOM Test: test serialized selector which is only one simple selector in the sequence of simple selectors</title>
|
||||
<link href="mailto:lequinharay@gmail.com" rel="author" title="T.Nishitani">
|
||||
<link href="http://dbaron.org/" rel="reviewer" title="L. David Baron">
|
||||
<link href="https://drafts.csswg.org/cssom-1/#serializing-selectors" rel="help">
|
||||
<meta content="dom" name="flags">
|
||||
<meta charset="utf-8">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<style id="teststyles">
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
function assert_selector_serializes_to(source, expected_result) {
|
||||
var style_element = document.getElementById("teststyles");
|
||||
style_element.firstChild.data = source + "{ font-size: 1em; }";
|
||||
var sheet = style_element.sheet;
|
||||
assert_equals(sheet.cssRules[0].selectorText, expected_result);
|
||||
}
|
||||
|
||||
function run_tests_on_anplusb_selector(source) {
|
||||
assert_selector_serializes_to(source + '( even )', source + '(2n)');
|
||||
assert_selector_serializes_to(source + '( odd )', source + '(2n+1)');
|
||||
assert_selector_serializes_to(source + '( +10 )', source + '(10)');
|
||||
assert_selector_serializes_to(source + '( -10 )', source + '(-10)');
|
||||
assert_selector_serializes_to(source + '( +4n )', source + '(4n)');
|
||||
assert_selector_serializes_to(source + '( -3n )', source + '(-3n)');
|
||||
assert_selector_serializes_to(source + '( 1n + 5 )', source + '(n+5)');
|
||||
assert_selector_serializes_to(source + '( -1n + 5 )', source + '(-n+5)');
|
||||
assert_selector_serializes_to(source + '( -1n - 5 )', source + '(-n-5)');
|
||||
}
|
||||
|
||||
test(function() {
|
||||
assert_selector_serializes_to(":nth-child( 3n - 0)", ":nth-child(3n)");
|
||||
assert_selector_serializes_to(":nth-child( 1n - 0)", ":nth-child(n)");
|
||||
}, ":nth-child serialization produces canonical form");
|
||||
|
||||
|
||||
/* for universal selecter with default namespace */
|
||||
test(function(){
|
||||
/* this is single universal selector */
|
||||
assert_selector_serializes_to('*', '*');
|
||||
assert_selector_serializes_to(' * ', '*');
|
||||
}, 'single universal selector shows \'*\' when serialized.')
|
||||
|
||||
test(function(){
|
||||
assert_selector_serializes_to('div', 'div');
|
||||
assert_selector_serializes_to(' div ', 'div');
|
||||
}, 'single type (simple) selector in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
assert_selector_serializes_to('.class', '.class');
|
||||
assert_selector_serializes_to(' .class ', '.class');
|
||||
}, 'single class (simple) selector in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
assert_selector_serializes_to('#id', '#id');
|
||||
assert_selector_serializes_to(' #id ', '#id');
|
||||
}, 'single id (simple) selector in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
assert_selector_serializes_to(':hover', ':hover');
|
||||
assert_selector_serializes_to(' :hover ', ':hover');
|
||||
}, 'single pseudo (simple) selector which does not accept arguments in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
assert_selector_serializes_to(':lang(ja)', ':lang(ja)');
|
||||
assert_selector_serializes_to(':lang( ja )', ':lang(ja)');
|
||||
}, 'single pseudo (simple) selector "lang" which accepts arguments in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
|
||||
|
||||
|
||||
test(function(){
|
||||
run_tests_on_anplusb_selector(':nth-child');
|
||||
}, 'single pseudo (simple) selector "nth-child" which accepts arguments in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
run_tests_on_anplusb_selector(':nth-last-child');
|
||||
}, 'single pseudo (simple) selector "nth-last-child" which accepts arguments in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
run_tests_on_anplusb_selector(':nth-of-type');
|
||||
}, 'single pseudo (simple) selector "nth-of-child" which accepts arguments in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
run_tests_on_anplusb_selector(':nth-last-of-type');
|
||||
}, 'single pseudo (simple) selector ":nth-last-of-type" which accepts arguments in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
test(function(){
|
||||
assert_selector_serializes_to(' :not( abc ) ', ':not(abc)');
|
||||
assert_selector_serializes_to(' :not( .head ) ', ':not(.head)');
|
||||
assert_selector_serializes_to(' :not( #head ) ', ':not(#head)');
|
||||
assert_selector_serializes_to(' :not( :hover ) ', ':not(:hover)');
|
||||
}, 'single pseudo (simple) selector ":not" which accepts arguments in the sequence of simple selectors that is not a universal selector')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
</body></html>
|
|
@ -42,12 +42,12 @@
|
|||
<tbody id="s5">
|
||||
<tr><th><a href="chapter-5.htm">Chapter 5 -
|
||||
Selectors</a></th>
|
||||
<td>(0 Tests)</td></tr>
|
||||
<td>(1 Tests)</td></tr>
|
||||
</tbody>
|
||||
<tbody id="s6">
|
||||
<tr><th><a href="chapter-6.htm">Chapter 6 -
|
||||
CSS</a></th>
|
||||
<td>(17 Tests)</td></tr>
|
||||
<td>(18 Tests)</td></tr>
|
||||
</tbody>
|
||||
<tbody id="s7">
|
||||
<tr><th><a href="chapter-7.htm">Chapter 7 -
|
||||
|
@ -57,7 +57,7 @@
|
|||
<tbody id="s8">
|
||||
<tr><th><a href="chapter-8.htm">Chapter 8 -
|
||||
Utility APIs</a></th>
|
||||
<td>(0 Tests)</td></tr>
|
||||
<td>(1 Tests)</td></tr>
|
||||
</tbody>
|
||||
<tbody id="s9">
|
||||
<tr><th><a href="chapter-9.htm">Chapter 9 -
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue