Bug 1262049 part 1: Back out bug 1208344 in its entirety, and mark -webkit-box-orient:vertical reftests as failing (for now). (no review)
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 20 Apr 2016 16:43:24 -0700
changeset 294200 7f41c81e14d24e71d3ab0210b3cb518f42eb4f35
parent 294199 4226c06dcf1ffa0d965bf6f8c77adf992a8b7d6b
child 294201 d701138d43e97ebb275f5b0eeaf93b5865be1729
push id18864
push userkwierso@gmail.com
push dateThu, 21 Apr 2016 22:03:23 +0000
treeherderfx-team@467bd00c72db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1262049, 1208344
milestone48.0a1
Bug 1262049 part 1: Back out bug 1208344 in its entirety, and mark -webkit-box-orient:vertical reftests as failing (for now). (no review) This patch backs out changeset range 1f1884449dd4:0b5ed5e4a395 (all of the patches for bug 1208344) -- i.e. it backs out our support for "-webkit-box-orient". This patch also adds "fails" annotations to two reftests that depend on that feature, to reflect reality that these tests are now expected to fail (for the moment). MozReview-Commit-ID: F8zGGg8R0Rn
layout/reftests/webkit-box/reftest.list
layout/style/nsCSSDataBlock.cpp
layout/style/nsCSSPropList.h
layout/style/nsCSSPropLogicalGroupList.h
layout/style/nsCSSProperty.h
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
layout/style/test/mochitest.ini
layout/style/test/property_database.js
layout/style/test/test_webkit_box_orient.html
--- a/layout/reftests/webkit-box/reftest.list
+++ b/layout/reftests/webkit-box/reftest.list
@@ -12,17 +12,17 @@ fails == webkit-box-anon-flex-items-2.ht
 fails == webkit-box-anon-flex-items-3.html webkit-box-anon-flex-items-3-ref.html
 
 # Tests for "-webkit-box" & "-webkit-inline-box" as display values:
 == webkit-display-values-1.html webkit-display-values-1-ref.html
 
 # Tests for "-webkit-box-align" (cross-axis alignment):
 == webkit-box-align-horiz-1a.html webkit-box-align-horiz-1-ref.html
 == webkit-box-align-horiz-1b.html webkit-box-align-horiz-1-ref.html
-== webkit-box-align-vert-1.html webkit-box-align-vert-1-ref.html
+fails == webkit-box-align-vert-1.html webkit-box-align-vert-1-ref.html # bug 1262049
 
 # Tests for "-webkit-box-flex" (flexibility of items)
 == webkit-box-flex-1.html webkit-box-flex-1-ref.html
 
 # Tests for "-webkit-box-ordinal-group"
 == webkit-box-ordinal-group-1.html webkit-box-ordinal-group-1-ref.html
 # XXXdholbert The following test fails because we accept "0" as a valid value
 # for -webkit-box-ordinal-group (unlike Chrome/Blink), because that's simply
@@ -30,9 +30,9 @@ fails == webkit-box-anon-flex-items-3.ht
 # matter in practice; it could only cause trouble if sites accidentally depend
 # on the "0" value being rejected.
 fails == webkit-box-ordinal-group-2.html webkit-box-ordinal-group-2-ref.html
 == webkit-box-ordinal-group-3.html webkit-box-ordinal-group-3-ref.html
 
 # Tests for "-webkit-box-pack" (main-axis alignment):
 == webkit-box-pack-horiz-1a.html webkit-box-pack-horiz-1-ref.html
 == webkit-box-pack-horiz-1b.html webkit-box-pack-horiz-1-ref.html
-== webkit-box-pack-vert-1.html webkit-box-pack-vert-1-ref.html
+fails == webkit-box-pack-vert-1.html webkit-box-pack-vert-1-ref.html # bug 1262049
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -9,17 +9,16 @@
  * declaration, and the code for expanding and compacting it
  */
 
 #include "nsCSSDataBlock.h"
 
 #include "CSSVariableImageTable.h"
 #include "mozilla/css/Declaration.h"
 #include "mozilla/css/ImageLoader.h"
-#include "mozilla/Maybe.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/WritingModes.h"
 #include "nsIDocument.h"
 #include "nsRuleData.h"
 #include "nsStyleContext.h"
 #include "nsStyleSet.h"
 
 using namespace mozilla;
