diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/css/css-page | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-page')
69 files changed, 1016 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-page/META.yml b/testing/web-platform/tests/css/css-page/META.yml new file mode 100644 index 0000000000..2f9e29e278 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/META.yml @@ -0,0 +1,4 @@ +spec: https://drafts.csswg.org/css-page/ +suggested_reviewers: + - plinss + - fantasai diff --git a/testing/web-platform/tests/css/css-page/forced-page-breaks-002.xht b/testing/web-platform/tests/css/css-page/forced-page-breaks-002.xht new file mode 100644 index 0000000000..971dff0bd1 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/forced-page-breaks-002.xht @@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>CSS Test: forced page breaks for different page values</title> +<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> +<link rel="help" href="http://www.w3.org/TR/CSS21/page.html#page-break-props"/> +<meta name="assert" content="A page break MUST occur in the vertical margin between block boxes if the last line box above this margin and the first one below it do not have the same value for 'page'."/> +<meta name="flags" content="paged" /> +<style type="text/css"> + @page {size: portrait;} + @page breaker {size: portrait;} + * {margin: 0;} + div {page: breaker;} +</style> +</head> +<body> + <p>When printed, this test requires two pages.</p> + <div>This sentence must appear on a new page.</div> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-page/inheritance.html b/testing/web-platform/tests/css/css-page/inheritance.html new file mode 100644 index 0000000000..565287bce5 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/inheritance.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-page-3/"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/inheritance-testcommon.js"></script> +<div id="container"> + <div id="target"></div> +</div> +<script> + assert_not_inherited("page", "auto", "koko"); +</script> diff --git a/testing/web-platform/tests/css/css-page/page-background-000.xht b/testing/web-platform/tests/css/css-page/page-background-000.xht new file mode 100644 index 0000000000..4a4ffdee59 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-background-000.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>CSS Test: Page Box Background Coverage</title> +<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> +<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> +<link rel="help" href="http://www.w3.org/TR/css3-page/#page-properties"/> +<meta name="flags" content="paged" /> +<meta name="assert" content="The page background covers the entire page box, including the page margins."/> +<style type="text/css"> + @page { + background-color:#ccffcc; + margin:25%; + border: 2pt solid; + } +</style> +</head> +<body> + <div>This page must be covered by a pale green background. The background either completely covers the page, or leaves only a small strip of white where the printer can't reach.</div> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-borders-000.xht b/testing/web-platform/tests/css/css-page/page-borders-000.xht new file mode 100644 index 0000000000..5bc3b3f596 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-borders-000.xht @@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page border shorthand (absolute units)</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-properties"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-box-page-rule"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="A border declaration within the @page context applies to the page box."/> + <style type="text/css"><![CDATA[ + @page { + border: 1in solid green; + } + ]]></style> + </head> + <body> + <div>This paragraph must appear inside a box with a 1in thick green border.</div> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-counters-000.xht b/testing/web-platform/tests/css/css-page/page-counters-000.xht new file mode 100644 index 0000000000..a03b712fa8 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-counters-000.xht @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: margin box referencing document counters</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#populating-margin-boxes"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The value of the counter at the beginning of page processing must be used by default. "/> + <style type="text/css"><![CDATA[ + body {counter-reset: chapter;} + div.chapter {counter-increment: chapter;} + @page { + @top-center { content: "Chapter " counter(chapter); } + } + div.section {page-break-before: always;} + ]]></style> + </head> + <body> + <div class="chapter">This paragaraph should appear on the first page, which should say "Chapter 0" at the top. A second page with "Chapter 4" at the top should also print.</div> + <div class="chapter"></div> + <div class="chapter"></div> + + <div class="section chapter">This paragaraph should appear on the second page, which should say "Chapter 4" at the top.</div> + <div class="chapter"></div> + <div class="chapter"></div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-margin-003.xht b/testing/web-platform/tests/css/css-page/page-margin-003.xht new file mode 100644 index 0000000000..de4f894968 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-margin-003.xht @@ -0,0 +1,23 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page margin shorthand using ems</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-properties"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-box-page-rule"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="A margin declaration within the @page context applies to the page box."/> + <meta name="assert" content="A margin expressed in ems uses the page context's font."/> + <style type="text/css"><![CDATA[ + @page { + font-size: 18pt; + margin: 2em; + } + html, body {background: #ccc;} + ]]></style> + </head> + <body> + <p>This paragraph must appear inside a grey box. The box should be 0.5in from the page edge on all sides.</p> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-name-000.xht b/testing/web-platform/tests/css/css-page/page-name-000.xht new file mode 100644 index 0000000000..0044d5ac3d --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-name-000.xht @@ -0,0 +1,18 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: Page Selector Grammar - @page auto</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#syntax-page-selector"/> + <meta name="flags" content="paged invalid" /> + <style type="text/css"><![CDATA[ + @page { size: portrait; } + @page auto { size: landscape; } + div { page: auto } + ]]></style> + </head> + <body> + <div>This paragraph should be printed in portrait layout: the short sides of the page should be top and bottom.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-orientation.tentative.html b/testing/web-platform/tests/css/css-page/page-orientation.tentative.html new file mode 100644 index 0000000000..6725aa88e5 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-orientation.tentative.html @@ -0,0 +1,81 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-page-3/#page-orientation-prop"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> + @page { + page-orientation: rotate-right; + } + @page :left { + page-orientation: rotate-left; + } + @page :right { + page-orientation: rotate-right; + } + @page :first { + page-orientation: rotate-left; + } + @page named1 { + page-orientation: upright; + } + @page named2 { + page-orientation: hotpink; + } + @page named3 { + page-orientation: rotate-right; + } + @page named4 { + page-orientation: rotate-right; + page-orientation: rotate-left; + } + @page named5 { + page-orientation: hotpink; + page-orientation: rotate-right; + } + @page named6 { + page-orientation: rotate-right; + page-orientation: inherit; + page-orientation: initial; + page-orientation: none; + page-orientation: hotpink; + } + h5 { + page-orientation: rotate-right; + display: block; + } +</style> +<script> + let pageRuleExpectations = { + "" : "page-orientation: rotate-right;", + ":left" : "page-orientation: rotate-left;", + ":right" : "page-orientation: rotate-right;", + ":first" : "page-orientation: rotate-left;", + "named1" : "page-orientation: upright;", + "named2" : "", + "named3" : "page-orientation: rotate-right;", + "named4" : "page-orientation: rotate-left;", + "named5" : "page-orientation: rotate-right;", + "named6" : "page-orientation: rotate-right;", + }; + let styleRuleExpectations = { + "h5" : "display: block;" + }; + let styleSheets = document.styleSheets; + for (let i = 0; i < styleSheets.length; i++) { + let rules = styleSheets[i].cssRules; + for (let rule of rules) { + if (rule.type == CSSRule.PAGE_RULE) { + let expected = pageRuleExpectations[rule.selectorText]; + test(function() { + assert_equals(rule.style.cssText, expected, "unexpected @page contents"); + }, "contents for selector ['" + rule.selectorText + "']"); + } else if (rule.type == CSSRule.STYLE_RULE) { + let expected = styleRuleExpectations[rule.selectorText]; + test(function() { + assert_equals(rule.style.cssText, expected, "unexpected style rule contents"); + }, "contents for selector ['" + rule.selectorText + "']"); + } + } + } +</script> diff --git a/testing/web-platform/tests/css/css-page/page-properties-000.xht b/testing/web-platform/tests/css/css-page/page-properties-000.xht new file mode 100644 index 0000000000..a69907ea06 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-properties-000.xht @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page width and height</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-box-page-rule"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-properties"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'width' and 'height' properties do not apply to a page box."/> + <style type="text/css"><![CDATA[ + @page { + width: 1in; + height: 1in; + border: 2pt solid black; + } + div.biggerBox { + width: 2in; + height: 2in; + border: 1pt solid black; + } + ]]></style> + </head> + <body> + <div>This page should have a black border. The area inside the border should be larger than 1in×1in. The box below should be 2in×2in; and fit on the page.</div> + <div class="biggerBox"></div> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-rule-declarations-000.html b/testing/web-platform/tests/css/css-page/page-rule-declarations-000.html new file mode 100644 index 0000000000..cbe53855a0 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-rule-declarations-000.html @@ -0,0 +1,122 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Paged Media: parsing @page declarations</title> +<link rel="author" title="Felipe Erias Morandeira" href="mailto:felipeerias@gmail.com"/> +<link rel="help" href="https://drafts.csswg.org/css-page/#at-page-rule"/> +<meta name="assert" content="Test that @page declarations are parsed correctly."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style type="text/css"> + + @page :visited { /* :visited is invalid for @page */ + color: red; + } + @page a_page_name:visited { /* :visited is invalid for @page */ + background-color: red; + } + @page { + margin-top:5cm; + margin-bottom:10cm; + } + @page :left { + margin-right:3cm; + } + @page :right { + margin-left:3cm; + } + @page :first { + border-width:1px; + } + @page hello { + color:green; + } + @page world:right { + background-color:green; + } + @page auto_page { + size: auto; + } + @page square_page { + size: 4in; + } + @page letter_page { + size: letter; + } + @page page_width_height { + size: 10cm 15cm; + } + @page page_size_orientation { + size: ledger landscape; + } + @page page_orientation_size { + size: portrait a4; + } + @page page_jis_size_orientation { + size: jis-b5 portrait; + } + @page page_orientation_jis_size { + size: landscape jis-b4; + } + @page err_empty_size { + size:; + } + @page err_unknow_page_size { + size: yotsugiri; + } + @page err_length_and_page_size { + size: 10cm letter; + } + @page err_length_and_orientation { + size: 10cm landscape; + } + @page err_orientations { + size: portrait landscape; + } + @page err_too_many_params { + size: a5 landscape auto; + } + +</style> +<script type="text/javascript"> + + let expectedForSelector = { + "" : "margin-top: 5cm; margin-bottom: 10cm;", + ":left" : "margin-right: 3cm;", + ":right" : "margin-left: 3cm;", + ":first" : "border-width: 1px;", + "hello" : "color: green;", + "world:right" : "background-color: green;", + "auto_page" : "size: auto;", + "square_page" : "size: 4in;", + "letter_page" : "size: letter;", + "page_width_height" : "size: 10cm 15cm;", + "page_size_orientation" : "size: ledger landscape;", + "page_orientation_size" : "size: a4 portrait;", + "page_jis_size_orientation" : "size: jis-b5 portrait;", + "page_orientation_jis_size" : "size: jis-b4 landscape;", + "err_empty_size" : "", + "err_unknow_page_size" : "", + "err_length_and_page_size" : "", + "err_length_and_orientation" : "", + "err_orientations" : "", + "err_too_many_params" : "" + }; + let styleSheets = document.styleSheets; + for (let i = 0; i < styleSheets.length; i++) { + let rules = styleSheets[i].cssRules; + for (let rule of rules) { + if (rule.type == CSSRule.PAGE_RULE) { + let expected = expectedForSelector[rule.selectorText]; + test(function(){ + assert_equals(rule.style.cssText, expected, "unexpected @page contents"); + }, "unexpected contents for selector ['" + rule.selectorText + "']"); + delete expectedForSelector[rule.selectorText]; + } + } + } + test(function() { + assert_equals(Object.keys(expectedForSelector).length, 0, "missing @page selectors"); + }); + +</script> diff --git a/testing/web-platform/tests/css/css-page/page-rule-declarations-001.html b/testing/web-platform/tests/css/css-page/page-rule-declarations-001.html new file mode 100644 index 0000000000..dc225b5abd --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-rule-declarations-001.html @@ -0,0 +1,57 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Paged Media: parsing @page declarations inside @media</title> +<link rel="author" title="Felipe Erias Morandeira" href="mailto:felipeerias@gmail.com"/> +<link rel="help" href="https://drafts.csswg.org/css-page/#at-page-rule"/> +<meta name="assert" content="Test that @page declarations inside @media are parsed correctly."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style type="text/css"> + + @media print { + @page { + margin: 3cm; + } + @page :first { + margin-top: 6cm; + } + @page :left { + color: red; + } + @page :right { + color: blue; + } + } + +</style> +<script type="text/javascript"> + + let expectedForSelector = { + "" : "margin: 3cm;", + ":first" : "margin-top: 6cm;", + ":left" : "color: red;", + ":right" : "color: blue;" + }; + let styleSheets = document.styleSheets; + for (let i = 0; i < styleSheets.length; i++) { + let rules = styleSheets[i].cssRules; + for (let rule of rules) { + if (rule.type == CSSRule.MEDIA_RULE && rule.conditionText == 'print') { + for (let mediaRule of rule.cssRules) { + if (mediaRule.type == CSSRule.PAGE_RULE) { + let expected = expectedForSelector[mediaRule.selectorText]; + test(function(){ + assert_equals(mediaRule.style.cssText, expected, "unexpected @page contents"); + }, "unexpected contents for selector ['" + mediaRule.selectorText + "']"); + delete expectedForSelector[mediaRule.selectorText]; + } + } + } + } + } + test(function() { + assert_equals(Object.keys(expectedForSelector).length, 0, "missing @page selectors in @media"); + }); + +</script> diff --git a/testing/web-platform/tests/css/css-page/page-rule-declarations-002.html b/testing/web-platform/tests/css/css-page/page-rule-declarations-002.html new file mode 100644 index 0000000000..b35fa29244 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-rule-declarations-002.html @@ -0,0 +1,34 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Paged Media: parsing page properties inside HTML elements</title> +<link rel="author" title="Felipe Erias Morandeira" href="mailto:felipeerias@gmail.com"/> +<link rel="help" href="https://drafts.csswg.org/css-page/#using-named-pages"/> +<meta name="assert" content="Test that page properties of HTML elements are parsed correctly."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> + +<style type="text/css"> + + @page { + size: a4; + } + @page small_page { + size: a5 portrait; + } + @page large_page { + size: a3 landscape; + } + +</style> +<script type="text/javascript"> + + test_valid_value("page", "auto"); + test_valid_value("page", "small_page"); + test_valid_value("page", "large_page"); + test_invalid_value("page", "auto small_page"); + test_invalid_value("page", "large_page auto"); + test_invalid_value("page", "small_page large_page"); + test_invalid_value("page", "1cm"); + +</script> diff --git a/testing/web-platform/tests/css/css-page/page-rule-declarations-003.html b/testing/web-platform/tests/css/css-page/page-rule-declarations-003.html new file mode 100644 index 0000000000..aaf0bbb1a8 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-rule-declarations-003.html @@ -0,0 +1,75 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Paged Media: parsing @page selectors</title> +<link rel="author" title="Mozilla" href="https://mozilla.org"/> +<link rel="help" href="https://drafts.csswg.org/css-page/#page-selectors"/> +<meta name="assert" content="Test that @page selectors are parsed correctly."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> + @page a, B { + size: 1in; + } + @page A,b,C { + size: 2in; + } + @page auto { + size: 3in; + } + @page something, auto { + size: 4in; + } + @page auto, other_thing { + size: 5in; + } + @page _a, Z { + size: 6in; + } + @page -b, y { + size: 7in; + } + @page _abcd { + size: 8in; + } + @page n,-XYZ { + size: 9in; + } +</style> + +<script> + let expectedForSelector = { + "a, B" : "size: 1in;", + "A, b, C" : "size: 2in;", + "auto" : "size: 3in;", + "something, auto" : "size: 4in;", + "auto, other_thing" : "size: 5in;", + "_a, Z" : "size: 6in;", + "-b, y" : "size: 7in;", + "_abcd" : "size: 8in;", + "n, -XYZ" : "size: 9in;" + }; + let styleSheets = document.styleSheets; + for (let sheet of styleSheets) { + let rules = sheet.cssRules; + for (let rule of rules) { + if (rule.type == CSSRule.PAGE_RULE) { + let expected = expectedForSelector[rule.selectorText]; + test(function(){ + assert_equals(rule.style.cssText, expected, "unexpected @page contents"); + }, "contents for selector ['" + rule.selectorText + "']"); + delete expectedForSelector[rule.selectorText]; + } + } + } + // Validate that we can assign an empty selector + test(function() { + let rule = styleSheets[0].cssRules[0]; + assert_equals(rule.type, CSSRule.PAGE_RULE, "expected first rule to be @page"); + rule.selectorText = ""; + assert_equals(rule.selectorText, "", "unexpected selector when assigning blank string"); + }, "expected empty selector when assigning blank string"); + test(function() { + assert_equals(Object.keys(expectedForSelector).length, 0, "missing @page selectors"); + }); +</script> diff --git a/testing/web-platform/tests/css/css-page/page-rule-declarations-004.html b/testing/web-platform/tests/css/css-page/page-rule-declarations-004.html new file mode 100644 index 0000000000..94d0f8291d --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-rule-declarations-004.html @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Paged Media: parsing invalid @page selectors</title> +<link rel="author" title="Mozilla" href="https://mozilla.org"/> +<link rel="help" href="https://drafts.csswg.org/css-page/#page-selectors"/> +<meta name="assert" content="Test that @page selectors are parsed correctly."> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<style> + @page 1 { + size: 1in; + } + @page -3 { + size: 2in; + } + @page --a { + size: 3in; + } + @page 7cm { + size: 4in; + } + @page 0.17 { + size: 5in; + } + @page a, 123 { + size: 6in; + } +</style> + +<script> + const invalidSelectorTexts = [ + "1", + "-3", + "--a", + "7cm", + "0.17", + "a, 123", + ]; + + let styleSheets = document.styleSheets; + for (let sheet of styleSheets) { + for (let rule of sheet.cssRules) { + test(function(){ + assert_not_equals(rule.type, CSSRule.PAGE_RULE, + "no @page rule should have been parsed"); + }, "rule with invalid selector ['" + rule.selectorText + "']"); + } + } + + let ruleIndex = styleSheets[0].insertRule("@page{}"); + let rule = styleSheets[0].cssRules[ruleIndex]; + test(function() { + assert_equals(rule.selectorText, "", "Initial selector text should have been empty"); + assert_equals(rule.type, CSSRule.PAGE_RULE, "unexpected rule type (not @page)"); + }, "adding a blank @page rule"); + for (let selectorText of invalidSelectorTexts){ + test(function() { + // Clear the selector first + rule.selectorText = ""; + rule.selectorText = selectorText; + assert_equals(rule.selectorText, "", + "should not be able to assign an invalid selector"); + }, "assigning invalid selector text ['" + selectorText + "']"); + } +</script> diff --git a/testing/web-platform/tests/css/css-page/page-size-000.xht b/testing/web-platform/tests/css/css-page/page-size-000.xht new file mode 100644 index 0000000000..568e127fe8 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-000.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>CSS Test: Page Size - landscape</title> +<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> +<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> +<link rel="help" href="http://www.w3.org/TR/css3-page/#page-size"/> +<meta name="flags" content="paged" /> +<meta name="assert" content="The 'landscape' value of the 'size' property specifies that the page's content be printed in landscape orientation: the longer sides of the page box are horizontal."/> +<style type="text/css"> + + @page { + size:landscape; + } + +</style> +</head> +<body> + <div>This page must be printed in landscape orientation: the longer edges of the page must be horizontal.</div> +</body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-001.xht b/testing/web-platform/tests/css/css-page/page-size-001.xht new file mode 100644 index 0000000000..1b7ddb2d03 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-001.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>CSS Test: Page Size - portrait</title> +<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> +<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> +<link rel="help" href="http://www.w3.org/TR/css3-page/#page-size"/> +<meta name="flags" content="paged" /> +<meta name="assert" content="The 'portrait' value of the 'size' property specifies that the page's content be printed in portrait orientation: the shorter sides of the page box are horizontal."/> +<style type="text/css"> + + @page { + size:portrait; + } + +</style> +</head> +<body> + <div>This page must be printed in portrait orientation: the shorter edges of the page must be horizontal.</div> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-size-002.xht b/testing/web-platform/tests/css/css-page/page-size-002.xht new file mode 100644 index 0000000000..a96cd764bb --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-002.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size A5</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'A5' value of the 'size' property specifies that the page box's width be 148mm and its height 210mm."/> + <style type="text/css"><![CDATA[ + @page { + size: A5; + border: 2pt solid black; + margin: 20mm; + } + ]]></style> + </head> + <body> + <div>If A5 (148mm x 210mm) or larger paper is available, this content should be printed in a black box that has a width of 108mm and a height of 170mm.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-003.xht b/testing/web-platform/tests/css/css-page/page-size-003.xht new file mode 100644 index 0000000000..03d633c639 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-003.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size A4</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'A4' value of the 'size' property specifies that the page box's width be 210m and its height 297mm."/> + <style type="text/css"><![CDATA[ + @page { + size: A4; + border: 2pt solid black; + margin: 20mm; + } + ]]></style> + </head> + <body> + <div>If A4 (210mm x 297mm) or larger paper is available, this content should be printed in a black box that has a width of 170mm and a height of 257mm.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-004.xht b/testing/web-platform/tests/css/css-page/page-size-004.xht new file mode 100644 index 0000000000..205588eefa --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-004.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size A3</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'A3' value of the 'size' property specifies that the page box's width be 297mm and its height 420mm."/> + <style type="text/css"><![CDATA[ + @page { + size: A3; + border: 2pt solid black; + margin: 20mm; + } + ]]></style> + </head> + <body> + <div>If A3 (297mm x 420mm) or larger paper is available, this content should be printed in a black box that has a width of 257mm and a height of 380mm.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-005.xht b/testing/web-platform/tests/css/css-page/page-size-005.xht new file mode 100644 index 0000000000..1288f1c462 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-005.xht @@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size B5</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'B5' value of the 'size' property specifies that the page box's width be 176mm and its height 250mm."/> + <style type="text/css"><![CDATA[ + @page { + size: B5; + border: 2pt solid black; + margin: 20mm; + } + ]]></style> + </head> + <body> + <div>If B5 (176mm x 250mm) or larger paper is available, this content should be printed in a black box that has a width of 136mm and a height of 210mm.</div> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-size-006.xht b/testing/web-platform/tests/css/css-page/page-size-006.xht new file mode 100644 index 0000000000..6488cc0efc --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-006.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size B4</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'B4' value of the 'size' property specifies that the page box's width be 250mm and its height 353mm."/> + <style type="text/css"><![CDATA[ + @page { + size: B4; + border: 2pt solid black; + margin: 20mm; + } + ]]></style> + </head> + <body> + <div>If B4 (250mm x 353mm) or larger paper is available, this content should be printed in a black box that has a width of 210mm and a height of 313mm.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-007.xht b/testing/web-platform/tests/css/css-page/page-size-007.xht new file mode 100644 index 0000000000..fa1a72ea1e --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-007.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size Letter</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'letter' value of the 'size' property specifies that the page box's width be 8.5in and its height 11in."/> + <style type="text/css"><![CDATA[ + @page { + size: letter; + border: 2pt solid black; + margin: 1in; + } + ]]></style> + </head> + <body> + <div>If letter-sized (8.5in x 11in) or larger paper is available, this content should be printed in a black box that has a width of 6.5 inches and a height of 9 inches.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-008.xht b/testing/web-platform/tests/css/css-page/page-size-008.xht new file mode 100644 index 0000000000..9903fb6c9e --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-008.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size Legal</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'legal' value of the 'size' property specifies that the page box's width be 8.5in and its height 14in."/> + <style type="text/css"><![CDATA[ + @page { + size: legal; + border: 2pt solid black; + margin: 1in; + } + ]]></style> + </head> + <body> + <div>If legal-sized (8.5in x 14in) or larger paper is available, this content should be printed in a black box that has a width of 6.5 inches and a height of 12 inches.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-009.xht b/testing/web-platform/tests/css/css-page/page-size-009.xht new file mode 100644 index 0000000000..fb56cb6f2a --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-009.xht @@ -0,0 +1,21 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size Ledger</title> + <link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> + <link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> + <link rel="help" href="http://www.w3.org/TR/css3-page/#page-size-prop"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'ledger' value of the 'size' property specifies that the page box's width be 11in and its height 17in."/> + <style type="text/css"><![CDATA[ + @page { + size: ledger; + border: 2pt solid black; + margin: 2in; + } + ]]></style> + </head> + <body> + <div>If ledger-sized (11in x 17in) or larger paper is available, this content should be printed in a black box that has a width of 7 inches and a height of 13 inches.</div> + </body> +</html>
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/page-size-010.xht b/testing/web-platform/tests/css/css-page/page-size-010.xht new file mode 100644 index 0000000000..27d21cc874 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-010.xht @@ -0,0 +1,22 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>CSS Test: @page size smaller than paper</title> +<link rel="author" title="Tom Clancy" href="mailto:tclancy@revenution.com"/> +<link rel="author" title="Hewlett-Packard Company" href="http://www.hp.com/"/> +<link rel="help" href="http://www.w3.org/TR/css3-page/#page-size"/> +<meta name="flags" content="paged" /> +<meta name="assert" content="The computed value of the 'size' property is its specified value."/> +<meta name="assert" content="If the page box is smaller than the page size the user agent SHOULD either center the page box on the sheet or position the page box in the upper left corner of the page sheet." /> +<style type="text/css"> + @page { + margin: 0.5in; + border: 2pt solid black; + size: 3in 3in; + } +</style> +</head> +<body> + <p>When printed on paper 3 inches x 3 inches or larger, this content should appear in a box whose exterior dimensions are 2 inches x 2 inches. The box should either be centered on the page or positioned in the upper left corner.</p> +</body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-size-011.xht b/testing/web-platform/tests/css/css-page/page-size-011.xht new file mode 100644 index 0000000000..6c9e3bcb11 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-011.xht @@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size JIS-B5</title> + <link rel="author" title="Felipe Erias Morandeira" href="mailto:felipeerias@gmail.com"/> + <link rel="help" href="https://www.w3.org/TR/css-page-3/#typedef-page-size-page-size"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'JIS-B5' value of the 'size' property specifies that the page box's width be 182mm and its height 257mm."/> + <style type="text/css"><![CDATA[ + @page { + size: JIS-B5; + border: 2pt solid black; + margin: 20mm; + } + ]]></style> + </head> + <body> + <div>If JIS B5 (182mm x 257mm) or larger paper is available, this content should be printed in a black box that has a width of 142mm and a height of 217mm.</div> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-page/page-size-012.xht b/testing/web-platform/tests/css/css-page/page-size-012.xht new file mode 100644 index 0000000000..0def30ae45 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/page-size-012.xht @@ -0,0 +1,20 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>CSS Test: @page size JIS-B4</title> + <link rel="author" title="Felipe Erias Morandeira" href="mailto:felipeerias@gmail.com"/> + <link rel="help" href="https://www.w3.org/TR/css-page-3/#typedef-page-size-page-size"/> + <meta name="flags" content="paged" /> + <meta name="assert" content="The 'JIS-B4' value of the 'size' property specifies that the page box's width be 257mm and its height 364mm."/> + <style type="text/css"><![CDATA[ + @page { + size: JIS-B4; + border: 2pt solid black; + margin: 20mm; + } + ]]></style> + </head> + <body> + <div>If JIS B4 (257mm x 364mm) or larger paper is available, this content should be printed in a black box that has a width of 217mm and a height of 324mm.</div> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-page/parsing/page-computed.html b/testing/web-platform/tests/css/css-page/parsing/page-computed.html new file mode 100644 index 0000000000..0accba0574 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/parsing/page-computed.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-page-3/#using-named-pages"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/computed-testcommon.js"></script> +<div id="target"></div> +<script> + test_computed_value("page", "auto"); + test_computed_value("page", "AUTO", "auto"); + test_computed_value("page", "blablabla"); + test_computed_value("page", "BLABLABLA"); + test_computed_value("page", "table"); + test_computed_value("page", "TABLE"); +</script> diff --git a/testing/web-platform/tests/css/css-page/parsing/page-invalid.html b/testing/web-platform/tests/css/css-page/parsing/page-invalid.html new file mode 100644 index 0000000000..2c373a7d7f --- /dev/null +++ b/testing/web-platform/tests/css/css-page/parsing/page-invalid.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-page-3/#using-named-pages"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script> + test_invalid_value("page", "not valid"); + test_invalid_value("page", "not,valid"); + test_invalid_value("page", "123px"); + test_invalid_value("page", "calc(10%+1px)"); + test_invalid_value("page", "default"); +</script> diff --git a/testing/web-platform/tests/css/css-page/parsing/page-orientation-computed.tentative.html b/testing/web-platform/tests/css/css-page/parsing/page-orientation-computed.tentative.html new file mode 100644 index 0000000000..c9dd155f8c --- /dev/null +++ b/testing/web-platform/tests/css/css-page/parsing/page-orientation-computed.tentative.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-page-3/#page-orientation-prop"> +<div id="elm" style="page-orientation:rotate-right;"></div> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + test(()=> { + assert_equals(getComputedStyle(elm).pageOrientation, ""); + }, "page-orientation is not a property (only a descriptor)"); +</script> + diff --git a/testing/web-platform/tests/css/css-page/parsing/page-orientation-invalid.tentative.html b/testing/web-platform/tests/css/css-page/parsing/page-orientation-invalid.tentative.html new file mode 100644 index 0000000000..e89b1f0917 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/parsing/page-orientation-invalid.tentative.html @@ -0,0 +1,15 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://drafts.csswg.org/css-page-3/#page-orientation-prop"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script> + // page-orientation is not a property. test_invalid_value() tries to specify + // it on an element, and this should fail, even when using a valid + // value. page-orientation is only valid as a descriptor inside an @page rule. + test_invalid_value("page-orientation", "hotpink"); + test_invalid_value("page-orientation", "upright"); + test_invalid_value("page-orientation", "rotate-left"); + test_invalid_value("page-orientation", "rotate-right"); +</script> diff --git a/testing/web-platform/tests/css/css-page/parsing/page-valid.html b/testing/web-platform/tests/css/css-page/parsing/page-valid.html new file mode 100644 index 0000000000..a4c31f5766 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/parsing/page-valid.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/css-page-3/#using-named-pages"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/css/support/parsing-testcommon.js"></script> +<script> + test_valid_value("page", "auto"); + test_valid_value("page", "table"); + test_valid_value("page", "xyzabc"); +</script> diff --git a/testing/web-platform/tests/css/css-page/parsing/size-001.html b/testing/web-platform/tests/css/css-page/parsing/size-001.html new file mode 100644 index 0000000000..885a7b8530 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/parsing/size-001.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<link rel="author" title="Mozilla" href="https://mozilla.org"> +<link rel="help" href="https://drafts.csswg.org/css-page-3/#page-size-prop"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> +@page{ + size: 640px 480px; +} +@page{ + size: 8.5in 11in; +} +@page{ + size: A4; +} +@page{ + size: 3in 10in; +} +@page{ + size: jis-B5; +} +@page{ + size: auto; +} +@page{ + size: landscape; +} +@page{ + size: letter portrait; +} +@page{ + size: legal landscape; +} +</style> + +<script> +'use strict'; + +const expectedSizes = [ + "640px 480px", + "8.5in 11in", + "a4", + "3in 10in", + "jis-b5", + "auto", + "landscape", + "letter", + "legal landscape" +]; +const sizePrefix = "size: "; + +test(t => { + assert_equals(document.styleSheets.length, 1); + let styleSheet = document.styleSheets[0]; + assert_equals(styleSheet.rules.length, expectedSizes.length); + for(let i = 0; i < expectedSizes.length; i++){ + let cssText = styleSheet.cssRules[i].style.cssText; + assert_true(cssText.startsWith(sizePrefix)); + cssText = cssText.slice(sizePrefix.length); + assert_equals(cssText, expectedSizes[i] + ";", "for rule " + i); + } +}, "size-001"); +</script> diff --git a/testing/web-platform/tests/css/css-page/support/1x1-green.png b/testing/web-platform/tests/css/css-page/support/1x1-green.png Binary files differnew file mode 100644 index 0000000000..b98ca0ba0a --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/1x1-green.png diff --git a/testing/web-platform/tests/css/css-page/support/1x1-lime.png b/testing/web-platform/tests/css/css-page/support/1x1-lime.png Binary files differnew file mode 100644 index 0000000000..cb397fb090 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/1x1-lime.png diff --git a/testing/web-platform/tests/css/css-page/support/1x1-maroon.png b/testing/web-platform/tests/css/css-page/support/1x1-maroon.png Binary files differnew file mode 100644 index 0000000000..3f86b07219 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/1x1-maroon.png diff --git a/testing/web-platform/tests/css/css-page/support/1x1-navy.png b/testing/web-platform/tests/css/css-page/support/1x1-navy.png Binary files differnew file mode 100644 index 0000000000..9b9a03955b --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/1x1-navy.png diff --git a/testing/web-platform/tests/css/css-page/support/1x1-red.png b/testing/web-platform/tests/css/css-page/support/1x1-red.png Binary files differnew file mode 100644 index 0000000000..6bd73ac101 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/1x1-red.png diff --git a/testing/web-platform/tests/css/css-page/support/1x1-white.png b/testing/web-platform/tests/css/css-page/support/1x1-white.png Binary files differnew file mode 100644 index 0000000000..dd43faec54 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/1x1-white.png diff --git a/testing/web-platform/tests/css/css-page/support/60x60-gg-rr.png b/testing/web-platform/tests/css/css-page/support/60x60-gg-rr.png Binary files differnew file mode 100644 index 0000000000..84f5b2a4f1 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/60x60-gg-rr.png diff --git a/testing/web-platform/tests/css/css-page/support/60x60-green.png b/testing/web-platform/tests/css/css-page/support/60x60-green.png Binary files differnew file mode 100644 index 0000000000..b3c8cf3eb4 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/60x60-green.png diff --git a/testing/web-platform/tests/css/css-page/support/a-green.css b/testing/web-platform/tests/css/css-page/support/a-green.css new file mode 100644 index 0000000000..b0dbb071d5 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/a-green.css @@ -0,0 +1 @@ +.a { color: green; } diff --git a/testing/web-platform/tests/css/css-page/support/b-green.css b/testing/web-platform/tests/css/css-page/support/b-green.css new file mode 100644 index 0000000000..a0473f5ca2 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/b-green.css @@ -0,0 +1 @@ +.b { color: green; }
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/support/c-red.css b/testing/web-platform/tests/css/css-page/support/c-red.css new file mode 100644 index 0000000000..d4ba5c64e9 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/c-red.css @@ -0,0 +1 @@ +.c { color: red; }
\ No newline at end of file diff --git a/testing/web-platform/tests/css/css-page/support/cat.png b/testing/web-platform/tests/css/css-page/support/cat.png Binary files differnew file mode 100644 index 0000000000..85dd732481 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/cat.png diff --git a/testing/web-platform/tests/css/css-page/support/import-green.css b/testing/web-platform/tests/css/css-page/support/import-green.css new file mode 100644 index 0000000000..537104e663 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/import-green.css @@ -0,0 +1 @@ +.import { color: green; } diff --git a/testing/web-platform/tests/css/css-page/support/import-red.css b/testing/web-platform/tests/css/css-page/support/import-red.css new file mode 100644 index 0000000000..9945ef4711 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/import-red.css @@ -0,0 +1 @@ +.import { color: red; } diff --git a/testing/web-platform/tests/css/css-page/support/intrinsic-size.jpg b/testing/web-platform/tests/css/css-page/support/intrinsic-size.jpg Binary files differnew file mode 100644 index 0000000000..b634fd1821 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/intrinsic-size.jpg diff --git a/testing/web-platform/tests/css/css-page/support/intrinsic-size.png b/testing/web-platform/tests/css/css-page/support/intrinsic-size.png Binary files differnew file mode 100644 index 0000000000..833e6e36cd --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/intrinsic-size.png diff --git a/testing/web-platform/tests/css/css-page/support/pattern-grg-rgr-grg.png b/testing/web-platform/tests/css/css-page/support/pattern-grg-rgr-grg.png Binary files differnew file mode 100644 index 0000000000..6fcfeb4883 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/pattern-grg-rgr-grg.png diff --git a/testing/web-platform/tests/css/css-page/support/pattern-grg-rrg-rgg.png b/testing/web-platform/tests/css/css-page/support/pattern-grg-rrg-rgg.png Binary files differnew file mode 100644 index 0000000000..fcf4f3fd7d --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/pattern-grg-rrg-rgg.png diff --git a/testing/web-platform/tests/css/css-page/support/pattern-rgr-grg-rgr.png b/testing/web-platform/tests/css/css-page/support/pattern-rgr-grg-rgr.png Binary files differnew file mode 100644 index 0000000000..db8ed5cf7b --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/pattern-rgr-grg-rgr.png diff --git a/testing/web-platform/tests/css/css-page/support/pattern-tr.png b/testing/web-platform/tests/css/css-page/support/pattern-tr.png Binary files differnew file mode 100644 index 0000000000..8b4b25364e --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/pattern-tr.png diff --git a/testing/web-platform/tests/css/css-page/support/square-purple.png b/testing/web-platform/tests/css/css-page/support/square-purple.png Binary files differnew file mode 100644 index 0000000000..0f522d7872 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/square-purple.png diff --git a/testing/web-platform/tests/css/css-page/support/square-teal.png b/testing/web-platform/tests/css/css-page/support/square-teal.png Binary files differnew file mode 100644 index 0000000000..e567f51b91 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/square-teal.png diff --git a/testing/web-platform/tests/css/css-page/support/square-white.png b/testing/web-platform/tests/css/css-page/support/square-white.png Binary files differnew file mode 100644 index 0000000000..5853cbb238 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/square-white.png diff --git a/testing/web-platform/tests/css/css-page/support/swatch-blue.png b/testing/web-platform/tests/css/css-page/support/swatch-blue.png Binary files differnew file mode 100644 index 0000000000..bf2759634d --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/swatch-blue.png diff --git a/testing/web-platform/tests/css/css-page/support/swatch-green.png b/testing/web-platform/tests/css/css-page/support/swatch-green.png Binary files differnew file mode 100644 index 0000000000..0aa79b0c86 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/swatch-green.png diff --git a/testing/web-platform/tests/css/css-page/support/swatch-lime.png b/testing/web-platform/tests/css/css-page/support/swatch-lime.png Binary files differnew file mode 100644 index 0000000000..55fd7fdaed --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/swatch-lime.png diff --git a/testing/web-platform/tests/css/css-page/support/swatch-orange.png b/testing/web-platform/tests/css/css-page/support/swatch-orange.png Binary files differnew file mode 100644 index 0000000000..d3cd498b52 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/swatch-orange.png diff --git a/testing/web-platform/tests/css/css-page/support/swatch-red.png b/testing/web-platform/tests/css/css-page/support/swatch-red.png Binary files differnew file mode 100644 index 0000000000..1caf25c992 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/swatch-red.png diff --git a/testing/web-platform/tests/css/css-page/support/swatch-white.png b/testing/web-platform/tests/css/css-page/support/swatch-white.png Binary files differnew file mode 100644 index 0000000000..1a7d4323d7 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/swatch-white.png diff --git a/testing/web-platform/tests/css/css-page/support/swatch-yellow.png b/testing/web-platform/tests/css/css-page/support/swatch-yellow.png Binary files differnew file mode 100644 index 0000000000..1591aa0e2e --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/swatch-yellow.png diff --git a/testing/web-platform/tests/css/css-page/support/test-bl.png b/testing/web-platform/tests/css/css-page/support/test-bl.png Binary files differnew file mode 100644 index 0000000000..904e24e996 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/test-bl.png diff --git a/testing/web-platform/tests/css/css-page/support/test-br.png b/testing/web-platform/tests/css/css-page/support/test-br.png Binary files differnew file mode 100644 index 0000000000..f413ff5c1a --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/test-br.png diff --git a/testing/web-platform/tests/css/css-page/support/test-outer.png b/testing/web-platform/tests/css/css-page/support/test-outer.png Binary files differnew file mode 100644 index 0000000000..82eeace7fc --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/test-outer.png diff --git a/testing/web-platform/tests/css/css-page/support/test-tl.png b/testing/web-platform/tests/css/css-page/support/test-tl.png Binary files differnew file mode 100644 index 0000000000..f6ac0ef7e8 --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/test-tl.png diff --git a/testing/web-platform/tests/css/css-page/support/test-tr.png b/testing/web-platform/tests/css/css-page/support/test-tr.png Binary files differnew file mode 100644 index 0000000000..59843ae54b --- /dev/null +++ b/testing/web-platform/tests/css/css-page/support/test-tr.png |