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

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

Issue 2176633002: [css-grid] Avoid the HashMap for the override containing block size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/LayoutGrid.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/LayoutGrid.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index e9d00961ae56359570e6530bdc8e647c2c108593..e055a8bd24bd63a9140b6e12ec14b54c0e3e9927 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1825,20 +1825,6 @@ void LayoutGrid::applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection
availableSpace = LayoutUnit();
}
-bool LayoutGrid::isChildOverflowingContainingBlockHeight(const LayoutBox& child) const
-{
- // TODO (lajava) We must consider margins to determine whether it overflows or not (see https://crbug/628155)
- LayoutUnit containingBlockContentHeight = child.hasOverrideContainingBlockHeight() ? child.overrideContainingBlockContentHeight() : LayoutUnit();
- return child.size().height() > containingBlockContentHeight;
-}
-
-bool LayoutGrid::isChildOverflowingContainingBlockWidth(const LayoutBox& child) const
-{
- // TODO (lajava) We must consider margins to determine whether it overflows or not (see https://crbug/628155)
- LayoutUnit containingBlockContentWidth = child.hasOverrideContainingBlockWidth() ? child.overrideContainingBlockContentWidth() : LayoutUnit();
- return child.size().width() > containingBlockContentWidth;
-}
-
void LayoutGrid::layoutGridItems(GridSizingData& sizingData)
{
populateGridPositionsForDirection(sizingData, ForColumns);
@@ -1884,10 +1870,12 @@ void LayoutGrid::layoutGridItems(GridSizingData& sizingData)
#endif
child->setLogicalLocation(findChildLogicalPosition(*child, sizingData));
- // Keep track of children overflowing their grid area as we might need to paint them even if the grid-area is
- // not visible.
+ // Keep track of children overflowing their grid area as we might need to paint them even if the grid-area is not visible.
// Using physical dimensions for simplicity, so we can forget about orthogonalty.
- if (isChildOverflowingContainingBlockHeight(*child) || isChildOverflowingContainingBlockWidth(*child))
+ // TODO (lajava): Child's margins should account when evaluating whether it overflows its grid area (http://crbug.com/628155).
+ LayoutUnit childGridAreaHeight = isHorizontalWritingMode() ? overrideContainingBlockContentLogicalHeight : overrideContainingBlockContentLogicalWidth;
+ LayoutUnit childGridAreaWidth = isHorizontalWritingMode() ? overrideContainingBlockContentLogicalWidth : overrideContainingBlockContentLogicalHeight;
+ if (child->size().height() > childGridAreaHeight || child->size().width() > childGridAreaWidth)
m_gridItemsOverflowingGridArea.append(child);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutGrid.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698