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

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

Issue 1954683002: Revert of [css-grid] Fix definite/indefinite size detection for abspos elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/positioned-grid-container-percentage-tracks.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) 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, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. 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 4127 matching lines...) Expand 10 before | Expand all | Expand 10 after
4138 const LayoutBox* box = &layoutBox; 4138 const LayoutBox* box = &layoutBox;
4139 while (!box->isLayoutView() && !box->isOutOfFlowPositioned() 4139 while (!box->isLayoutView() && !box->isOutOfFlowPositioned()
4140 && (box->style()->logicalWidth().isAuto() || box->isAnonymousBlock()) 4140 && (box->style()->logicalWidth().isAuto() || box->isAnonymousBlock())
4141 && !box->hasOverrideContainingBlockLogicalWidth()) 4141 && !box->hasOverrideContainingBlockLogicalWidth())
4142 box = box->containingBlock(); 4142 box = box->containingBlock();
4143 4143
4144 if (box->style()->logicalWidth().isFixed()) 4144 if (box->style()->logicalWidth().isFixed())
4145 return true; 4145 return true;
4146 if (box->isLayoutView()) 4146 if (box->isLayoutView())
4147 return true; 4147 return true;
4148 if (box->isOutOfFlowPositioned() && !box->style()->logicalLeft().isAuto() && !box->style()->logicalRight().isAuto()) 4148 // The size of the containing block of an absolutely positioned element is a lways definite with respect to that
4149 // element (http://dev.w3.org/csswg/css-sizing-3/#definite).
4150 if (box->isOutOfFlowPositioned())
4149 return true; 4151 return true;
4150 if (box->hasOverrideContainingBlockLogicalWidth()) 4152 if (box->hasOverrideContainingBlockLogicalWidth())
4151 return box->overrideContainingBlockContentLogicalWidth() != -1; 4153 return box->overrideContainingBlockContentLogicalWidth() != -1;
4152 if (box->style()->logicalWidth().hasPercent()) 4154 if (box->style()->logicalWidth().hasPercent())
4153 return logicalWidthIsResolvable(*box->containingBlock()); 4155 return logicalWidthIsResolvable(*box->containingBlock());
4154 4156
4155 return false; 4157 return false;
4156 } 4158 }
4157 4159
4158 bool LayoutBox::hasDefiniteLogicalWidth() const 4160 bool LayoutBox::hasDefiniteLogicalWidth() const
4159 { 4161 {
4160 return logicalWidthIsResolvable(*this); 4162 return logicalWidthIsResolvable(*this);
4161 } 4163 }
4162 4164
4163 bool LayoutBox::percentageLogicalHeightIsResolvable() const 4165 bool LayoutBox::percentageLogicalHeightIsResolvable() const
4164 { 4166 {
4165 Length fakeLength(100, Percent); 4167 Length fakeLength(100, Percent);
4166 return computePercentageLogicalHeight(fakeLength) != -1; 4168 return computePercentageLogicalHeight(fakeLength) != -1;
4167 } 4169 }
4168 4170
4169 bool LayoutBox::hasDefiniteLogicalHeight() const 4171 bool LayoutBox::hasDefiniteLogicalHeight() const
4170 { 4172 {
4171 const Length& logicalHeight = style()->logicalHeight(); 4173 const Length& logicalHeight = style()->logicalHeight();
4174 if (logicalHeight.isIntrinsicOrAuto())
4175 return false;
4172 if (logicalHeight.isFixed()) 4176 if (logicalHeight.isFixed())
4173 return true; 4177 return true;
4174 if (isOutOfFlowPositioned() && !style()->logicalTop().isAuto() && !style()-> logicalBottom().isAuto()) 4178 // The size of the containing block of an absolutely positioned element is a lways definite with respect to that
4179 // element (http://dev.w3.org/csswg/css-sizing-3/#definite).
4180 if (isOutOfFlowPositioned())
4175 return true; 4181 return true;
4176 if (hasOverrideContainingBlockLogicalHeight()) 4182 if (hasOverrideContainingBlockLogicalHeight())
4177 return overrideContainingBlockContentLogicalHeight() != -1; 4183 return overrideContainingBlockContentLogicalHeight() != -1;
4178 if (logicalHeight.isIntrinsicOrAuto())
4179 return false;
4180 4184
4181 return percentageLogicalHeightIsResolvable(); 4185 return percentageLogicalHeightIsResolvable();
4182 } 4186 }
4183 4187
4184 bool LayoutBox::hasUnsplittableScrollingOverflow() const 4188 bool LayoutBox::hasUnsplittableScrollingOverflow() const
4185 { 4189 {
4186 // We will paginate as long as we don't scroll overflow in the pagination di rection. 4190 // We will paginate as long as we don't scroll overflow in the pagination di rection.
4187 bool isHorizontal = isHorizontalWritingMode(); 4191 bool isHorizontal = isHorizontalWritingMode();
4188 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf lowX())) 4192 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf lowX()))
4189 return false; 4193 return false;
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
4699 4703
4700 void LayoutBox::clearPercentHeightDescendants() 4704 void LayoutBox::clearPercentHeightDescendants()
4701 { 4705 {
4702 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4706 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4703 if (curr->isBox()) 4707 if (curr->isBox())
4704 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4708 toLayoutBox(curr)->removeFromPercentHeightContainer();
4705 } 4709 }
4706 } 4710 }
4707 4711
4708 } // namespace blink 4712 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/positioned-grid-container-percentage-tracks.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698