Bug 1452312 [wpt PR 10299] - [css-typed-om] Add support for border properties., a=testonly
authorDarren Shen <shend@chromium.org>
Mon, 09 Apr 2018 22:24:20 +0000
changeset 413779 17a3cc47b2136ca7d7896b97f7f9fa7627214c74
parent 413778 b7edde4fd3b9f6d9a8cea8f1e4cf7deba5454f44
child 413780 412d812b4e67829a16d27879aa3177eae4e4a998
push id33850
push userapavel@mozilla.com
push dateMon, 16 Apr 2018 09:53:48 +0000
treeherdermozilla-central@6276ec7ebbf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452312, 10299, 820299, 994433, 548697
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452312 [wpt PR 10299] - [css-typed-om] Add support for border properties., a=testonly Automatic update from web-platform-tests[css-typed-om] Add support for border properties. border-radius-* tests are failing because the computed value should always be a pair of values, but Blink currently returns a CSSValuePair with kDropIdenticalValue, so we sometimes compute to a single value. Fixing this requires either changing computed border-radius-* to use kKeepIdenticalValue, or overriding the computed value just for Typed OM [1] [1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.cpp?q=ComputedStylePropertyMap.cpp&dr&l=229 Bug: 820299 Change-Id: I4c67a7986a8e77d37e7936eabfa0b68b32de9df8 Reviewed-on: https://chromium-review.googlesource.com/994433 Commit-Queue: Darren Shen <shend@chromium.org> Reviewed-by: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#548697} wpt-commits: 487c4a84856364cac109848f8dc3fd31117d6d69 wpt-pr: 10299 wpt-commits: 487c4a84856364cac109848f8dc3fd31117d6d69 wpt-pr: 10299
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-outset.html
testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-repeat.html
testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-slice.html
testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-width.html
testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-radius.html
testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -318441,22 +318441,52 @@
     ]
    ],
    "css/css-typed-om/the-stylepropertymap/properties/border-color.html": [
     [
      "/css/css-typed-om/the-stylepropertymap/properties/border-color.html",
      {}
     ]
    ],
+   "css/css-typed-om/the-stylepropertymap/properties/border-image-outset.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/properties/border-image-outset.html",
+     {}
+    ]
+   ],
+   "css/css-typed-om/the-stylepropertymap/properties/border-image-repeat.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/properties/border-image-repeat.html",
+     {}
+    ]
+   ],
+   "css/css-typed-om/the-stylepropertymap/properties/border-image-slice.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/properties/border-image-slice.html",
+     {}
+    ]
+   ],
    "css/css-typed-om/the-stylepropertymap/properties/border-image-source.html": [
     [
      "/css/css-typed-om/the-stylepropertymap/properties/border-image-source.html",
      {}
     ]
    ],
