Bug 1696215 - Add basic parsing web platform tests for page-size r=emilio
authorEmily McDonough <emcdonough@mozilla.com>
Fri, 05 Mar 2021 02:03:47 +0000
changeset 637115 8f05e804fa6a40e6407cfc604008c3fb66013c77
parent 637114 39b7de93a5d87500f9ab9a48088b48d10b2eccd8
child 637116 b7dbb2ba8dcb0a2357613a2f4217e20ed98d71fa
push id15212
push userffxbld-merge
push dateMon, 22 Mar 2021 14:40:41 +0000
treeherdermozilla-beta@ad9bae9bb10c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1696215
milestone88.0a1
first release with
nightly linux32
8f05e804fa6a / 88.0a1 / 20210305085604 / files
nightly linux64
8f05e804fa6a / 88.0a1 / 20210305085604 / files
nightly mac
8f05e804fa6a / 88.0a1 / 20210305085604 / files
nightly win32
8f05e804fa6a / 88.0a1 / 20210305085604 / files
nightly win64
8f05e804fa6a / 88.0a1 / 20210305085604 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1696215 - Add basic parsing web platform tests for page-size r=emilio Differential Revision: https://phabricator.services.mozilla.com/D107085
testing/web-platform/meta/css/css-page/parsing/size-001.html.ini
testing/web-platform/tests/css/css-page/parsing/size-001.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/css/css-page/parsing/size-001.html.ini
@@ -0,0 +1,4 @@
+[size-001.html]
+  prefs: [layout.css.page-size.enabled:true]
+  [size-001]
+    expected: FAIL
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-page/parsing/size-001.html
@@ -0,0 +1,55 @@
+<!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;
+}
+</style>
+
+<script>
+'use strict';
+
+const expectedSizes = [
+    "640px 480px",
+    "8.5in 11in",
+    "a4",
+    "3in 10in",
+    "jis-b5",
+    "auto",
+    "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>