Update CSS tests to revision 7a87ef71fc579e52d3438e009107aa442bc4021b

This commit is contained in:
Ms2ger 2015-10-06 12:33:05 +02:00
parent ad94ef5a96
commit 145aea3eeb
1196 changed files with 14344 additions and 6221 deletions

View file

@ -13,7 +13,7 @@
<body>
<h1>CSS Object Model Level 1 CR Test Suite</h1>
<h2>CSS (18 tests)</h2>
<h2>CSS (20 tests)</h2>
<table width="100%">
<col id="test-column"></col>
<col id="refs-column"></col>
@ -37,7 +37,18 @@
<tr><th colspan="4" scope="rowgroup">
<a href="#s6.1">+</a>
<a href="http://www.w3.org/TR/cssom/#css-style-sheets">6.1 CSS Style Sheets</a></th></tr>
<!-- 0 tests -->
<!-- 1 tests -->
<tr id="style-sheet-interfaces-001-6.1" class="primary dom script">
<td><strong>
<a href="style-sheet-interfaces-001.xht">style-sheet-interfaces-001</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>CSSOM StyleSheet Initial Values
<ul class="assert">
<li>StyleSheet and CSSStyleSheet objects have the properties specified in their interfaces</li>
</ul>
</td>
</tr>
</tbody>
<tbody id="s6.1.#concept-css-style-sheet-alternate-flag">
<!-- 0 tests -->
@ -141,7 +152,29 @@
<tr><th colspan="4" scope="rowgroup">
<a href="#s6.2">+</a>
<a href="http://www.w3.org/TR/cssom/#css-style-sheet-collections">6.2 CSS Style Sheet Collections</a></th></tr>
<!-- 0 tests -->
<!-- 2 tests -->
<tr id="ttwf-cssom-doc-ext-load-count-6.2" class="dom script">
<td>
<a href="ttwf-cssom-doc-ext-load-count.xht">ttwf-cssom-doc-ext-load-count</a></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>CSSOM - Extensions to the Document Interface: StyleSheetList length reflects dynamically loaded and unloaded sheets
<ul class="assert">
<li>The styleSheets length attribute must reflect the number of sheets at page load and after dynamically</li>
</ul>
</td>
</tr>
<tr id="ttwf-cssom-doc-ext-load-tree-order-6.2" class="dom script">
<td>
<a href="ttwf-cssom-doc-ext-load-tree-order.xht">ttwf-cssom-doc-ext-load-tree-order</a></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>CSSOM - Extensions to the Document Interface: Stylesheet header load order
<ul class="assert">
<li>Document's style sheets created from HTTP Link headers are first in list and loaded in header order</li>
</ul>
</td>
</tr>
</tbody>
<tbody id="s6.2.#add-a-css-style-sheet">
<!-- 0 tests -->
@ -192,7 +225,40 @@
<tr><th colspan="4" scope="rowgroup">
<a href="#s6.2.2">+</a>
<a href="http://www.w3.org/TR/cssom/#the-stylesheetlist-interface">6.2.2 The StyleSheetList Interface</a></th></tr>
<!-- 0 tests -->
<!-- 3 tests -->
<tr id="ttwf-cssom-doc-ext-load-count-6.2.2" class="dom script">
<td>
<a href="ttwf-cssom-doc-ext-load-count.xht">ttwf-cssom-doc-ext-load-count</a></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>CSSOM - Extensions to the Document Interface: StyleSheetList length reflects dynamically loaded and unloaded sheets
<ul class="assert">
<li>The styleSheets length attribute must reflect the number of sheets at page load and after dynamically</li>
</ul>
</td>
</tr>
<tr id="ttwf-cssom-doc-ext-load-tree-order-6.2.2" class="dom script">
<td>
<a href="ttwf-cssom-doc-ext-load-tree-order.xht">ttwf-cssom-doc-ext-load-tree-order</a></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>CSSOM - Extensions to the Document Interface: Stylesheet header load order
<ul class="assert">
<li>Document's style sheets created from HTTP Link headers are first in list and loaded in header order</li>
</ul>
</td>
</tr>
<tr id="ttwf-cssom-document-extension-6.2.2" class="dom script">
<td>
<a href="ttwf-cssom-document-extension.xht">ttwf-cssom-document-extension</a></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>CSSOM - Extensions to the Document Interface: StyleSheetList length is 0 when no sheets loaded
<ul class="assert">
<li>The styleSheets attribute must return a StyleSheetList sequence representing the document style sheets.</li>
</ul>
</td>
</tr>
</tbody>
<tbody id="s6.2.2.#dom-stylesheetlist-item">
<!-- 0 tests -->
@ -391,7 +457,18 @@
<tr><th colspan="4" scope="rowgroup">
<a href="#s6.4.1">+</a>
<a href="http://www.w3.org/TR/cssom/#the-cssrulelist-interface">6.4.1 The CSSRuleList Interface</a></th></tr>
<!-- 0 tests -->
<!-- 1 tests -->
<tr id="index-003-6.4.1" class="primary dom script">
<td><strong>
<a href="index-003.xht">index-003</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>CSS OM: CSS Values
<ul class="assert">
<li>Testing Serialization of Style Rules</li>
</ul>
</td>
</tr>
</tbody>
<tbody id="s6.4.1.#cssrulelist">
<!-- 0 tests -->
@ -484,7 +561,18 @@
<tr><th colspan="4" scope="rowgroup">
<a href="#s6.4.3">+</a>
<a href="http://www.w3.org/TR/cssom/#the-cssstylerule-interface">6.4.3 The CSSStyleRule Interface</a></th></tr>
<!-- 0 tests -->
<!-- 1 tests -->
<tr id="cssstylerule-6.4.3" class="dom script">
<td>
<a href="cssstylerule.xht">cssstylerule</a></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>CSSOM CSSRule CSSStyleRule interface
<ul class="assert">
<li>All properties for this CSSStyleRule instance of CSSRule are initialized correctly</li>
</ul>
</td>
</tr>
</tbody>
<tbody id="s6.4.3.#concept-declarations-specified-order">
<!-- 0 tests -->
@ -514,7 +602,18 @@
<tr><th colspan="4" scope="rowgroup">
<a href="#s6.4.5">+</a>
<a href="http://www.w3.org/TR/cssom/#the-cssimportrule-interface">6.4.5 The CSSImportRule Interface</a></th></tr>
<!-- 0 tests -->
<!-- 1 tests -->
<tr id="cssimportrule-6.4.5" class="dom script">
<td>
<a href="cssimportrule.xht">cssimportrule</a></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>CSSOM CSSRule CSSImportRule interface
<ul class="assert">
<li>All properties for this CSSImportRule instance of CSSRule are initialized correctly</li>
</ul>
</td>
</tr>
</tbody>
<tbody id="s6.4.5.#cssimportrule">
<!-- 0 tests -->

