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

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

Issue 2834473003: [css-grid] Preemptively store intrinsic sizes during layout (Closed)
Patch Set: More tests Created 3 years, 8 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
Index: third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
diff --git a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
index 18afadb4cf4d9510c83e96991ab99b4c885d8c33..605738b48c0ee62416713f234e56380b6faf5d39 100644
--- a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
+++ b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
@@ -4,7 +4,6 @@
#include "core/layout/GridTrackSizingAlgorithm.h"
-#include "core/frame/FrameView.h"
#include "core/layout/Grid.h"
#include "core/layout/LayoutGrid.h"
#include "platform/LengthFunctions.h"
@@ -279,7 +278,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::LogicalHeightForChild(
if (ShouldClearOverrideContainingBlockContentSizeForChild(child, kForRows)) {
SetOverrideContainingBlockContentSizeForChild(child, child_block_direction,
LayoutUnit(-1));
- SetGridItemNeedsLayout(child);
+ child.SetNeedsLayout(LayoutInvalidationReason::kGridChanged, kMarkOnlyThis);
}
// We need to clear the stretched height to properly compute logical height
@@ -338,7 +337,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::MinContentForChild(
if (UpdateOverrideContainingBlockContentSizeForChild(child,
child_inline_direction))
- SetGridItemNeedsLayout(child);
+ child.SetNeedsLayout(LayoutInvalidationReason::kGridChanged, kMarkOnlyThis);
return LogicalHeightForChild(child);
}
@@ -369,7 +368,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::MaxContentForChild(
if (UpdateOverrideContainingBlockContentSizeForChild(child,
child_inline_direction))
- SetGridItemNeedsLayout(child);
+ child.SetNeedsLayout(LayoutInvalidationReason::kGridChanged, kMarkOnlyThis);
return LogicalHeightForChild(child);
}
@@ -432,17 +431,6 @@ void GridTrackSizingAlgorithmStrategy::DistributeSpaceToTracks(
available_logical_space);
}
-void GridTrackSizingAlgorithmStrategy::SetGridItemNeedsLayout(
- LayoutBox& grid_item) const {
- // Mac code can call computIntrinsicLogicalWidths() after the layout in
- // content::RenderViewImpl::didUpdateLayout().
- if (!GetLayoutGrid()->GetDocument().View()->IsInPerformLayout())
- return;
-
- grid_item.SetNeedsLayout(LayoutInvalidationReason::kGridChanged,
- kMarkOnlyThis);
-}
-
LayoutUnit DefiniteSizeStrategy::MinLogicalWidthForChild(
LayoutBox& child,
Length child_min_size,
@@ -461,7 +449,7 @@ void DefiniteSizeStrategy::LayoutGridItemForMinSizeComputation(
LayoutBox& child,
bool override_size_has_changed) const {
if (override_size_has_changed)
- SetGridItemNeedsLayout(child);
+ child.SetNeedsLayout(LayoutInvalidationReason::kGridChanged, kMarkOnlyThis);
child.LayoutIfNeeded();
}
@@ -512,7 +500,7 @@ void IndefiniteSizeStrategy::LayoutGridItemForMinSizeComputation(
LayoutBox& child,
bool override_size_has_changed) const {
if (override_size_has_changed && Direction() != kForColumns)
- SetGridItemNeedsLayout(child);
+ child.SetNeedsLayout(LayoutInvalidationReason::kGridChanged, kMarkOnlyThis);
child.LayoutIfNeeded();
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.h ('k') | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698