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

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

Issue 2471283004: [css-grid] Fix simplified layout of positioned grid items (Closed)
Patch Set: Created 4 years, 1 month 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
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 // more specific condition to detect whether child's min-content contribution 465 // more specific condition to detect whether child's min-content contribution
466 // has changed or not. 466 // has changed or not.
467 if (m_hasAnyOrthogonalChildren) { 467 if (m_hasAnyOrthogonalChildren) {
468 computeTrackSizesForDefiniteSize(ForColumns, sizingData, 468 computeTrackSizesForDefiniteSize(ForColumns, sizingData,
469 availableSpaceForColumns); 469 availableSpaceForColumns);
470 computeTrackSizesForDefiniteSize(ForRows, sizingData, 470 computeTrackSizesForDefiniteSize(ForRows, sizingData,
471 availableSpaceForRows); 471 availableSpaceForRows);
472 } 472 }
473 } 473 }
474 474
475 bool LayoutGrid::simplifiedLayout() {
476 // This is a way to protect simplifiedLayout(), as we cannot perform it
477 // on a dirty grid that has positioned items to be layout.
478 if (m_gridIsDirty && posChildNeedsLayout())
479 return false;
480
481 return LayoutBlock::simplifiedLayout();
482 }
483
475 void LayoutGrid::layoutBlock(bool relayoutChildren) { 484 void LayoutGrid::layoutBlock(bool relayoutChildren) {
476 ASSERT(needsLayout()); 485 ASSERT(needsLayout());
477 486
478 if (!relayoutChildren && simplifiedLayout()) 487 if (!relayoutChildren && simplifiedLayout())
479 return; 488 return;
480 489
481 SubtreeLayoutScope layoutScope(*this); 490 SubtreeLayoutScope layoutScope(*this);
482 491
483 { 492 {
484 // LayoutState needs this deliberate scope to pop before updating scroll 493 // LayoutState needs this deliberate scope to pop before updating scroll
(...skipping 2951 matching lines...) Expand 10 before | Expand all | Expand 10 after
3436 if (!m_gridItemArea.isEmpty()) 3445 if (!m_gridItemArea.isEmpty())
3437 GridPainter(*this).paintChildren(paintInfo, paintOffset); 3446 GridPainter(*this).paintChildren(paintInfo, paintOffset);
3438 } 3447 }
3439 3448
3440 bool LayoutGrid::cachedHasDefiniteLogicalHeight() const { 3449 bool LayoutGrid::cachedHasDefiniteLogicalHeight() const {
3441 SECURITY_DCHECK(m_hasDefiniteLogicalHeight); 3450 SECURITY_DCHECK(m_hasDefiniteLogicalHeight);
3442 return m_hasDefiniteLogicalHeight.value(); 3451 return m_hasDefiniteLogicalHeight.value();
3443 } 3452 }
3444 3453
3445 } // namespace blink 3454 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698