+   "css/css-typed-om/the-stylepropertymap/properties/border-image-width.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/properties/border-image-width.html",
+     {}
+    ]
+   ],
+   "css/css-typed-om/the-stylepropertymap/properties/border-radius.html": [
+    [
+     "/css/css-typed-om/the-stylepropertymap/properties/border-radius.html",
+     {}
+    ]
+   ],
    "css/css-typed-om/the-stylepropertymap/properties/border-style.html": [
     [
      "/css/css-typed-om/the-stylepropertymap/properties/border-style.html",
      {}
     ]
    ],
    "css/css-typed-om/the-stylepropertymap/properties/border-width.html": [
     [
@@ -524836,20 +524866,40 @@
   "css/css-typed-om/the-stylepropertymap/properties/border-collapse.html": [
    "93e71097d3b28c88f51210a2f2a9fcf433f80cba",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/properties/border-color.html": [
    "5b8adde602ac79d8b1ea92bd29f25d8756d72f8a",
    "testharness"
   ],
+  "css/css-typed-om/the-stylepropertymap/properties/border-image-outset.html": [
+   "d884ef177bd0966ffa3935aabb2494e305738bd9",
+   "testharness"
+  ],
+  "css/css-typed-om/the-stylepropertymap/properties/border-image-repeat.html": [
+   "c8fcdad32a801fde33554fb49ad5b3f66d73d953",
+   "testharness"
+  ],
+  "css/css-typed-om/the-stylepropertymap/properties/border-image-slice.html": [
+   "26fa7f01d3fb41e8e20e09c3be2ee669c4b136bc",
+   "testharness"
+  ],
   "css/css-typed-om/the-stylepropertymap/properties/border-image-source.html": [
    "08934e205f88aecda9809ff98d63f2d8784080c3",
    "testharness"
   ],
+  "css/css-typed-om/the-stylepropertymap/properties/border-image-width.html": [
+   "16ae049c907d5a139c09423d1e08017c3a4ec838",
+   "testharness"
+  ],
+  "css/css-typed-om/the-stylepropertymap/properties/border-radius.html": [
+   "dfb1ac911d906b9700076657fc0ff354e1d3683d",
+   "testharness"
+  ],
   "css/css-typed-om/the-stylepropertymap/properties/border-style.html": [
    "5d258827fb6a26d07efbdf5b47a440300f0aa307",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/properties/border-width.html": [
    "1383d1d87c7128b3059162d344f26586049a6460",
    "testharness"
   ],
@@ -525165,17 +525215,17 @@
    "ae21056fb993efb7112e0bc42fe1269f6bc0c72e",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/properties/resize.html": [
    "533f287facbc82118469f75f9f88a1372848d3b2",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js": [
-   "9e7a4bb8fa2d8ad491353117b409a2a7ff314d7f",
+   "2a2cf021b0bb67e028a4a83c49d914112cf6d18e",
    "support"
   ],
   "css/css-typed-om/the-stylepropertymap/properties/right.html": [
    "68a2611eaf9eecb7393c2b0db0f4378ebe285f22",
    "testharness"
   ],
   "css/css-typed-om/the-stylepropertymap/properties/scroll-margin.html": [
    "7d4636be3e35639b915917412465b443241e95b1",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-outset.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>'border-image-outset' property</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../resources/testhelper.js"></script>
+<script src="resources/testsuite.js"></script>
+<body>
+<div id="log"></div>
+<script>
+'use strict';
+
+runPropertyTests('border-image-outset', [
+  // Computed value is always four values, which are not supported in
+  // Typed OM level 1.
+  {
+    syntax: '<length>',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: '<number>',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+]);
+
+runUnsupportedPropertyTests('border-image-outset', [
+  '1 1.2', '30px 2 45px', '7px 12px 14px 5px'
+]);
+
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-repeat.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>'border-image-repeat' property</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../resources/testhelper.js"></script>
+<script src="resources/testsuite.js"></script>
+<body>
+<div id="log"></div>
+<script>
+'use strict';
+
+runPropertyTests('border-image-repeat', [
+  // Computed value is always a pair of values, which are not supported in
+  // Typed OM level 1.
+  {
+    syntax: 'stretch',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: 'repeat',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: 'round',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: 'space',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+]);
+
+runUnsupportedPropertyTests('border-image-repeat', [
+  'stretch repeat', 'round space'
+]);
+
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-slice.html
@@ -0,0 +1,33 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>'border-image-slice' property</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../resources/testhelper.js"></script>
+<script src="resources/testsuite.js"></script>
+<body>
+<div id="log"></div>
+<script>
+'use strict';
+
+runPropertyTests('border-image-slice', [
+  // Computed value is always four values, which are not supported in
+  // Typed OM level 1.
+  {
+    syntax: '<number>',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: '<percentage>',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+]);
+
+runUnsupportedPropertyTests('border-image-slice', [
+  '30 fill', '30 40 50', '30 40 50 60 fill'
+]);
+
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-image-width.html
@@ -0,0 +1,41 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>'border-image-width' property</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../resources/testhelper.js"></script>
+<script src="resources/testsuite.js"></script>
+<body>
+<div id="log"></div>
+<script>
+'use strict';
+
+runPropertyTests('border-image-width', [
+  // Computed value is always four values, which are not supported in
+  // Typed OM level 1.
+  {
+    syntax: '<length>',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: '<percentage>',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: '<number>',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+  {
+    syntax: 'auto',
+    computed: (_, result) => assert_is_unsupported(result)
+  },
+]);
+
+runUnsupportedPropertyTests('border-image-width', [
+  '2em 3em', '5% 15% 10%', '5% 2em 10% auto'
+]);
+
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/border-radius.html
@@ -0,0 +1,36 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>border radius properties</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-get">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#property-stle-value-normalization">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../../resources/testhelper.js"></script>
+<script src="resources/testsuite.js"></script>
+<body>
+<div id="log"></div>
+<script>
+'use strict';
+
+for (const suffix of ['top-left', 'top-right', 'bottom-left', 'bottom-right']) {
+  // Computed value is always a pair of values, which are not supported in
+  // Typed OM level 1.
+  runPropertyTests('border-' + suffix + '-radius', [
+    {
+      syntax: '<length>',
+      computed: (_, result) => assert_is_unsupported(result)
+    },
+    {
+      syntax: '<percentage>',
+      computed: (_, result) => assert_is_unsupported(result)
+    },
+  ]);
+}
+
+// shorthand
+runUnsupportedPropertyTests('border-radius', [
+  '30px', '25% 10%', '10% / 50%', '50% 20% / 10% 40%'
+]);
+
+</script>
--- a/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js
+++ b/testing/web-platform/tests/css/css-typed-om/the-stylepropertymap/properties/resources/testsuite.js
@@ -11,16 +11,20 @@ function assert_is_calc_sum(result) {
 
 function assert_is_equal_with_range_handling(input, result) {
   if (input instanceof CSSUnitValue && input.value < 0)
     assert_style_value_equals(result, new CSSMathSum(input));
   else
     assert_style_value_equals(result, input);
 }
 
+function assert_is_unsupported(result) {
+  assert_class_string(result, 'CSSStyleValue');
+}
+
 const gCssWideKeywordsExamples = [
   {
     description: 'initial keyword',
     input: new CSSKeywordValue('initial')
   },
   {
     description: 'inherit keyword',
     input: new CSSKeywordValue('initial')