View file

@ -14,8 +14,8 @@
{
"CSSStyleDeclaration_accessible": {
"help": ["http://www.w3.org/TR/cssom/#the-cssstylesheet-interface",
"http://www.w3.org/TR/cssom/#the-cssrulelist-sequence",
"http://www.w3.org/TR/cssom/#css-style-rule-rule-set"],
"http://www.w3.org/TR/cssom/#the-cssrulelist-interface",
"http://www.w3.org/TR/cssom/#the-cssstylerule-interface"],
"assert": "Can access CSSStyleDeclaration through CSSOM"
},
"read": { "assert": "initial property values are correct" },
@ -46,8 +46,8 @@
declaration = styleElement.sheet.cssRules.item(0).style;
}, "CSSStyleDeclaration_accessible",
{ help: [ "http://www.w3.org/TR/cssom/#the-cssstylesheet-interface",
"http://www.w3.org/TR/cssom/#the-cssrulelist-sequence",
"http://www.w3.org/TR/cssom/#css-style-rule-rule-set" ],
"http://www.w3.org/TR/cssom/#the-cssrulelist-interface",
"http://www.w3.org/TR/cssom/#the-cssstylerule-interface" ],
assert: "Can access CSSStyleDeclaration through CSSOM" });
test(function() {

View file

@ -4,7 +4,7 @@
<link href="mailto:lew.letitia@gmail.com" rel="author" title="Letitia Lew" />
<link href="http://www.w3.org/TR/cssom/#css-rules" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-cssrule-interface" rel="help" />
<link href="http://www.w3.org/TR/cssom/#css-import-rule" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-cssimportrule-interface" rel="help" />
<meta content="dom" name="flags" />
<meta content="All properties for this CSSImportRule instance of CSSRule are initialized correctly" name="assert" />
<script src="/resources/testharness.js"></script>

View file

@ -4,7 +4,7 @@
<link href="mailto:lew.letitia@gmail.com" rel="author" title="Letitia Lew" />
<link href="http://www.w3.org/TR/cssom/#css-rules" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-cssrule-interface" rel="help" />
<link href="http://www.w3.org/TR/cssom/#css-style-rule-rule-set" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-cssstylerule-interface" rel="help" />
<meta content="dom" name="flags" />
<meta content="All properties for this CSSStyleRule instance of CSSRule are initialized correctly" name="assert" />
<script src="/resources/testharness.js"></script>

View file

@ -0,0 +1,96 @@
<!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 OM: CSS Values</title>
<link href="mailto:manian@adobe.com" rel="author" title="Divya Manian" />
<link href="http://www.w3.org/TR/cssom/#the-cssrulelist-interface" rel="help" />
<meta content="dom" name="flags" />
<meta content="Testing Serialization of Style Rules" name="assert" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style id="s-0">
@namespace svg "http://www.w3.org/2000/svg";
</style>
<style id="s-1">
@import url('main.css');
</style>
<style id="s-2">
h1 { background: indianred; }
</style>
<style id="s-3">
@namespace svg "http://www.w3.org/2000/svg";
svg|a { color: white; }
</style>
<style id="s-4">
@font-face {
font-family: 'Megalopolis';
src: url('fonts/megalopolisextra-webfont.eot');
src: url('fonts/megalopolisextra-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/megalopolisextra-webfont.woff') format('woff'),
url('fonts/megalopolisextra-webfont.ttf') format('truetype'),
url('fonts/megalopolisextra-webfont.svg#MEgalopolisExtraRegular') format('svg');
font-weight: normal;
font-style: normal;
}
</style>
<style id="s-5">
@media (min-width: 200px) {
h1 { background: aliceblue; }
}
</style>
<style id="s-6">
@page :first {
h1 { color: #444; }
}
</style>
</head>
<body>
<div id="log"></div>
<script>
var stylesheets = document.styleSheets;
var ruletypes = {
1: 'Style Rule',
3: '@import rule',
4: 'media rule',
5: '@font-face rule',
6: 'page rule',
10: 'Namespace rule',
11: 'unrecognized rule'
};
var types = {
's-0': '@namespace svg "http://www.w3.org/2000/svg"',
's-1': '@import url("main.css")',
's-2': 'h1',
's-3': 'svg|a',
's-4': '@font-face',
's-5': '@media (min-width: 200px)',
's-6': '@page :first'
}
var ruleOrder = [10, 3, 1, 1, 5, 4, 6];
var results = [];
for (i = 0; i &lt; stylesheets.length; i++) {
if(i == 3) {
cssType = stylesheets[i].cssRules.length &gt; 0 &amp;&amp; stylesheets[i].cssRules[1] ? stylesheets[i].cssRules[1].type : 11;
} else {
cssType = stylesheets[i].cssRules.length &gt; 0 ? stylesheets[i].cssRules[0].type : 11;
}
results.push([
ruletypes[ruleOrder[i]] + ' is expected to be ' + types['s-' + i],
ruletypes[cssType],
ruletypes[ruleOrder[i]]
]);
}
generate_tests(assert_equals, results);
</script>
</body></html>

View file

@ -0,0 +1,127 @@
<!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: CSSOM StyleSheet Initial Values</title>
<link href="mailto:betravis@adobe.com" rel="author" title="Bear Travis" />
<link href="http://www.w3.org/TR/cssom/#css-style-sheets" rel="help" />
<meta content="dom" name="flags" />
<meta content="StyleSheet and CSSStyleSheet objects have the properties specified in their interfaces" name="assert" />
<script src="/resources/testharness.js" type="text/javascript"></script>
<script src="/resources/testharnessreport.js" type="text/javascript"></script>
<style disabled="disabled" media="all" type="text/css" id="styleElement" title="internal style sheet">
@import url('support/a-green.css');
* { margin: 0; padding: 0; }
</style>
<link href="support/b-green.css" id="linkElement" rel="stylesheet" />
<script id="metadata_cache">/*
{
"sheet_property": {
"help": "http://www.w3.org/TR/cssom/#the-linkstyle-interface",
"assert": ["styleElement.sheet exists",
"styleElement.sheet is a CSSStyleSheet",
"linkElement.sheet exists",
"linkElement.sheet is a CSSStyleSheet"]
},
"CSSStyleSheet_properties": {
"assert": ["ownerRule, cssRules, insertRule and deleteRule properties exist on CSSStyleSheet",
"ownerRule, cssRules are read only"]
},
"CSSStyleSheet_property_values": {
"help": ["http://www.w3.org/TR/cssom/#css-style-sheets",
"http://www.w3.org/TR/cssom/#cssimportrule"],
"assert": "CSSStyleSheet initial property values are correct"
},
"StyleSheet_properties": {
"assert": ["type, disabled, ownerNode, parentStyleSheet, href, title, and media properties exist on StyleSheet",
"type, ownerNode, parentStyleSheet, href, title, media properties are read only"]
},
"StyleSheet_property_values": { "assert": "StyleSheet initial property values are correct" }
}
*/</script>
</head>
<body>
<noscript>Test not run - javascript required.</noscript>
<div id="log"></div>
<script type="text/javascript">
var styleElement = document.getElementById("styleElement");
var linkElement = document.getElementById("linkElement");
var styleSheet;
var linkSheet;
test(function() {
assert_own_property(styleElement, "sheet");
assert_readonly(styleElement, "sheet");
styleSheet = styleElement.sheet;
assert_true(styleSheet instanceof CSSStyleSheet);
assert_own_property(linkElement, "sheet");
linkSheet = linkElement.sheet;
assert_true(linkSheet instanceof CSSStyleSheet);
}, "sheet_property",
{ help: "http://www.w3.org/TR/cssom/#the-linkstyle-interface",
assert: [ "styleElement.sheet exists", "styleElement.sheet is a CSSStyleSheet",
"linkElement.sheet exists", "linkElement.sheet is a CSSStyleSheet"] });
test(function() {
assert_own_property(styleSheet, "ownerRule");
assert_own_property(styleSheet, "cssRules");
assert_inherits(styleSheet, "insertRule");
assert_inherits(styleSheet, "deleteRule");
assert_readonly(styleSheet, "ownerRule");
assert_readonly(styleSheet, "cssRules");
}, "CSSStyleSheet_properties",
{ assert: [ "ownerRule, cssRules, insertRule and deleteRule properties exist on CSSStyleSheet",
"ownerRule, cssRules are read only"] });
var importSheet;
test(function() {
assert_equals(styleSheet.ownerRule, null);
assert_true(styleSheet.cssRules.length &gt; 0);
assert_true(styleSheet.cssRules.item(0) instanceof CSSImportRule);
importSheet = styleSheet.cssRules.item(0).styleSheet;
}, "CSSStyleSheet_property_values",
{ help: [ "http://www.w3.org/TR/cssom/#css-style-sheets",
"http://www.w3.org/TR/cssom/#cssimportrule" ],
assert: "CSSStyleSheet initial property values are correct" });
test(function() {
assert_own_property(styleSheet, "type");
assert_own_property(styleSheet, "disabled");
assert_own_property(styleSheet, "ownerNode");
assert_own_property(styleSheet, "parentStyleSheet");
assert_own_property(styleSheet, "href");
assert_own_property(styleSheet, "title");
assert_own_property(styleSheet, "media");
assert_readonly(styleSheet, "type");
assert_readonly(styleSheet, "ownerNode");
assert_readonly(styleSheet, "parentStyleSheet");
assert_readonly(styleSheet, "href");
assert_readonly(styleSheet, "title");
assert_readonly(styleSheet, "media");
}, "StyleSheet_properties",
{ assert: [ "type, disabled, ownerNode, parentStyleSheet, href, title, and media properties exist on StyleSheet",
"type, ownerNode, parentStyleSheet, href, title, media properties are read only" ] });
test(function() {
assert_equals(styleSheet.type, "text/css");
assert_equals(styleSheet.disabled, false);
assert_equals(styleSheet.ownerNode, styleElement);
assert_equals(linkSheet.ownerNode, linkElement);
assert_equals(importSheet.ownerNode, null);
assert_equals(styleSheet.href, null);
assert_regexp_match(linkSheet.href, /support\/b-green.css$/);
assert_regexp_match(importSheet.href, /support\/a-green.css$/);
assert_equals(styleSheet.parentStyleSheet, null);
assert_equals(linkSheet.parentStyleSheet, null);
assert_equals(importSheet.parentStyleSheet, styleSheet);
assert_equals(styleSheet.title, "internal style sheet");
assert_equals(styleSheet.media.item(0), "all");
}, "StyleSheet_property_values",
{ assert: "StyleSheet initial property values are correct" });
</script>
</body></html>

View file

@ -47,7 +47,7 @@
<tbody id="s6">
<tr><th><a href="chapter-6.xht">Chapter 6 -
CSS</a></th>
<td>(18 Tests)</td></tr>
<td>(20 Tests)</td></tr>
</tbody>
<tbody id="s7">
<tr><th><a href="chapter-7.xht">Chapter 7 -

View file

@ -3,8 +3,8 @@
<title>CSSOM - Extensions to the Document Interface: StyleSheetList length reflects dynamically loaded and unloaded sheets</title>
<link href="mailto:jesse@codeforamerica.org" rel="author" title="Jesse Bounds" />
<link href="http://www.w3.org/TR/cssom/#extensions-to-the-document-interface" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-stylesheetlist-sequence" rel="help" />
<link href="http://www.w3.org/TR/cssom/#style-sheet-collections" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-stylesheetlist-interface" rel="help" />
<link href="http://www.w3.org/TR/cssom/#css-style-sheet-collections" rel="help" />
<link href="stylesheet.css" type="text/css" rel="stylesheet" />
<meta content="dom" name="flags" />
<meta content="The styleSheets length attribute must reflect the number of sheets at page load and after dynamically" name="assert" />

View file

@ -3,8 +3,8 @@
<title>CSSOM - Extensions to the Document Interface: Stylesheet header load order</title>
<link href="mailto:jesse@codeforamerica.org" rel="author" title="Jesse Bounds" />
<link href="http://www.w3.org/TR/cssom/#extensions-to-the-document-interface" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-stylesheetlist-sequence" rel="help" />
<link href="http://www.w3.org/TR/cssom/#style-sheet-collections" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-stylesheetlist-interface" rel="help" />
<link href="http://www.w3.org/TR/cssom/#css-style-sheet-collections" rel="help" />
<style type="text/css" title="aaa">
H1 {border-width: 1; border: solid; text-align: center}
</style>

View file

@ -4,7 +4,7 @@
<link href="mailto:jesse@codeforamerica.org" rel="author" title="Jesse Bounds" />
<link href="mailto:ms2ger@gmail.com" rel="reviewer" title="Ms2ger" /> <!-- 2012-06-17 -->
<link href="http://www.w3.org/TR/cssom/#extensions-to-the-document-interface" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-stylesheetlist-sequence" rel="help" />
<link href="http://www.w3.org/TR/cssom/#the-stylesheetlist-interface" rel="help" />
<meta content="dom" name="flags" />
<meta content="The styleSheets attribute must return a StyleSheetList sequence representing the document style sheets." name="assert" />
<script src="/resources/testharness.js"></script>