Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(605)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 2411943002: [css-flexbox] Don't force layout for overflow: auto anymore (Closed)
Patch Set: further simplify & add comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index cd218d051f141b11e65b109f727bc02fe4f3720e..1bd0dd8e32c79c83e9a87c6d5f081f2bf65631ce 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -895,15 +895,6 @@ bool LayoutFlexibleBox::crossAxisLengthIsDefinite(const LayoutBox& child,
return length.isFixed();
}
-bool LayoutFlexibleBox::childFlexBaseSizeRequiresLayout(
- const LayoutBox& child) const {
- return (!mainAxisLengthIsDefinite(child, flexBasisForChild(child)) &&
- (hasOrthogonalFlow(child) ||
- (crossAxisOverflowForChild(child) == OverflowAuto &&
- !PaintLayerScrollableArea::FreezeScrollbarsScope::
- scrollbarsAreFrozen())));
-}
-
void LayoutFlexibleBox::cacheChildMainSize(const LayoutBox& child) {
DCHECK(!child.needsLayout());
LayoutUnit mainSize;
@@ -944,8 +935,11 @@ LayoutUnit LayoutFlexibleBox::computeInnerFlexBaseSizeForChild(
if (child.styleRef().containsSize())
return LayoutUnit();
+ // The flex basis is indefinite (=auto), so we need to compute the actual
+ // width of the child. For the logical width axis we just use the preferred
+ // width; for the height we need to lay out the child.
LayoutUnit mainAxisExtent;
- if (childFlexBaseSizeRequiresLayout(child)) {
+ if (hasOrthogonalFlow(child)) {
if (childLayoutType == NeverLayout)
return LayoutUnit();
@@ -958,11 +952,8 @@ LayoutUnit LayoutFlexibleBox::computeInnerFlexBaseSizeForChild(
}
mainAxisExtent = m_intrinsicSizeAlongMainAxis.get(&child);
} else {
- // We don't need to add scrollbarLogicalWidth here. For overflow: scroll,
- // the preferred width already includes the scrollbar size (via
- // scrollbarLogicalWidth()). For overflow: auto,
- // childFlexBaseSizeRequiresLayout returns true and we handle that via the
- // other branch of this if.
+ // We don't need to add scrollbarLogicalWidth here because the preferred
+ // width includes the scrollbar, even for overflow: auto.
mainAxisExtent = child.maxPreferredLogicalWidth();
}
DCHECK_GE(mainAxisExtent - mainAxisBorderAndPadding, LayoutUnit())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698