@@ -36,60 +35,16 @@ MoveValue(nsCSSValue* aSource, nsCSSValu
 {
   bool changed = (*aSource != *aDest);
   aDest->~nsCSSValue();
   memcpy(aDest, aSource, sizeof(nsCSSValue));
   new (aSource) nsCSSValue();
   return changed;
 }
 
-/**
- * This function maps "-webkit-box-orient" values to "flex-direction" values,
- * for a given writing-mode (taken from aRuleData).
- *
- * Specifically:
- *  - If aBoxOrientVal is an enumerated value (representing a physical axis),
- * then we'll map it to the appropriate logical "flex-direction" value, using
- * the writing mode.  The converted value will be emplace()'d into in the
- * outparam aConvertedValStorage, and we'll return a pointer to that value.
- *  - Otherwise (e.g. if we have "inherit" or "initial"), we won't do any
- * mapping, and we'll directly return the passed-in aBoxOrientVal.
- *
- * Either way, the idea is that our caller can treat the returned value as if
- * it were a value for "flex-direction".
- */
-static const nsCSSValue*
-ConvertBoxOrientToFlexDirection(const nsCSSValue* aBoxOrientVal,
-                                const nsRuleData* aRuleData,
-                                Maybe<nsCSSValue>& aConvertedValStorage)
-{
-  MOZ_ASSERT(aBoxOrientVal, "expecting a non-null value to convert");
-  MOZ_ASSERT(aConvertedValStorage.isNothing(),
-             "expecting outparam for converted-value to be initially empty");
-
-  if (aBoxOrientVal->GetUnit() != eCSSUnit_Enumerated) {
-    // We probably have "inherit" or "initial" -- just return that & have the
-    // caller directly use it as a "flex-direction" value.
-    return aBoxOrientVal;
-  }
-
-  // OK, we have an enumerated value -- "horizontal" or "vertical".
-
-  WritingMode wm(aRuleData->mStyleContext);
-  // In a horizontal writing-mode, "horizontal" maps to "row".
-  // In a vertical writing-mode, "horizontal" maps to "column".
-  bool isRow = wm.IsVertical() !=
-    (aBoxOrientVal->GetIntValue() == NS_STYLE_BOX_ORIENT_HORIZONTAL);
-
-  aConvertedValStorage.emplace(isRow ? NS_STYLE_FLEX_DIRECTION_ROW :
-                                       NS_STYLE_FLEX_DIRECTION_COLUMN,
-                               eCSSUnit_Enumerated);
-  return aConvertedValStorage.ptr();
-}
-
 static bool
 ShouldIgnoreColors(nsRuleData *aRuleData)
 {
   return aRuleData->mLevel != SheetType::Agent &&
          aRuleData->mLevel != SheetType::User &&
          !aRuleData->mPresContext->UseDocumentColors();
 }
 
@@ -165,104 +120,76 @@ ShouldStartImageLoads(nsRuleData *aRuleD
   //      where we wouldn't have started the load initially, which makes
   //      which links are visited detectable to Web pages (see bug
   //      557287)
   return !aRuleData->mStyleContext->IsStyleIfVisited() &&
          nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_START_IMAGE_LOADS);
 }
 
 static void
