Bug 1367299 - Allow -webkit-radial-gradient to be serialized in different way with stylo. r=dholbert
authorXidorn Quan <me@upsuper.org>
Fri, 04 Aug 2017 16:56:02 +1000
changeset 373009 4289bf02134048e882122ca79717449951c1bde0
parent 373008 331cdaa5807b822903b3234a202a6613d0adf635
child 373010 0c405b138c2b2a183d3c8a444dd09c3c066a04a5
push id48064
push userxquan@mozilla.com
push dateFri, 04 Aug 2017 22:52:20 +0000
treeherderautoland@4289bf021340 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1367299
milestone57.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 1367299 - Allow -webkit-radial-gradient to be serialized in different way with stylo. r=dholbert MozReview-Commit-ID: 7hBIf6PkiRa
layout/style/test/stylo-failures.md
layout/style/test/test_specified_value_serialization.html
--- a/layout/style/test/stylo-failures.md
+++ b/layout/style/test/stylo-failures.md
@@ -41,13 +41,11 @@ to mochitest command.
 * test_author_specified_style.html: support serializing color as author specified bug 1348165 [27]
 * browser_newtab_share_rule_processors.js: agent style sheet sharing [1]
 * test_selectors_on_anonymous_content.html: xbl and :nth-child bug 1382102 [1]
 
 ## Assertions
 
 ## Need Gecko change
 
-* test_specified_value_serialization.html `-webkit-radial-gradient`: bug 1380259 [1]
-
 ## Unknown / Unsure
 
 ## Ignore
--- a/layout/style/test/test_specified_value_serialization.html
+++ b/layout/style/test/test_specified_value_serialization.html
@@ -117,22 +117,33 @@
     [ "-webkit-linear-gradient(10deg, red, blue)",
       "-webkit-linear-gradient(10deg, red, blue)",
       "-webkit-linear-gradient with angled legacy-gradient-line" ],
 
     // Linear gradient with box corner (needs prefixed syntax):
     [ "-webkit-linear-gradient(top left, red, blue)",
       "-webkit-linear-gradient(left top, red, blue)",
       "-webkit-linear-gradient with box corner" ],
+  ];
 
+  if (!SpecialPowers.DOMWindowUtils.isStyledByServo) {
     // Radial gradients (should be serialized using modern unprefixed style):
-    [ "-webkit-radial-gradient(contain, red, blue)",
+    backgroundImages.push([
+      "-webkit-radial-gradient(contain, red, blue)",
       "radial-gradient(closest-side, red, blue)",
-      "-webkit-radial-gradient with legacy 'contain' keyword" ],
-  ];
+      "-webkit-radial-gradient with legacy 'contain' keyword",
+    ]);
+  } else {
+    // Servo keeps the original prefix form which is closer to other impls.
+    backgroundImages.push([
+      "-webkit-radial-gradient(contain, red, blue)",
+      "-webkit-radial-gradient(center center, closest-side, red, blue)",
+      "-webkit-radial-gradient with legacy 'contain' keyword",
+    ]);
+  }
 
   var frame_container = document.getElementById("display");
   var p = document.createElement("p");
   frame_container.appendChild(p);
 
   for (var i = 0; i < backgroundImages.length; ++i) {
     var test = backgroundImages[i];
     p.style.backgroundImage = test[0];