Bug 1418224 Part 4 - Fix tests after adding shape-outside: <image> to style system. r=heycam
☠☠ backed out by a612dc93c598 ☠ ☠
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 22 Nov 2017 17:54:56 +0800
changeset 438294 3ef8715cb8d7488ff301b9e0eb71f6e5da54962e
parent 438293 0d58d9fed90de02e8903a8b4223910d4ddeac3ef
child 438295 44e3a8933093ac65ffd23cfdd2311725873f3f1b
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersheycam
bugs1418224
milestone59.0a1
Bug 1418224 Part 4 - Fix tests after adding shape-outside: <image> to style system. r=heycam Run those fragment URL tests in test_transitions_per_property.html for clip-path only because shape-outside will resolve URL fragments (i.e. #a), so the computed value of URL fragment will have document URL as a prefix, which won't match. Also, added absolute URL tests for both clip-path and shape-outside. MozReview-Commit-ID: 8SUpfTaV9cz
layout/style/test/property_database.js
layout/style/test/test_transitions_per_property.html
testing/web-platform/meta/service-workers/service-worker/fetch-request-css-images.https.html.ini
testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property.html.ini
testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property.html.ini
testing/web-platform/meta/web-animations/animation-model/animation-types/interpolation-per-property.html.ini
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6438,19 +6438,29 @@ if (IsCSSPropertyPrefEnabled("layout.css
   gCSSProperties["shape-outside"] = {
     domProp: "shapeOutside",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     applies_to_first_letter: true,
     initial_values: [ "none" ],
     other_values: [
       "url(#my-shape-outside)",
-    ].concat(basicShapeOtherValues),
-    invalid_values: basicShapeSVGBoxValues.concat(basicShapeInvalidValues),
-    unbalanced_values: basicShapeUnbalancedValues,
+    ].concat(
+      basicShapeOtherValues,
+      validGradientAndElementValues
+    ),
+    invalid_values: [].concat(
+      basicShapeSVGBoxValues,
+      basicShapeInvalidValues,
+      invalidGradientAndElementValues
+    ),
+    unbalanced_values: [].concat(
+      basicShapeUnbalancedValues,
+      unbalancedGradientAndElementValues
+    )
   };
 }
 
 
 if (IsCSSPropertyPrefEnabled("layout.css.filters.enabled")) {
   gCSSProperties["filter"] = {
     domProp: "filter",
     inherited: false,
--- a/layout/style/test/test_transitions_per_property.html
+++ b/layout/style/test/test_transitions_per_property.html
@@ -633,17 +633,17 @@ var transformTests = [
 ];
 
 // Even if the default reference-box of shape-outside is margin-box, which is
 // different from the default reference-box of clip-path, we still can reuse
 // these tests for both properties because we always explicitly assign a
 // reference-box (i.e. border-box or content-box) if needed.
 // Bug 1313619: Add some tests for two basic shapes with an explicit
 // reference-box and a default one.
-var clipPathAndShapeOutsideTests = [
+const basicShapesTests = [
   { start: "none", end: "none",
     expected: ["none"] },
   // none to shape
   { start: "none",
     end: "circle(500px at 500px 500px) border-box",
     expected:
       isServo ? ["circle", ["500px at 500px 500px"], "border-box"]
               : ["circle", ["500px at calc(500px + 0%) calc(500px + 0%)"], "border-box"]
@@ -775,22 +775,30 @@ var clipPathAndShapeOutsideTests = [
   },
   { start: "inset(0px round 20px)", end: "ellipse(500px 500px)",
     expected: ["ellipse", ["500px 500px at 50% 50%"]]
   },
   // shape to reference box
   { start: "circle(20px)", end: "content-box", expected: ["content-box"] },
   { start: "content-box", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
   // url to shape
+  { start: "circle(20px)", end: "url(http://localhost/a.png)", expected: ["url", ["\"http://localhost/a.png\""]] },
+  { start: "url(http://localhost/a.png)", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
+  // url to none
+  { start: "none", end: "url(http://localhost/a.png)", expected: ["url", ["\"http://localhost/a.png\""]] },
+  { start: "http://localhost/a.png", end: "none", expected: ["none"] },
+];
+
+const basicShapesWithFragmentUrlTests = [
+  // Fragment url to shape
   { start: "circle(20px)", end: "url('#a')", expected: ["url", ["\"#a\""]] },
   { start: "url('#a')", end: "circle(20px)", expected: ["circle", ["20px at 50% 50%"]] },
-  // url to none
+  // Fragment url to none
   { start: "none", end: "url('#a')", expected: ["url", ["\"#a\""]] },
   { start: "url('#a')", end: "none", expected: ["none"] },
-
 ];
 
 var filterTests = [
   { start: "none", end: "none",
     expected: ["none"] },
   // function from none (number/length)
   { start: "none", end: "brightness(0.5)",
     expected: ["brightness", 0.875] },
@@ -1570,18 +1578,23 @@ function filter_function_list_equals(com
       Math.abs(parseFloat(functionValue) - expected) > tolerance) {
       return false;
     }
   }
   return true;
 }
 
 function test_basic_shape_or_url_transition(prop) {
-  for (var i in clipPathAndShapeOutsideTests) {
-    var test = clipPathAndShapeOutsideTests[i];
+  let tests = basicShapesTests;
+  if (prop == "clip-path") {
+    // Clip-path won't resolve fragment URLs.
+    tests.concat(basicShapesWithFragmentUrlTests);
+  }
+
+  for (let test of tests) {
     div.style.setProperty("transition-property", "none", "");
     div.style.setProperty(prop, test.start, "");
     cs.getPropertyValue(prop);
     div.style.setProperty("transition-property", prop, "");
     div.style.setProperty(prop, test.end, "");
     var actual = cs.getPropertyValue(prop);
     ok(test_shape_or_url_equals(actual, test.expected),
        prop + " property is " + actual + " expected values of " +
--- a/testing/web-platform/meta/service-workers/service-worker/fetch-request-css-images.https.html.ini
+++ b/testing/web-platform/meta/service-workers/service-worker/fetch-request-css-images.https.html.ini
@@ -1,12 +1,12 @@
 [fetch-request-css-images.https.html]
   type: testharness
   expected: TIMEOUT
   [Verify FetchEvent for css image (shapeOutside).]
-    expected: TIMEOUT
+    expected: FAIL # Bug 1418930
 
   [Verify FetchEvent for css image-set (backgroundImage).]
     expected: TIMEOUT
 
   [Verify FetchEvent for css image-set (shapeOutside).]
     expected: TIMEOUT
 
--- a/testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property.html.ini
+++ b/testing/web-platform/meta/web-animations/animation-model/animation-types/accumulation-per-property.html.ini
@@ -1,3 +1,10 @@
 prefs: [layout.css.font-variations.enabled:true, layout.css.overflow-clip-box.enabled:true]
 [accumulation-per-property.html]
   type: testharness
+  [shape-outside: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")"]
+    expected:
+      if not stylo: FAIL
+
+  [shape-outside: "url("http://localhost/test-1")" onto "url("http://localhost/test-2")"]
+    expected:
+      if not stylo: FAIL
--- a/testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property.html.ini
+++ b/testing/web-platform/meta/web-animations/animation-model/animation-types/addition-per-property.html.ini
@@ -1,3 +1,10 @@
 prefs: [layout.css.font-variations.enabled:true, layout.css.overflow-clip-box.enabled:true]
 [addition-per-property.html]
   type: testharness
+  [shape-outside: "url("http://localhost/test-2")" onto "url("http://localhost/test-1")"]
+    expected:
+      if not stylo: FAIL
+
+  [shape-outside: "url("http://localhost/test-1")" onto "url("http://localhost/test-2")"]
+    expected:
+      if not stylo: FAIL
--- a/testing/web-platform/meta/web-animations/animation-model/animation-types/interpolation-per-property.html.ini
+++ b/testing/web-platform/meta/web-animations/animation-model/animation-types/interpolation-per-property.html.ini
@@ -2,22 +2,42 @@ prefs: [layout.css.font-variations.enabl
 [interpolation-per-property.html]
   type: testharness
   [filter: interpolate different length of filter-function-list with drop-shadow function]
     expected: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1345709
 
   [font-variation-settings supports animation as float with multiple tags]
     expected:
-      if stylo: PASS
-      FAIL
+      if not stylo: FAIL
 
   [font-variation-settings supports animation as float with multiple duplicate tags]
     expected:
-      if stylo: PASS
-      FAIL
+      if not stylo: FAIL
 
   [transform: non-invertible matrices in matched transform lists]
     expected:
-      if stylo: PASS
-      FAIL
+      if not stylo: FAIL
     bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1400167
 
+  [shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with linear easing]
+    expected:
+      if not stylo: FAIL
+
+  [shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with linear easing]
+    expected:
+      if not stylo: FAIL
+
+  [shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with linear easing]
+    expected:
+      if not stylo: FAIL
+
+  [shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with effect easing]
+    expected:
+      if not stylo: FAIL
+
+  [shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with effect easing]
+    expected:
+      if not stylo: FAIL
+
+  [shape-outside uses discrete animation when animating between "url("http://localhost/test-1")" and "url("http://localhost/test-2")" with keyframe easing]
+    expected:
+      if not stylo: FAIL