Add preferences (defaulting to enabled, for now) to control whether certain prefixed aliases for CSS properties are supported, so that authors can have a way to test what happens when they're turned off in advance of our disabling them. (Bug 804944) r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Fri, 26 Oct 2012 19:04:20 +0200
changeset 111671 f3d0e95c83ee050975a87afb42298bc35ebd9beb
parent 111670 8f8cc2ad5f88d6b7bbcf169f0c675acb2246d938
child 111672 027bbf3ee90ef3e198c1fa1ff004c6b9e156999a
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersbzbarsky
bugs804944
milestone19.0a1
Add preferences (defaulting to enabled, for now) to control whether certain prefixed aliases for CSS properties are supported, so that authors can have a way to test what happens when they're turned off in advance of our disabling them. (Bug 804944) r=bzbarsky
layout/style/nsCSSPropAliasList.h
layout/style/nsCSSPropList.h
modules/libpref/src/init/all.js
--- a/layout/style/nsCSSPropAliasList.h
+++ b/layout/style/nsCSSPropAliasList.h
@@ -30,28 +30,28 @@
   than needing the CSS_PROP_DOMPROP_PREFIXED(prop) macro).
 
   -. 'pref' is the name of a pref that controls whether the property
   is enabled.  The property is enabled if 'pref' is an empty string,
   or if the boolean property whose name is 'pref' is set to true.
 
  ******/
 
-CSS_PROP_ALIAS(-moz-transform-origin, transform_origin, MozTransformOrigin, "")
-CSS_PROP_ALIAS(-moz-perspective-origin, perspective_origin, MozPerspectiveOrigin, "")
-CSS_PROP_ALIAS(-moz-perspective, perspective, MozPerspective, "")
-CSS_PROP_ALIAS(-moz-transform-style, transform_style, MozTransformStyle, "")
-CSS_PROP_ALIAS(-moz-backface-visibility, backface_visibility, MozBackfaceVisibility, "")
-CSS_PROP_ALIAS(-moz-border-image, border_image, MozBorderImage, "")
-CSS_PROP_ALIAS(-moz-transition, transition, MozTransition, "")
-CSS_PROP_ALIAS(-moz-transition-delay, transition_delay, MozTransitionDelay, "")
-CSS_PROP_ALIAS(-moz-transition-duration, transition_duration, MozTransitionDuration, "")
-CSS_PROP_ALIAS(-moz-transition-property, transition_property, MozTransitionProperty, "")
-CSS_PROP_ALIAS(-moz-transition-timing-function, transition_timing_function, MozTransitionTimingFunction, "")
-CSS_PROP_ALIAS(-moz-animation, animation, MozAnimation, "")
-CSS_PROP_ALIAS(-moz-animation-delay, animation_delay, MozAnimationDelay, "")
-CSS_PROP_ALIAS(-moz-animation-direction, animation_direction, MozAnimationDirection, "")
-CSS_PROP_ALIAS(-moz-animation-duration, animation_duration, MozAnimationDuration, "")
-CSS_PROP_ALIAS(-moz-animation-fill-mode, animation_fill_mode, MozAnimationFillMode, "")
-CSS_PROP_ALIAS(-moz-animation-iteration-count, animation_iteration_count, MozAnimationIterationCount, "")
-CSS_PROP_ALIAS(-moz-animation-name, animation_name, MozAnimationName, "")
-CSS_PROP_ALIAS(-moz-animation-play-state, animation_play_state, MozAnimationPlayState, "")
-CSS_PROP_ALIAS(-moz-animation-timing-function, animation_timing_function, MozAnimationTimingFunction, "")
+CSS_PROP_ALIAS(-moz-transform-origin, transform_origin, MozTransformOrigin, "layout.css.prefixes.transforms")
+CSS_PROP_ALIAS(-moz-perspective-origin, perspective_origin, MozPerspectiveOrigin, "layout.css.prefixes.transforms")
+CSS_PROP_ALIAS(-moz-perspective, perspective, MozPerspective, "layout.css.prefixes.transforms")
+CSS_PROP_ALIAS(-moz-transform-style, transform_style, MozTransformStyle, "layout.css.prefixes.transforms")
+CSS_PROP_ALIAS(-moz-backface-visibility, backface_visibility, MozBackfaceVisibility, "layout.css.prefixes.transforms")
+CSS_PROP_ALIAS(-moz-border-image, border_image, MozBorderImage, "layout.css.prefixes.border-image")
+CSS_PROP_ALIAS(-moz-transition, transition, MozTransition, "layout.css.prefixes.transitions")
+CSS_PROP_ALIAS(-moz-transition-delay, transition_delay, MozTransitionDelay, "layout.css.prefixes.transitions")
+CSS_PROP_ALIAS(-moz-transition-duration, transition_duration, MozTransitionDuration, "layout.css.prefixes.transitions")
+CSS_PROP_ALIAS(-moz-transition-property, transition_property, MozTransitionProperty, "layout.css.prefixes.transitions")
+CSS_PROP_ALIAS(-moz-transition-timing-function, transition_timing_function, MozTransitionTimingFunction, "layout.css.prefixes.transitions")
+CSS_PROP_ALIAS(-moz-animation, animation, MozAnimation, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-delay, animation_delay, MozAnimationDelay, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-direction, animation_direction, MozAnimationDirection, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-duration, animation_duration, MozAnimationDuration, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-fill-mode, animation_fill_mode, MozAnimationFillMode, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-iteration-count, animation_iteration_count, MozAnimationIterationCount, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-name, animation_name, MozAnimationName, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-play-state, animation_play_state, MozAnimationPlayState, "layout.css.prefixes.animations")
+CSS_PROP_ALIAS(-moz-animation-timing-function, animation_timing_function, MozAnimationTimingFunction, "layout.css.prefixes.animations")
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -3361,17 +3361,17 @@ CSS_PROP_SVGRESET(
 // The shorthands below are essentially aliases, but they require different
 // parsing rules, and are therefore implemented as shorthands.
 CSS_PROP_SHORTHAND(
     -moz-transform,
     _moz_transform,
     MozTransform,
     CSS_PROPERTY_PARSE_FUNCTION |
         CSS_PROPERTY_IS_ALIAS,
-    "")
+    "layout.css.prefixes.transforms")
 
 #ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
 // We have a few properties that are in style structs but are not stored
 // in style sheets (or nsCSS* structs).  Some fields in these property
 // definitions are bogus (e.g., they work for nsRuleData* offsets but
 // not nsCSS* offsets).  Callers that care about these bogus fields can
 // define CSS_PROP_STUB_NOT_CSS to define a replacement for these
 // entries.
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -1605,16 +1605,22 @@ pref("layout.css.dpi", -1);
 pref("layout.css.devPixelsPerPx", "-1.0");
 
 // Is support for the the @supports rule enabled?
 pref("layout.css.supports-rule.enabled", true);
 
 // Is support for CSS Flexbox enabled?
 pref("layout.css.flexbox.enabled", false);
 
+// Are sets of prefixed properties supported?
+pref("layout.css.prefixes.border-image", true);
+pref("layout.css.prefixes.transforms", true);
+pref("layout.css.prefixes.transitions", true);
+pref("layout.css.prefixes.animations", true);
+
 // pref for which side vertical scrollbars should be on
 // 0 = end-side in UI direction
 // 1 = end-side in document/content direction
 // 2 = right
 // 3 = left
 pref("layout.scrollbar.side", 0);
 
 // pref to control browser frame rate, in Hz. A value <= 0 means choose