Bug 1464782: Put offset-* aliases behind a pref. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 27 Jun 2018 11:22:21 +0200
changeset 479032 ecffedeea0e2e1b8f57a094c7ceb48a7da4a96dd
parent 479031 f65ca6e2fb7964ffddd4696a1335ad66e6cd1dbe
child 479033 8359b26b06efec25ec18db489fabebf7215accdf
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1464782
milestone63.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 1464782: Put offset-* aliases behind a pref. r=xidorn MozReview-Commit-ID: Hl6Muim3wVH
layout/style/test/property_database.js
modules/libpref/init/StaticPrefList.h
servo/components/style/properties/longhands/position.mako.rs
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6032,52 +6032,16 @@ var gCSSProperties = {
       "calc(-2px)",
       "calc(50%)",
       "calc(3*25px)",
       "calc(25px*3)",
       "calc(3*25px + 50%)",
     ],
     invalid_values: []
   },
-  "offset-block-start": {
-    domProp: "offsetBlockStart",
-    inherited: false,
-    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
-    logical: true,
-    get_computed: logical_box_prop_get_computed,
-    alias_for: "inset-block-start",
-    subproperties: [ "inset-block-start" ],
-  },
-  "offset-block-end": {
-    domProp: "offsetBlockEnd",
-    inherited: false,
-    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
-    logical: true,
-    get_computed: logical_box_prop_get_computed,
-    alias_for: "inset-block-end",
-    subproperties: [ "inset-block-end" ],
-  },
-  "offset-inline-start": {
-    domProp: "offsetInlineStart",
-    inherited: false,
-    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
-    logical: true,
-    get_computed: logical_box_prop_get_computed,
-    alias_for: "inset-inline-start",
-    subproperties: [ "inset-inline-start" ],
-  },
-  "offset-block-end": {
-    domProp: "offsetInlineEnd",
-    inherited: false,
-    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
-    logical: true,
-    get_computed: logical_box_prop_get_computed,
-    alias_for: "inset-inline-end",
-    subproperties: [ "inset-inline-end" ],
-  },
   "padding-block-end": {
     domProp: "paddingBlockEnd",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     applies_to_first_letter: true,
     // No applies_to_placeholder because we have a !important rule in forms.css.
     logical: true,
     get_computed: logical_box_prop_get_computed,
@@ -8119,16 +8083,55 @@ if (IsCSSPropertyPrefEnabled("layout.css
   gCSSProperties["-webkit-appearance"] = {
     domProp: "WebkitAppearance",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     alias_for: "-moz-appearance",
   };
 }
 
+if (IsCSSPropertyPrefEnabled("layout.css.offset-logical-properties.enabled")) {
+  gCSSProperties["offset-block-start"] = {
+    domProp: "offsetBlockStart",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    logical: true,
+    get_computed: logical_box_prop_get_computed,
+    alias_for: "inset-block-start",
+    subproperties: [ "inset-block-start" ],
+  };
+  gCSSProperties["offset-block-end"] = {
+    domProp: "offsetBlockEnd",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    logical: true,
+    get_computed: logical_box_prop_get_computed,
+    alias_for: "inset-block-end",
+    subproperties: [ "inset-block-end" ],
+  };
+  gCSSProperties["offset-inline-start"] = {
+    domProp: "offsetInlineStart",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    logical: true,
+    get_computed: logical_box_prop_get_computed,
+    alias_for: "inset-inline-start",
+    subproperties: [ "inset-inline-start" ],
+  };
+  gCSSProperties["offset-inline-end"] = {
+    domProp: "offsetInlineEnd",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    logical: true,
+    get_computed: logical_box_prop_get_computed,
+    alias_for: "inset-inline-end",
+    subproperties: [ "inset-inline-end" ],
+  };
+}
+
 if (IsCSSPropertyPrefEnabled("layout.css.prefixes.gradients")) {
   gCSSProperties["background"].other_values.push(
     "-moz-radial-gradient(10% bottom, #ffffff, black) scroll no-repeat",
     "-moz-linear-gradient(10px 10px -45deg, red, blue) repeat",
     "-moz-linear-gradient(10px 10px -0.125turn, red, blue) repeat",
     "-moz-repeating-radial-gradient(10% bottom, #ffffff, black) scroll no-repeat",
     "-moz-repeating-linear-gradient(10px 10px -45deg, red, blue) repeat",
     "url(404.png), -moz-linear-gradient(20px 20px -45deg, blue, green), -moz-element(#a) black",
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -229,16 +229,23 @@ VARCACHE_PREF(
 
 // Is -moz-prefixed gradient functions enabled?
 VARCACHE_PREF(
   "layout.css.prefixes.gradients",
    layout_css_prefixes_gradients,
   bool, true
 )
 
+// Whether the offset-* logical property aliases are enabled.
+VARCACHE_PREF(
+  "layout.css.offset-logical-properties.enabled",
+   layout_css_offset_logical_properties_enabled,
+  bool, true
+)
+
 // Should stray control characters be rendered visibly?
 #ifdef RELEASE_OR_BETA
 # define PREF_VALUE false
 #else
 # define PREF_VALUE true
 #endif
 VARCACHE_PREF(
   "layout.css.control-characters.visible",
--- a/servo/components/style/properties/longhands/position.mako.rs
+++ b/servo/components/style/properties/longhands/position.mako.rs
@@ -24,17 +24,17 @@
 // inset-* logical properties, map to "top" / "left" / "bottom" / "right"
 % for side in LOGICAL_SIDES:
     ${helpers.predefined_type(
         "inset-%s" % side,
         "LengthOrPercentageOrAuto",
         "computed::LengthOrPercentageOrAuto::Auto",
         spec="https://drafts.csswg.org/css-logical-props/#propdef-inset-%s" % side,
         flags="GETCS_NEEDS_LAYOUT_FLUSH",
-        alias="offset-%s" % side,
+        alias="offset-%s:layout.css.offset-logical-properties.enabled" % side,
         animation_value_type="ComputedValue",
         logical=True,
     )}
 % endfor
 
 #[cfg(feature = "gecko")]
 macro_rules! impl_align_conversions {
     ($name: path) => {