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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 2361373002: [css-grid] Clearing override sizes before running grid's layout logic. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 445
446 SubtreeLayoutScope layoutScope(*this); 446 SubtreeLayoutScope layoutScope(*this);
447 447
448 { 448 {
449 // LayoutState needs this deliberate scope to pop before updating scroll information (which 449 // LayoutState needs this deliberate scope to pop before updating scroll information (which
450 // may trigger relayout). 450 // may trigger relayout).
451 LayoutState state(*this, locationOffset()); 451 LayoutState state(*this, locationOffset());
452 452
453 LayoutSize previousSize = size(); 453 LayoutSize previousSize = size();
454 454
455 // We need to clear both own and containingBlock override sizes to ensur e we get the same
456 // result through consecutive layout calls.
457 if (!m_gridIsDirty) {
cbiesinger 2016/09/26 14:56:38 && (sizesLogicalWidthToFitContent(style()->width()
458 for (LayoutBox* child = firstChildBox(); child; child = child->nextS iblingBox()) {
459 if (child->isOutOfFlowPositioned())
cbiesinger 2016/09/26 14:56:38 || !hasOrthogonalFlow(child)
460 continue;
461 child->clearOverrideSize();
462 child->clearContainingBlockOverrideSize();
463 layoutScope.setChildNeedsLayout(child);
cbiesinger 2016/09/23 16:57:09 (I would use forceChildLayout() instead of this se
jfernandez 2016/09/23 18:47:22 I understand your point and I agree the current co
464 child->layoutIfNeeded();
svillar 2016/09/23 15:42:28 Why are you laying out the items even before placi
jfernandez 2016/09/23 18:47:22 Well, that code address issues related to subseque
465 }
466 }
467
455 updateLogicalWidth(); 468 updateLogicalWidth();
456 m_hasDefiniteLogicalHeight = hasDefiniteLogicalHeight(); 469 m_hasDefiniteLogicalHeight = hasDefiniteLogicalHeight();
457 470
458 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope); 471 TextAutosizer::LayoutScope textAutosizerLayoutScope(this, &layoutScope);
459 472
460 // TODO(svillar): we won't need to do this once the intrinsic width comp utation is isolated 473 // TODO(svillar): we won't need to do this once the intrinsic width comp utation is isolated
461 // from the LayoutGrid object state (it should not touch any attribute) (see crbug.com/627812) 474 // from the LayoutGrid object state (it should not touch any attribute) (see crbug.com/627812)
462 if (m_autoRepeatColumns && m_autoRepeatColumns != computeAutoRepeatTrack sCount(ForColumns, TrackSizing)) 475 if (m_autoRepeatColumns && m_autoRepeatColumns != computeAutoRepeatTrack sCount(ForColumns, TrackSizing))
463 dirtyGrid(); 476 dirtyGrid();
464 placeItemsOnGrid(TrackSizing); 477 placeItemsOnGrid(TrackSizing);
(...skipping 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2680 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2668 } 2681 }
2669 2682
2670 bool LayoutGrid::cachedHasDefiniteLogicalHeight() const 2683 bool LayoutGrid::cachedHasDefiniteLogicalHeight() const
2671 { 2684 {
2672 SECURITY_DCHECK(m_hasDefiniteLogicalHeight); 2685 SECURITY_DCHECK(m_hasDefiniteLogicalHeight);
2673 return m_hasDefiniteLogicalHeight.value(); 2686 return m_hasDefiniteLogicalHeight.value();
2674 } 2687 }
2675 2688
2676 } // namespace blink 2689 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/repeating-layout-must-produce-the-same-results.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698