Bug 1419695: Allow transitioning chrome-only properties, as long as they're specified as a longhand. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 01 Jun 2018 16:36:19 +0200
changeset 802879 ea33ab2045db0625d23006b40ad55d0a343cfa98
parent 802878 9d71758952380e760ffa3f192b7d4861e18405b6
child 802880 76b1be5d3ed6d793a7420441898e18846c4046e1
push id111985
push userbmo:emilio@crisal.io
push dateFri, 01 Jun 2018 15:50:16 +0000
reviewersxidorn
bugs1419695
milestone62.0a1
Bug 1419695: Allow transitioning chrome-only properties, as long as they're specified as a longhand. r?xidorn MozReview-Commit-ID: 4hQfYbhxeq7
layout/style/nsTransitionManager.cpp
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -484,16 +484,19 @@ nsTransitionManager::DoUpdateTransitions
     // FIXME: Would be good to find a way to share code between this
     // interpretation of transition-property and the one below.
     // FIXME(emilio): This should probably just use the "all" shorthand id, and
     // we should probably remove eCSSPropertyExtra_all_properties.
     if (property == eCSSPropertyExtra_all_properties) {
       for (nsCSSPropertyID p = nsCSSPropertyID(0);
            p < eCSSProperty_COUNT_no_shorthands;
            p = nsCSSPropertyID(p + 1)) {
+        if (!nsCSSProps::IsEnabled(p, CSSEnabledState::eForAllContent)) {
+          continue;
+        }
         startedAny |=
           ConsiderInitiatingTransition(p, aDisp, i, aElement, aPseudoType,
                                        aElementTransitions,
                                        aOldStyle, aNewStyle,
                                        propertiesChecked);
       }
     } else if (nsCSSProps::IsShorthand(property)) {
       CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(subprop, property,
@@ -661,23 +664,16 @@ nsTransitionManager::ConsiderInitiatingT
   // property, so we ignore this one.
   // See http://lists.w3.org/Archives/Public/www-style/2009Aug/0109.html .
   if (aPropertiesChecked.HasProperty(aProperty)) {
     return false;
   }
 
   aPropertiesChecked.AddProperty(aProperty);
 
-  // Ignore disabled properties. We can arrive here if the transition-property
-  // is 'all' and the disabled property has a default value which derives value
-  // from another property, e.g. color.
-  if (!nsCSSProps::IsEnabled(aProperty, CSSEnabledState::eForAllContent)) {
-    return false;
-  }
-
   if (!IsTransitionable(aProperty)) {
     return false;
   }
 
   float delay = aStyleDisplay.GetTransitionDelay(transitionIdx);
 
   // The spec says a negative duration is treated as zero.
   float duration =