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

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

Issue 2866663003: [css-grid] Performance optimization on the baseline-self alignment logic
Patch Set: Remove baseline logic from intrinsic sizing alg. Created 3 years, 7 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/GridTrackSizingAlgorithm.cpp ('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 9b70c14246c0977c6e1645927061b89b3aec95f0..3706e215f898145afc3903a1d4c54315eb8b7e43 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -331,7 +331,7 @@ void LayoutGrid::UpdateBlockLayout(bool relayout_children) {
// logic. Hence, items located at fixed or flexible tracks can't
// resolve correctly their size at this stage, which may lead to
// an incorrect computation of their shared context's baseline.
- ComputeBaselineAlignmentContext();
+ // ComputeBaselineAlignmentContext();
// 3- If the min-content contribution of any grid items have changed based
// on the row sizes calculated in step 2, steps 1 and 2 are repeated with
@@ -2133,10 +2133,12 @@ LayoutUnit LayoutGrid::ColumnAxisOffsetForChild(const LayoutBox& child) const {
LayoutUnit start_position = start_of_row + MarginBeforeForChild(child);
if (HasAutoMarginsInColumnAxis(child))
return start_position;
+ if (IsBaselineAlignmentForChild(child, kGridColumnAxis))
+ start_position += ColumnAxisBaselineOffsetForChild(child);
GridAxisPosition axis_position = ColumnAxisPositionForChild(child);
switch (axis_position) {
case kGridAxisStart:
- return start_position + ColumnAxisBaselineOffsetForChild(child);
+ return start_position;
case kGridAxisEnd:
case kGridAxisCenter: {
size_t child_end_line = rows_span.EndLine();
@@ -2175,10 +2177,12 @@ LayoutUnit LayoutGrid::RowAxisOffsetForChild(const LayoutBox& child) const {
LayoutUnit start_position = start_of_column + MarginStartForChild(child);
if (HasAutoMarginsInRowAxis(child))
return start_position;
+ if (IsBaselineAlignmentForChild(child, kGridRowAxis))
+ start_position += RowAxisBaselineOffsetForChild(child);
GridAxisPosition axis_position = RowAxisPositionForChild(child);
switch (axis_position) {
case kGridAxisStart:
- return start_position + RowAxisBaselineOffsetForChild(child);
+ return start_position;
case kGridAxisEnd:
case kGridAxisCenter: {
size_t child_end_line = columns_span.EndLine();
« no previous file with comments | « third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698