-MapSinglePropertyInto(nsCSSProperty aSrcProp,
-                      const nsCSSValue* aSrcValue,
-                      nsCSSProperty aTargetProp,
-                      nsCSSValue* aTargetValue,
+MapSinglePropertyInto(nsCSSProperty aProp,
+                      const nsCSSValue* aValue,
+                      nsCSSValue* aTarget,
                       nsRuleData* aRuleData)
 {
-  MOZ_ASSERT(!nsCSSProps::PropHasFlags(aTargetProp, CSS_PROPERTY_LOGICAL),
-             "Can't map into a logical property");
-  MOZ_ASSERT(aSrcProp == aTargetProp ||
-             nsCSSProps::PropHasFlags(aSrcProp, CSS_PROPERTY_LOGICAL),
-             "Source & target property must be the same, except when we're "
-             "doing a logical-to-physical property mapping");
-  MOZ_ASSERT(aSrcValue->GetUnit() != eCSSUnit_Null, "oops");
+  MOZ_ASSERT(aValue->GetUnit() != eCSSUnit_Null, "oops");
 
-  // Handle logical properties that have custom value-mapping behavior:
-  Maybe<nsCSSValue> convertedVal; // storage for converted value, if needed
-  bool hasCustomValMapping =
-      nsCSSProps::PropHasFlags(aSrcProp,
-                               CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING);
-  if (hasCustomValMapping) {
-    if (aSrcProp == eCSSProperty_webkit_box_orient) {
-      aSrcValue = ConvertBoxOrientToFlexDirection(aSrcValue, aRuleData,
-                                                  convertedVal);
-    }
-  }
-
-  // Although aTargetValue is the nsCSSValue we are going to write into,
+  // Although aTarget is the nsCSSValue we are going to write into,
   // we also look at its value before writing into it.  This is done
-  // when aTargetValue is a token stream value, which is the case when we
+  // when aTarget is a token stream value, which is the case when we
   // have just re-parsed a property that had a variable reference (in
   // nsCSSParser::ParsePropertyWithVariableReferences).  TryToStartImageLoad
   // then records any resulting ImageValue objects in the
   // CSSVariableImageTable, to give them the appropriate lifetime.
-  MOZ_ASSERT(aTargetValue->GetUnit() == eCSSUnit_TokenStream ||
-             aTargetValue->GetUnit() == eCSSUnit_Null,
-             "aTargetValue must only be a token stream (when re-parsing "
+  MOZ_ASSERT(aTarget->GetUnit() == eCSSUnit_TokenStream ||
+             aTarget->GetUnit() == eCSSUnit_Null,
+             "aTarget must only be a token stream (when re-parsing "
              "properties with variable references) or null");
 
-  if (ShouldStartImageLoads(aRuleData, aTargetProp)) {
+  if (ShouldStartImageLoads(aRuleData, aProp)) {
     nsIDocument* doc = aRuleData->mPresContext->Document();
-    TryToStartImageLoad(*aSrcValue, doc, aRuleData->mStyleContext,
-                        aTargetProp,
-                        aTargetValue->GetUnit() == eCSSUnit_TokenStream);
+    TryToStartImageLoad(*aValue, doc, aRuleData->mStyleContext,
+                        aProp,
+                        aTarget->GetUnit() == eCSSUnit_TokenStream);
   }
-  *aTargetValue = *aSrcValue;
-  if (nsCSSProps::PropHasFlags(aTargetProp,
+  *aTarget = *aValue;
+  if (nsCSSProps::PropHasFlags(aProp,
         CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED) &&
       ShouldIgnoreColors(aRuleData))
   {
-    if (aTargetProp == eCSSProperty_background_color) {
+    if (aProp == eCSSProperty_background_color) {
       // Force non-'transparent' background
       // colors to the user's default.
-      if (aTargetValue->IsNonTransparentColor()) {
-        aTargetValue->SetColorValue(aRuleData->mPresContext->
-                                    DefaultBackgroundColor());
+      if (aTarget->IsNonTransparentColor()) {
+        aTarget->SetColorValue(aRuleData->mPresContext->
+                               DefaultBackgroundColor());
       }
     } else {
       // Ignore 'color', 'border-*-color', etc.
-      *aTargetValue = nsCSSValue();
+      *aTarget = nsCSSValue();
     }
   }
 }
 
 /**
- * If aProperty is a logical property, returns the equivalent physical
+ * If aProperty is a logical property, converts it to the equivalent physical
  * property based on writing mode information obtained from aRuleData's
  * style context.
  */
-static inline nsCSSProperty
-EnsurePhysicalProperty(nsCSSProperty aProperty, nsRuleData* aRuleData)
+static inline void
+EnsurePhysicalProperty(nsCSSProperty& aProperty, nsRuleData* aRuleData)
 {
-  if (!nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL)) {
-    return aProperty;
-  }
-
-  bool isSingleProperty =
-      nsCSSProps::PropHasFlags(aProperty,
-                               CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING);
   bool isAxisProperty =
     nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL_AXIS);
   bool isBlock =
     nsCSSProps::PropHasFlags(aProperty, CSS_PROPERTY_LOGICAL_BLOCK_AXIS);
 
   int index;
 
-  if (isSingleProperty) {
-    index = 0; // We always map to the same physical property.
-  } else if (isAxisProperty) {
+  if (isAxisProperty) {
     LogicalAxis logicalAxis = isBlock ? eLogicalAxisBlock : eLogicalAxisInline;
     uint8_t wm = aRuleData->mStyleContext->StyleVisibility()->mWritingMode;
     PhysicalAxis axis =
       WritingMode::PhysicalAxisForLogicalAxis(wm, logicalAxis);
 
     // We rely on physical axis constants values matching the order of the
     // physical properties in the logical group array.
     static_assert(eAxisVertical == 0 && eAxisHorizontal == 1,
@@ -290,20 +217,19 @@ EnsurePhysicalProperty(nsCSSProperty aPr
     // the physical properties in the logical group array.
     static_assert(NS_SIDE_TOP == 0 && NS_SIDE_RIGHT == 1 &&
                   NS_SIDE_BOTTOM == 2 && NS_SIDE_LEFT == 3,
                   "unexpected side constant values");
     index = side;
   }
 
   const nsCSSProperty* props = nsCSSProps::LogicalGroup(aProperty);
-  // Table-length is 1 for single prop, 2 for axis prop, 4 for block prop.
-  size_t len = isSingleProperty ? 1 : (isAxisProperty ? 2 : 4);
+  size_t len = isAxisProperty ? 2 : 4;
 #ifdef DEBUG
-  for (size_t i = 0; i < len; i++) {
+    for (size_t i = 0; i < len; i++) {
     MOZ_ASSERT(props[i] != eCSSProperty_UNKNOWN,
                "unexpected logical group length");
   }
   MOZ_ASSERT(props[len] == eCSSProperty_UNKNOWN,
              "unexpected logical group length");
 #endif
 
   for (size_t i = 0; i < len; i++) {
@@ -327,17 +253,17 @@ EnsurePhysicalProperty(nsCSSProperty aPr
       // data cached in the rule tree could be used with a style context
       // with a different value of the depended-upon data.
       uint8_t wm = WritingMode(aRuleData->mStyleContext).GetBits();
       aRuleData->mConditions.SetWritingModeDependency(wm);
       break;
     }
   }
 
-  return props[index];
+  aProperty = props[index];
 }
 
 void
 nsCSSCompressedDataBlock::MapRuleInfoInto(nsRuleData *aRuleData) const
 {
   // If we have no data for these structs, then return immediately.
   // This optimization should make us return most of the time, so we
   // have to worry much less (although still some) about the speed of
@@ -347,32 +273,32 @@ nsCSSCompressedDataBlock::MapRuleInfoInt
 
   // We process these in reverse order so that we end up mapping the
   // right property when one can be expressed using both logical and
   // physical property names.
   for (uint32_t i = mNumProps; i-- > 0; ) {
     nsCSSProperty iProp = PropertyAtIndex(i);
     if (nsCachedStyleData::GetBitForSID(nsCSSProps::kSIDTable[iProp]) &
         aRuleData->mSIDs) {
-      nsCSSProperty physicalProp = EnsurePhysicalProperty(iProp,
-                                                          aRuleData);
-      nsCSSValue* target = aRuleData->ValueFor(physicalProp);
+      if (nsCSSProps::PropHasFlags(iProp, CSS_PROPERTY_LOGICAL)) {
+        EnsurePhysicalProperty(iProp, aRuleData);
+      }
+      nsCSSValue* target = aRuleData->ValueFor(iProp);
       if (target->GetUnit() == eCSSUnit_Null) {
         const nsCSSValue *val = ValueAtIndex(i);
         // In order for variable resolution to have the right information
         // about the stylesheet level of a value, that level needs to be
         // stored on the token stream. We can't do that at creation time
         // because the CSS parser (which creates the object) has no idea
         // about the stylesheet level, so we do it here instead, where
         // the rule walking will have just updated aRuleData.
         if (val->GetUnit() == eCSSUnit_TokenStream) {
           val->GetTokenStreamValue()->mLevel = aRuleData->mLevel;
         }
-        MapSinglePropertyInto(iProp, val, physicalProp, target,
-                              aRuleData);
+        MapSinglePropertyInto(iProp, val, target, aRuleData);
       }
     }
   }
 }
 
 const nsCSSValue*
 nsCSSCompressedDataBlock::ValueFor(nsCSSProperty aProperty) const
 {
@@ -804,24 +730,27 @@ void
 nsCSSExpandedDataBlock::MapRuleInfoInto(nsCSSProperty aPropID,
                                         nsRuleData* aRuleData) const
 {
   MOZ_ASSERT(!nsCSSProps::IsShorthand(aPropID));
 
   const nsCSSValue* src = PropertyAt(aPropID);
   MOZ_ASSERT(src->GetUnit() != eCSSUnit_Null);
 
-  nsCSSProperty physicalProp = EnsurePhysicalProperty(aPropID, aRuleData);
+  nsCSSProperty physicalProp = aPropID;
+  if (nsCSSProps::PropHasFlags(aPropID, CSS_PROPERTY_LOGICAL)) {
+    EnsurePhysicalProperty(physicalProp, aRuleData);
+  }
 
   nsCSSValue* dest = aRuleData->ValueFor(physicalProp);
   MOZ_ASSERT(dest->GetUnit() == eCSSUnit_TokenStream &&
              dest->GetTokenStreamValue()->mPropertyID == aPropID);
 
   CSSVariableImageTable::ReplaceAll(aRuleData->mStyleContext, aPropID, [=] {
-    MapSinglePropertyInto(aPropID, src, physicalProp, dest, aRuleData);
+    MapSinglePropertyInto(physicalProp, src, dest, aRuleData);
   });
 }
 
 #ifdef DEBUG
 void
 nsCSSExpandedDataBlock::DoAssertInitialState()
 {
   mPropertiesSet.AssertIsEmpty("not initial state");
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -1325,32 +1325,16 @@ CSS_PROP_XUL(
     box_orient,
     CSS_PROP_DOMPROP_PREFIXED(BoxOrient),
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
     kBoxOrientKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None) // XXX bug 3935
-/* We treat -webkit-box-orient as a writing-mode-aware logical alias
- * for "flex-direction": */
-CSS_PROP_LOGICAL(
-    -webkit-box-orient,
-    webkit_box_orient,
-    WebkitBoxOrient,
-    CSS_PROPERTY_PARSE_VALUE |
-      CSS_PROPERTY_LOGICAL |
-      CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING,
-    "layout.css.prefixes.webkit",
-    VARIANT_HK,
-    kBoxOrientKTable,
-    WebkitBoxOrient,
-    Position,
-    CSS_PROP_NO_OFFSET,
-    eStyleAnimType_None)
 CSS_PROP_XUL(
     -moz-box-pack,
     box_pack,
     CSS_PROP_DOMPROP_PREFIXED(BoxPack),
     CSS_PROPERTY_PARSE_VALUE,
     "",
     VARIANT_HK,
     kBoxPackKTable,
--- a/layout/style/nsCSSPropLogicalGroupList.h
+++ b/layout/style/nsCSSPropLogicalGroupList.h
@@ -39,30 +39,18 @@
 //   CSS_PROP_LOGICAL_GROUP_AXIS(name_)
 //     Defines a logical property group whose corresponding physical
 //     properties are a set of two axis-related properties.  For
 //     example, the logical property group for {block,inline}-size
 //     contains the width and height properties.  A table must be
 //     defined in nCSSProps.cpp named g<name_>LogicalGroupTable
 //     containing the two physical properties in vertical/horizontal
 //     order, followed by an nsCSSProperty_UNKNOWN entry.
-//
-//   CSS_PROP_LOGICAL_GROUP_SINGLE(name_)
-//     Defines a logical property group in which the logical property always
-//     maps to the same physical property. For such properties, the
-//     "logicalness" is in the value-mapping, not in the property-mapping.  For
-//     example, the logical property "-webkit-box-orient" is always mapped to
-//     "flex-direction", but its values ("horizontal", "vertical") map to
-//     different flex-direction values ("row", "column") depending on the
-//     writing-mode.  A table must be defined in nsCSSProps.cpp named
-//     g<name_>LogicalGroupTable containing the one physical property,
-//     followed by an nsCSSProperty_UNKNOWN entry.
 
 CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderColor)
 CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderStyle)
 CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderWidth)
 CSS_PROP_LOGICAL_GROUP_SHORTHAND(Margin)
 CSS_PROP_LOGICAL_GROUP_AXIS(MaxSize)
 CSS_PROP_LOGICAL_GROUP_BOX(Offset)
 CSS_PROP_LOGICAL_GROUP_SHORTHAND(Padding)
 CSS_PROP_LOGICAL_GROUP_AXIS(MinSize)
 CSS_PROP_LOGICAL_GROUP_AXIS(Size)
-CSS_PROP_LOGICAL_GROUP_SINGLE(WebkitBoxOrient)
--- a/layout/style/nsCSSProperty.h
+++ b/layout/style/nsCSSProperty.h
@@ -98,21 +98,18 @@ enum nsCSSCounterDesc {
 };
 
 enum nsCSSPropertyLogicalGroup {
   eCSSPropertyLogicalGroup_UNKNOWN = -1,
 #define CSS_PROP_LOGICAL_GROUP_AXIS(name_) \
   eCSSPropertyLogicalGroup_##name_,
 #define CSS_PROP_LOGICAL_GROUP_BOX(name_) \
   eCSSPropertyLogicalGroup_##name_,
-#define CSS_PROP_LOGICAL_GROUP_SINGLE(name_) \
-  eCSSPropertyLogicalGroup_##name_,
 #define CSS_PROP_LOGICAL_GROUP_SHORTHAND(name_) \
   eCSSPropertyLogicalGroup_##name_,
 #include "nsCSSPropLogicalGroupList.h"
 #undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
-#undef CSS_PROP_LOGICAL_GROUP_SINGLE
 #undef CSS_PROP_LOGICAL_GROUP_BOX
 #undef CSS_PROP_LOGICAL_GROUP_AXIS
   eCSSPropertyLogicalGroup_COUNT
 };
 
 #endif /* nsCSSProperty_h___ */
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -3000,29 +3000,22 @@ static const nsCSSProperty gMinSizeLogic
 };
 
 static const nsCSSProperty gSizeLogicalGroupTable[] = {
   eCSSProperty_height,
   eCSSProperty_width,
   eCSSProperty_UNKNOWN
 };
 
-static const nsCSSProperty gWebkitBoxOrientLogicalGroupTable[] = {
-  eCSSProperty_flex_direction,
-  eCSSProperty_UNKNOWN
-};
-
 const nsCSSProperty* const
 nsCSSProps::kLogicalGroupTable[eCSSPropertyLogicalGroup_COUNT] = {
 #define CSS_PROP_LOGICAL_GROUP_SHORTHAND(id_) g##id_##SubpropTable,
 #define CSS_PROP_LOGICAL_GROUP_AXIS(name_) g##name_##LogicalGroupTable,
 #define CSS_PROP_LOGICAL_GROUP_BOX(name_) g##name_##LogicalGroupTable,
-#define CSS_PROP_LOGICAL_GROUP_SINGLE(name_) g##name_##LogicalGroupTable,
 #include "nsCSSPropLogicalGroupList.h"
-#undef CSS_PROP_LOGICAL_GROUP_SINGLE
 #undef CSS_PROP_LOGICAL_GROUP_BOX
 #undef CSS_PROP_LOGICAL_GROUP_AXIS
 #undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
 };
 
 // Mapping of logical longhand properties to their logical group (which
 // represents the physical longhands the logical properties an correspond
 // to).  The format is pairs of values, where the first is the logical
@@ -3313,44 +3306,27 @@ nsCSSProps::gPropertyUseCounter[eCSSProp
   static_assert(!((flags_) & CSS_PROPERTY_LOGICAL_AXIS),                    \
                 "only properties defined with CSS_PROP_LOGICAL can use "    \
                 "the CSS_PROPERTY_LOGICAL_AXIS flag");                      \
   static_assert(!((flags_) & CSS_PROPERTY_LOGICAL_BLOCK_AXIS),              \
                 "only properties defined with CSS_PROP_LOGICAL can use "    \
                 "the CSS_PROPERTY_LOGICAL_BLOCK_AXIS flag");                \
   static_assert(!((flags_) & CSS_PROPERTY_LOGICAL_END_EDGE),                \
                 "only properties defined with CSS_PROP_LOGICAL can use "    \
-                "the CSS_PROPERTY_LOGICAL_END_EDGE flag");                  \
-  static_assert(!((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING),\
-                "only properties defined with CSS_PROP_LOGICAL can use "    \
-                "the CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING flag");
+                "the CSS_PROPERTY_LOGICAL_END_EDGE flag");
 #define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, \
                          kwtable_, group_, stylestruct_,                    \
                          stylestructoffset_, animtype_)                     \
   static_assert((flags_) & CSS_PROPERTY_LOGICAL,                            \
                 "properties defined with CSS_PROP_LOGICAL must also use "   \
                 "the CSS_PROPERTY_LOGICAL flag");                           \
   static_assert(!((flags_) & CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED),    \
                 "CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED has no effect "  \
                 "on logical properties");                                   \
   static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_AXIS) &&                 \
                   ((flags_) & CSS_PROPERTY_LOGICAL_END_EDGE)),              \
                 "CSS_PROPERTY_LOGICAL_END_EDGE makes no sense when used "   \
-                "with CSS_PROPERTY_LOGICAL_AXIS");                          \
-  /* Make sure CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING isn't used */  \
-  /* with other mutually-exclusive flags: */                                \
-  static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_AXIS) &&                 \
-                  ((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING)),\
-                "CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING makes no "   \
-                "sense when used with CSS_PROPERTY_LOGICAL_AXIS");          \
-  static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_BLOCK_AXIS) &&           \
-                  ((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING)),\
-                "CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING makes no "   \
-                "sense when used with CSS_PROPERTY_LOGICAL_BLOCK_AXIS");    \
-  static_assert(!(((flags_) & CSS_PROPERTY_LOGICAL_END_EDGE) &&             \
-                  ((flags_) & CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING)),\
-                "CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING makes no "   \
-                "sense when used with CSS_PROPERTY_LOGICAL_END_EDGE");
+                "with CSS_PROPERTY_LOGICAL_AXIS");
 #include "nsCSSPropList.h"
 #undef CSS_PROP_LOGICAL
 #undef CSS_PROP
 
 #include "nsCSSPropsGenerated.inc"
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -245,48 +245,39 @@ static_assert((CSS_PROPERTY_PARSE_PROPER
 // This property is a logical property for the "end" edge of the
 // axis determined by the presence or absence of
 // CSS_PROPERTY_LOGICAL_BLOCK_AXIS (such as margin-block-end or
 // margin-inline-end).  Must only be set if CSS_PROPERTY_LOGICAL is set.
 // When not set, the logical property is for the "start" edge (such as
 // margin-block-start or margin-inline-start).
 #define CSS_PROPERTY_LOGICAL_END_EDGE             (1<<26)
 
-// This property is a logical property which always maps to the same physical
-// property, and its values have some custom processing when being mapped to
-// the physical property's values.  Must not be used in conjunction with
-// CSS_PROPERTY_LOGICAL_{AXIS,BLOCK_AXIS,END_EDGE}.
-#define CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING (1<<27)
-
 // This property can be animated on the compositor.
-#define CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR    (1<<28)
+#define CSS_PROPERTY_CAN_ANIMATE_ON_COMPOSITOR    (1<<27)
 
 // This property is an internal property that is not represented
 // in the DOM.  Properties with this flag must be defined in an #ifndef
 // CSS_PROP_LIST_EXCLUDE_INTERNAL section of nsCSSPropList.h.
-#define CSS_PROPERTY_INTERNAL                     (1<<29)
+#define CSS_PROPERTY_INTERNAL                     (1<<28)
 
 // This property has values that can establish a containing block for
 // fixed positioned and absolutely positioned elements.
 // This should be set for any properties that can cause an element to be
 // such a containing block, as implemented in
 // nsStyleDisplay::IsFixedPosContainingBlock.
-#define CSS_PROPERTY_FIXPOS_CB                    (1<<30)
+#define CSS_PROPERTY_FIXPOS_CB                    (1<<29)
 
 // This property has values that can establish a containing block for
 // absolutely positioned elements.
 // This should be set for any properties that can cause an element to be
 // such a containing block, as implemented in
 // nsStyleDisplay::IsAbsPosContainingBlock.
 // It does not need to be set for properties that also have
 // CSS_PROPERTY_FIXPOS_CB set.
-#define CSS_PROPERTY_ABSPOS_CB                    (1u<<31)
-
-// NOTE: Before adding any new CSS_PROPERTY_* flags here, we'll need to
-// upgrade kFlagsTable to 64-bits -- see bug 1231384.
+#define CSS_PROPERTY_ABSPOS_CB                    (1<<30)
 
 /**
  * Types of animatable values.
  */
 enum nsStyleAnimType {
   // requires a custom implementation in
   // StyleAnimationValue::ExtractComputedValue
   eStyleAnimType_Custom,
@@ -550,21 +541,18 @@ public:
    * the argument, which must be a logical longhand property.  The returned
    * array is terminated by an eCSSProperty_UNKNOWN value.  For example,
    * given eCSSProperty_margin_block_start, returns an array of the four
    * properties eCSSProperty_margin_top, eCSSProperty_margin_right,
    * eCSSProperty_margin_bottom and eCSSProperty_margin_left, followed
    * by the sentinel.
    *
    * When called with a property that has the CSS_PROPERTY_LOGICAL_AXIS
-   * flag, the returned array will have two values preceding the sentinel.
-   * When called with a property that has the
-   * CSS_PROPERTY_LOGICAL_SINGLE_CUSTOM_VALMAPPING flag, the returned array
-   * will have one value preceding the sentinel.
-   * Otherwise it will have four values preceding the sentinel.
+   * flag, the returned array will have two values preceding the sentinel;
+   * otherwise it will have four.
    *
    * (Note that the running time of this function is proportional to the
    * number of logical longhand properties that exist.  If we start
    * getting too many of these properties, we should make kLogicalGroupTable
    * be a simple array of eCSSProperty_COUNT length.)
    */
   static const nsCSSProperty* LogicalGroup(nsCSSProperty aProperty);
 
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -299,11 +299,10 @@ skip-if = buildapp == 'b2g' || toolkit =
 [test_visited_image_loading_empty.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, :visited support) b2g-debug(bug 870262, :visited support) b2g-desktop(bug 870262, :visited support)
 [test_visited_lying.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, :visited support) b2g-debug(bug 870262, :visited support) b2g-desktop(bug 870262, :visited support)
 [test_visited_pref.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, :visited support) b2g-debug(bug 870262, :visited support) b2g-desktop(bug 870262, :visited support)
 [test_visited_reftests.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT # b2g(bug 870262, :visited support) b2g-debug(bug 870262, :visited support) b2g-desktop(bug 870262, :visited support)
-[test_webkit_box_orient.html]
 [test_webkit_device_pixel_ratio.html]
 [test_asyncopen2.html]
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -4870,35 +4870,16 @@ function logical_box_prop_get_computed(c
     property = physicalize(property, blockMapping, "block-");
     property = physicalize(property, inlineMapping, "inline-");
   } else {
     throw "Unexpected property";
   }
   return cs.getPropertyValue(property);
 }
 
-// Helper to get computed style of "-webkit-box-orient" from "flex-direction"
-// and the "writing-mode".
-function webkit_orient_get_computed(cs, property)
-{
-  var writingMode = cs.getPropertyValue("writing-mode") || "horizontal-tb";
-
-  var mapping; // map from flex-direction values to -webkit-box-orient values.
-  if (writingMode == "horizontal-tb") {
-    // Horizontal writing-mode
-    mapping = { "row" : "horizontal", "column" : "vertical"};
-  } else {
-    // Vertical writing-mode
-    mapping = { "row" : "vertical",   "column" : "horizontal"};
-  }
-
-  var flexDirection = cs.getPropertyValue("flex-direction");
-  return mapping[flexDirection];
-}
-
 // Get the computed value for a property.  For shorthands, return the
 // computed values of all the subproperties, delimited by " ; ".
 function get_computed_value(cs, property)
 {
   var info = gCSSProperties[property];
   if (info.type == CSS_TYPE_TRUE_SHORTHAND ||
       (info.type == CSS_TYPE_SHORTHAND_AND_LONGHAND &&
         (property == "text-decoration" || property == "mask"))) {
@@ -7204,31 +7185,16 @@ if (IsCSSPropertyPrefEnabled("layout.css
   };
   gCSSProperties["-webkit-box-ordinal-group"] = {
     domProp: "webkitBoxOrdinalGroup",
     inherited: false,
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
     alias_for: "-moz-box-ordinal-group",
     subproperties: [ "-moz-box-ordinal-group" ],
   };
-  /* This one is not an alias - it's implemented as a logical property: */
-  gCSSProperties["-webkit-box-orient"] = {
-    domProp: "webkitBoxOrient",
-    inherited: false,
-    type: CSS_TYPE_LONGHAND,
-    logical: true,
-    get_computed: webkit_orient_get_computed,
-    initial_values: [ "horizontal" ],
-    other_values: [ "vertical" ],
-    invalid_values: [
-      "0", "0px", "auto",
-      /* Flex-direction values: */
-      "row", "column", "row-reverse", "column-reverse",
-    ],
-  };
   gCSSProperties["-webkit-box-align"] = {
     domProp: "webkitBoxAlign",
     inherited: false,
     type: CSS_TYPE_SHORTHAND_AND_LONGHAND,
     alias_for: "-moz-box-align",
     subproperties: [ "-moz-box-align" ],
   };
   gCSSProperties["-webkit-box-pack"] = {
deleted file mode 100644
--- a/layout/style/test/test_webkit_box_orient.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html>
-<meta charset=utf-8>
-<title>
-  Test the writing-mode-dependent mapping of '-webkit-box-orient' values to
-  'flex-direction' values, when emulating -webkit-box styles with modern flexbox
-</title>
-<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<div id="testDiv" style="display: none"></div>
-<script>
-// Mappings from "-webkit-box-orient" values to "flex-direction" values,
-// when writing-mode is horizontal:
-const horizMapping =
-  { "horizontal" : "row",
-    "vertical"   : "column" };
-
-// Same as above, but now when writing-mode is vertical:
-const vertMapping =
-  { "horizontal" : "column",
-    "vertical"   : "row" };
-
-const div = document.getElementById("testDiv");
-
-// Test the various writing-mode values:
-testWM("unset", horizMapping);
-testWM("horizontal-tb", horizMapping);
-testWM("vertical-lr", vertMapping);
-testWM("vertical-rl", vertMapping);
-testWM("sideways-lr", vertMapping);
-testWM("sideways-rl", vertMapping);
-
-/**
- * Main test function:
- * @param aWritingMode The writing-mode value to test.
- * @param aMapping Mapping from -webkit-box-orient values to equivalent
- *        flex-direction values, for this writing-mode.
- */
-function testWM(aWritingMode, aMapping) {
-  div.style.writingMode = aWritingMode;
-  for (var webkitBoxOrientVal in aMapping) {
-    div.style.webkitBoxOrient = webkitBoxOrientVal;
-    test(function() {
-      var expectedFlexDir = aMapping[webkitBoxOrientVal];
-      var actualFlexDir = window.getComputedStyle(div, "").flexDirection;
-      assert_equals(actualFlexDir, expectedFlexDir,
-                    "Testing the 'flex-direction' value produced by " +
-                    "'-webkit-box-orient:" + webkitBoxOrientVal + "'");
-    }, "Testing how '-webkit-box-orient' values influence 'flex-direction' " +
-       "in presence of 'writing-mode:" + aWritingMode + "'");
-  }
-}
-
-</script>