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

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: Use 2 lines for bool includeBorderPadding Created 4 years, 5 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 return nullptr; 550 return nullptr;
551 551
552 if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && !c b->style()->logicalBottom().isAuto()) 552 if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && !c b->style()->logicalBottom().isAuto())
553 return nullptr; 553 return nullptr;
554 554
555 return cb; 555 return cb;
556 } 556 }
557 557
558 bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool che ckingContainingBlock) const 558 bool LayoutBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight(bool che ckingContainingBlock) const
559 { 559 {
560 // TODO(rego): Check if we can somehow reuse LayoutBlock::availableLogicalHe ightForPercentageComputation().
560 const LayoutBox* thisBox = isBox() ? toLayoutBox(this) : nullptr; 561 const LayoutBox* thisBox = isBox() ? toLayoutBox(this) : nullptr;
561 Length logicalHeightLength = style()->logicalHeight(); 562 Length logicalHeightLength = style()->logicalHeight();
562 LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeightLength) ; 563 LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeightLength) ;
563 if (logicalHeightLength.hasPercent() && cb && isBox()) 564 if (logicalHeightLength.hasPercent() && cb && isBox())
564 cb->addPercentHeightDescendant(const_cast<LayoutBox*>(toLayoutBox(this)) ); 565 cb->addPercentHeightDescendant(const_cast<LayoutBox*>(toLayoutBox(this)) );
565 if (thisBox && thisBox->isFlexItem()) { 566 if (thisBox && thisBox->isFlexItem()) {
566 LayoutFlexibleBox& flexBox = toLayoutFlexibleBox(*parent()); 567 LayoutFlexibleBox& flexBox = toLayoutFlexibleBox(*parent());
567 if (flexBox.childLogicalHeightForPercentageResolution(*thisBox) != Layou tUnit(-1)) 568 if (flexBox.childLogicalHeightForPercentageResolution(*thisBox) != Layou tUnit(-1))
568 return false; 569 return false;
569 } 570 }
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 if (rootElementStyle->hasBackground()) 1135 if (rootElementStyle->hasBackground())
1135 return false; 1136 return false;
1136 1137
1137 if (node() != document().firstBodyElement()) 1138 if (node() != document().firstBodyElement())
1138 return false; 1139 return false;
1139 1140
1140 return true; 1141 return true;
1141 } 1142 }
1142 1143
1143 } // namespace blink 1144 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698