зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1174003 part 11: [css-flexbox] Remove IsCrossAxisHorizontal(), and make IsMainAxisHorizontal() a private implementation detail. r=mats
At this point in the series: - AxisOrientationTracker::IsCrossAxisHorizontal() has zero callers, so it can be deleted. - AxisOrientationTracker::IsMainAxisHorizontal() only has two callers, and both are inside its own class. So it's effectively become an implementation detail of its class, and it can be made private. (I'm not entirely removing it, because it does make its two callers more readable. The callers are working with a physical-axis-dependent type, 'LayoutDeviceIntSize', which comes from an API that isn't logical-axis-friendly, "GetMinimumWidgetSize", so they're not easily logicalized. So: it's nice to keep IsMainAxisHorizontal() around as an internal convenience method to tell us whether to extract the width or height inside of these two specific methods. But we don't want to introduce more callers, so let's leave it around & make it private.) MozReview-Commit-ID: 1iz1e52NmxV --HG-- extra : rebase_source : e8e92bbaadb5b8e636bd1dda79cb0041ce36a2ea
This commit is contained in:
Родитель
6c3de63544
Коммит
d9da77e5f9
|
@ -294,16 +294,6 @@ public:
|
|||
// XXXdholbert [BEGIN DEPRECATED]
|
||||
AxisOrientationType GetMainAxis() const { return mMainAxis; }
|
||||
AxisOrientationType GetCrossAxis() const { return mCrossAxis; }
|
||||
|
||||
bool IsMainAxisHorizontal() const {
|
||||
// If we're row-oriented, and our writing mode is NOT vertical,
|
||||
// or we're column-oriented and our writing mode IS vertical,
|
||||
// then our main axis is horizontal. This handles all cases:
|
||||
return mIsRowOriented != mWM.IsVertical();
|
||||
}
|
||||
bool IsCrossAxisHorizontal() const {
|
||||
return !IsMainAxisHorizontal();
|
||||
}
|
||||
// XXXdholbert [END DEPRECATED]
|
||||
|
||||
// Returns the flex container's writing mode.
|
||||
|
@ -412,6 +402,15 @@ private:
|
|||
FlexboxAxisTracker(const FlexboxAxisTracker&) = delete;
|
||||
FlexboxAxisTracker& operator=(const FlexboxAxisTracker&) = delete;
|
||||
|
||||
// Private because callers shouldn't need to care about physical axes
|
||||
// (but we do internally, to provide one API).
|
||||
bool IsMainAxisHorizontal() const {
|
||||
// If we're row-oriented, and our writing mode is NOT vertical,
|
||||
// or we're column-oriented and our writing mode IS vertical,
|
||||
// then our main axis is horizontal. This handles all cases:
|
||||
return mIsRowOriented != mWM.IsVertical();
|
||||
}
|
||||
|
||||
// Helpers for constructor which determine the orientation of our axes, based
|
||||
// on legacy box properties (-webkit-box-orient, -webkit-box-direction) or
|
||||
// modern flexbox properties (flex-direction, flex-wrap) depending on whether
|
||||
|
|
Загрузка…
Ссылка в новой задаче