Bug 1289049 Part 4 - Make <basic-shape> animatable for shape-outside for gecko style system. draft
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 19 Sep 2017 17:21:21 +0800
changeset 667509 0dfe071694834eceba128bb2168004091ff8840b
parent 667508 9fbda6227187fdd4fe11f562d483ad37c500dfb6
child 732407 432c74128524f42da1a9b6282ed053d7e07a37b6
push id80736
push userbmo:tlin@mozilla.com
push dateWed, 20 Sep 2017 06:30:49 +0000
bugs1289049
milestone57.0a1
Bug 1289049 Part 4 - Make <basic-shape> animatable for shape-outside for gecko style system. MozReview-Commit-ID: 7x0jdqWqkpL
layout/style/StyleAnimationValue.cpp
layout/style/nsCSSPropList.h
layout/style/test/test_transitions_per_property.html
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -4580,16 +4580,26 @@ StyleAnimationValue::ExtractComputedValu
             static_cast<const nsStyleSVGReset*>(styleStruct);
           if (!ExtractComputedValueFromShapeSource(svgReset->mClipPath,
                                                    aComputedValue)) {
             return false;
           }
           break;
         }
 
+        case eCSSProperty_shape_outside: {
+          const nsStyleDisplay* styleDisplay =
+            static_cast<const nsStyleDisplay*>(styleStruct);
+          if (!ExtractComputedValueFromShapeSource(styleDisplay->mShapeOutside,
+                                                   aComputedValue)) {
+            return false;
+          };
+          break;
+        }
+
         case eCSSProperty_filter: {
           const nsStyleEffects* effects =
             static_cast<const nsStyleEffects*>(styleStruct);
           const nsTArray<nsStyleFilter>& filters = effects->mFilters;
           nsAutoPtr<nsCSSValueList> result;
           nsCSSValueList **resultTail = getter_Transfers(result);
           for (uint32_t i = 0; i < filters.Length(); ++i) {
             nsCSSValueList *item = new nsCSSValueList;
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -3752,17 +3752,17 @@ CSS_PROP_DISPLAY(
     CSS_PROPERTY_PARSE_VALUE |
         CSS_PROPERTY_VALUE_PARSER_FUNCTION |
         CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
         CSS_PROPERTY_STORES_CALC,
     "layout.css.shape-outside.enabled",
     0,
     nullptr,
     CSS_PROP_NO_OFFSET,
-    eStyleAnimType_Discrete) // FIXME: Bug 1289049 for adding animation support
+    eStyleAnimType_Custom)
 CSS_PROP_SVG(
     shape-rendering,
     shape_rendering,
     ShapeRendering,
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
     kShapeRenderingKTable,
--- a/layout/style/test/test_transitions_per_property.html
+++ b/layout/style/test/test_transitions_per_property.html
@@ -281,19 +281,17 @@ var supported_properties = {
     "word-spacing": [ test_length_transition, test_length_unclamped ],
     "z-index": [ test_integer_transition, test_pos_integer_or_auto_transition ],
     "-webkit-text-fill-color": [ test_color_transition,
                                  test_true_currentcolor_transition ],
     "-webkit-text-stroke-color": [ test_color_transition,
                                    test_true_currentcolor_transition ]
 };
 
-// Bug 1289049: After making shape-outside animatable on Gecko, we can remove
-// |isServo| flag from this if-condition.
-if (SpecialPowers.getBoolPref("layout.css.shape-outside.enabled") && isServo) {
+if (SpecialPowers.getBoolPref("layout.css.shape-outside.enabled")) {
   supported_properties["shape-outside"] =
     [ test_basic_shape_or_url_transition ];
 }
 
 if (SupportsMaskShorthand()) {
   supported_properties["mask-position"] = [ test_background_position_transition,
                                      // FIXME: We don't currently test clamping,
                                      // since mask-position uses calc() as