diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/css/css-page/page-rule-declarations-000.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-page/page-rule-declarations-000.html')
-rw-r--r-- | testing/web-platform/tests/css/css-page/page-rule-declarations-000.html | 122 |
1 files changed, 122 insertions, 0 deletions
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> |