Bug 1208635 part 1: Add support for several prefixed CSS properties associated with -webkit-box, as aliases for modern flexbox properties (and behind a pref). r=heycam
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 04 Nov 2015 17:59:51 -0800
changeset 271182 e0317d4a7a0dae3dd7a9e10d752ef98e1d76d934
parent 271181 91a6134ea200f28f562144a71a254e7a50881081
child 271183 8b1626ab504f17950e36ae4a7387c77b1edf49b3
push id67588
push userdholbert@mozilla.com
push dateThu, 05 Nov 2015 02:00:25 +0000
treeherdermozilla-inbound@073a8c4b51ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1208635
milestone45.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 1208635 part 1: Add support for several prefixed CSS properties associated with -webkit-box, as aliases for modern flexbox properties (and behind a pref). r=heycam Specifically, this adds the following alias mappings: -webkit-box-flex --> flex-grow -webkit-box-ordinal-group --> order -webkit-box-align --> align-items -webkit-box-pack --> justify-content
layout/style/nsCSSPropAliasList.h
layout/style/test/property_database.js
--- a/layout/style/nsCSSPropAliasList.h
+++ b/layout/style/nsCSSPropAliasList.h
@@ -337,14 +337,33 @@ CSS_PROP_ALIAS(-webkit-border-image-widt
 CSS_PROP_ALIAS(-webkit-box-shadow,
                box_shadow,
                WebkitBoxShadow,
                WEBKIT_PREFIX_PREF)
 CSS_PROP_ALIAS(-webkit-box-sizing,
                box_sizing,
                WebkitBoxSizing,
                WEBKIT_PREFIX_PREF)
+
+// Alias old flexbox properties to modern flexbox pseudo-equivalents:
+CSS_PROP_ALIAS(-webkit-box-flex,
+               flex_grow,
+               WebkitBoxFlex,
+               WEBKIT_PREFIX_PREF)
+CSS_PROP_ALIAS(-webkit-box-ordinal-group,
+               order,
+               WebkitBoxOrdinalGroup,
+               WEBKIT_PREFIX_PREF)
+CSS_PROP_ALIAS(-webkit-box-align,
+               align_items,
+               WebkitBoxAlign,
+               WEBKIT_PREFIX_PREF)
+CSS_PROP_ALIAS(-webkit-box-pack,
+               justify_content,
+               WebkitBoxPack,
+               WEBKIT_PREFIX_PREF)
+
 CSS_PROP_ALIAS(-webkit-user-select,
                user_select,
                WebkitUserSelect,
                WEBKIT_PREFIX_PREF)
 
 #undef WEBKIT_PREFIX_PREF
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6729,16 +6729,44 @@ if (IsCSSPropertyPrefEnabled("layout.css
   };
   gCSSProperties["-webkit-box-sizing"] = {
     domProp: "webkitBoxSizing",
     inherited: false,
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
     alias_for: "box-sizing",
     subproperties: [ "box-sizing" ],
   };
+  gCSSProperties["-webkit-box-flex"] = {
+    domProp: "webkitBoxFlex",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    alias_for: "flex-grow",
+    subproperties: [ "flex-grow" ],
+  };
+  gCSSProperties["-webkit-box-ordinal-group"] = {
+    domProp: "webkitBoxOrdinalGroup",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    alias_for: "order",
+    subproperties: [ "order" ],
+  };
+  gCSSProperties["-webkit-box-align"] = {
+    domProp: "webkitBoxAlign",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    alias_for: "align-items",
+    subproperties: [ "align-items" ],
+  };
+  gCSSProperties["-webkit-box-pack"] = {
+    domProp: "webkitBoxPack",
+    inherited: false,
+    type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
+    alias_for: "justify-content",
+    subproperties: [ "justify-content" ],
+  };
   gCSSProperties["-webkit-user-select"] = {
     domProp: "webkitUserSelect",
     inherited: false,
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
     alias_for: "-moz-user-select",
     subproperties: [ "-moz-user-select" ],
   };
 }