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

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

Issue 2154593003: [css-grid] Fix indefinite height detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check skipContainingBlockForPercentHeightCalculation() 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 return nullptr; 520 return nullptr;
521 521
522 if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && !c b->style()->logicalBottom().isAuto()) 522 if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && !c b->style()->logicalBottom().isAuto())
523 return nullptr; 523 return nullptr;
524 524
525 return cb; 525 return cb;
526 } 526 }
527 527
528 bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool che ckingContainingBlock) const 528 bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool che ckingContainingBlock) const
529 { 529 {
530 // TODO(rego): Check if we can somehow reuse LayoutBlock::availableLogicalHe ightForPercentageComputation() (see http://crbug.com/635655).
530 const LayoutBox* thisBox = isBox() ? toLayoutBox(this) : nullptr; 531 const LayoutBox* thisBox = isBox() ? toLayoutBox(this) : nullptr;
531 Length logicalHeightLength = style()->logicalHeight(); 532 Length logicalHeightLength = style()->logicalHeight();
532 LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeightLength) ; 533 LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeightLength) ;
533 if (logicalHeightLength.hasPercent() && cb && isBox()) 534 if (logicalHeightLength.hasPercent() && cb && isBox())
534 cb->addPercentHeightDescendant(const_cast<LayoutBox*>(toLayoutBox(this)) ); 535 cb->addPercentHeightDescendant(const_cast<LayoutBox*>(toLayoutBox(this)) );
535 if (thisBox && thisBox->isFlexItem()) { 536 if (thisBox && thisBox->isFlexItem()) {
536 LayoutFlexibleBox& flexBox = toLayoutFlexibleBox(*parent()); 537 LayoutFlexibleBox& flexBox = toLayoutFlexibleBox(*parent());
537 if (flexBox.childLogicalHeightForPercentageResolution(*thisBox) != Layou tUnit(-1)) 538 if (flexBox.childLogicalHeightForPercentageResolution(*thisBox) != Layou tUnit(-1))
538 return false; 539 return false;
539 } 540 }
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 if (rootElementStyle->hasBackground()) 1106 if (rootElementStyle->hasBackground())
1106 return false; 1107 return false;
1107 1108
1108 if (node() != document().firstBodyElement()) 1109 if (node() != document().firstBodyElement())
1109 return false; 1110 return false;
1110 1111
1111 return true; 1112 return true;
1112 } 1113 }
1113 1114
1114 } // namespace blink 1115 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698