Bug 1464782: Put it behind a pref. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 27 Jun 2018 11:22:21 +0200
changeset 811251 9335e927817f04c3568fd6d7bc1ffb7ad8570fc3
parent 811250 3b788cccc54e973775edc5353d9df493fc651d02
push id114244
push userbmo:emilio@crisal.io
push dateWed, 27 Jun 2018 09:27:25 +0000
reviewersxidorn
bugs1464782
milestone63.0a1
Bug 1464782: Put it 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) => {