Bug 1148298 part 4: Convert flexbox helper-function IsAxisHorizontal() to be a private implementation detail of FlexboxAxisTracker. r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 27 Mar 2015 12:06:03 -0700
changeset 265126 e0e18a7b4e5d50faa5a2187d814012e943f71b1e
parent 265125 fff94cb6ddf49d154a064f6be1f2f233eb874ee8
child 265127 52c1155d7bff4dba1b5e53bdb07f62767ad1daef
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1148298
milestone39.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 1148298 part 4: Convert flexbox helper-function IsAxisHorizontal() to be a private implementation detail of FlexboxAxisTracker. r=mats
layout/generic/nsFlexContainerFrame.cpp
--- a/layout/generic/nsFlexContainerFrame.cpp
+++ b/layout/generic/nsFlexContainerFrame.cpp
@@ -90,23 +90,16 @@ kAxisOrientationToSidesMap[eNumAxisOrien
 // Indicates whether advancing along the given axis is equivalent to
 // increasing our X or Y position (as opposed to decreasing it).
 static inline bool
 AxisGrowsInPositiveDirection(AxisOrientationType aAxis)
 {
   return eAxis_LR == aAxis || eAxis_TB == aAxis;
 }
 
-// Indicates whether the given axis is horizontal.
-static inline bool
-IsAxisHorizontal(AxisOrientationType aAxis)
-{
-  return eAxis_LR == aAxis || eAxis_RL == aAxis;
-}
-
 // Given an AxisOrientationType, returns the "reverse" AxisOrientationType
 // (in the same dimension, but the opposite direction)
 static inline AxisOrientationType
 GetReverseAxis(AxisOrientationType aAxis)
 {
   AxisOrientationType reversedAxis;
 
   if (aAxis % 2 == 0) {
@@ -250,16 +243,24 @@ public:
   // (We may reverse the axes in the FlexboxAxisTracker constructor and set
   // this flag, to avoid reflowing our children in bottom-to-top order.)
   bool AreAxesInternallyReversed() const
   {
     return mAreAxesInternallyReversed;
   }
 
 private:
+  // Indicates whether the given AxisOrientationType is horizontal.
+  // XXXdholbert This is private so that callers outside of FlexboxAxisTracker
+  // don't depend on it. This lets us move away from AxisOrientationType to a
+  // logical-axis-relative representation more seamlessly.
+  static inline bool IsAxisHorizontal(AxisOrientationType aAxis) {
+    return eAxis_LR == aAxis || eAxis_RL == aAxis;
+  }
+
   AxisOrientationType mMainAxis;
   AxisOrientationType mCrossAxis;
   bool mAreAxesInternallyReversed;
 };
 
 /**
  * Represents a flex item.
  * Includes the various pieces of input that the Flexbox Layout Algorithm uses