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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 906323003: [CSS Grid Layout] Columns set in percentages collapse to auto width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sergio-indefinite
Patch Set: Created 5 years, 10 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 | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderGrid.h » ('j') | 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 4176 matching lines...) Expand 10 before | Expand all | Expand 10 after
4187 return; 4187 return;
4188 4188
4189 if (!hasVisualOverflow() && contentsVisualOverflowRect().isEmpty()) { 4189 if (!hasVisualOverflow() && contentsVisualOverflowRect().isEmpty()) {
4190 clearAllOverflows(); 4190 clearAllOverflows();
4191 return; 4191 return;
4192 } 4192 }
4193 4193
4194 m_overflow->setLayoutOverflow(noOverflowRect()); 4194 m_overflow->setLayoutOverflow(noOverflowRect());
4195 } 4195 }
4196 4196
4197 bool RenderBox::logicalWidthIsResolvableFromBlock(const RenderBlock* containingB lock)
4198 {
4199 const RenderBlock* cb = containingBlock;
4200 while (!cb->isRenderView() && !cb->isOutOfFlowPositioned() && (cb->style()-> logicalWidth().isAuto() || cb->isAnonymousBlock()))
4201 cb = cb->containingBlock();
4202 // Doesn't anonymousBlocks have all of them cb->style()->logicalWidth().isAu to()
4203
4204 if (cb->style()->logicalWidth().isFixed())
4205 return true;
4206 if (cb->isRenderView())
4207 return true;
4208 if (cb->isOutOfFlowPositioned())
4209 return true;
4210 if (cb->style()->logicalWidth().isPercent())
4211 return logicalWidthIsResolvableFromBlock(cb->containingBlock());
4212
4213 return false;
4214 }
4215
4216 bool RenderBox::hasDefiniteLogicalWidth() const
4217 {
4218 const Length& logicalWidth = style()->logicalWidth();
4219 if (logicalWidth.isIntrinsic() || logicalWidth.isLegacyIntrinsic())
4220 return false;
4221 if (logicalWidth.isFixed())
4222 return true;
4223 // The size of the containing block of an absolutely positioned element is a lways definite with respect to that
4224 // element (http://dev.w3.org/csswg/css-sizing-3/#definite).
4225 if (isOutOfFlowPositioned())
4226 return true;
4227
4228 return RenderBox::logicalWidthIsResolvableFromBlock(containingBlock());
4229 }
4230
4197 inline static bool percentageLogicalHeightIsResolvable(const RenderBox* box) 4231 inline static bool percentageLogicalHeightIsResolvable(const RenderBox* box)
4198 { 4232 {
4199 return RenderBox::percentageLogicalHeightIsResolvableFromBlock(box->containi ngBlock(), box->isOutOfFlowPositioned()); 4233 return RenderBox::percentageLogicalHeightIsResolvableFromBlock(box->containi ngBlock(), box->isOutOfFlowPositioned());
4200 } 4234 }
4201 4235
4202 bool RenderBox::percentageLogicalHeightIsResolvableFromBlock(const RenderBlock* containingBlock, bool isOutOfFlowPositioned) 4236 bool RenderBox::percentageLogicalHeightIsResolvableFromBlock(const RenderBlock* containingBlock, bool isOutOfFlowPositioned)
4203 { 4237 {
4204 // In quirks mode, blocks with auto height are skipped, and we keep looking for an enclosing 4238 // In quirks mode, blocks with auto height are skipped, and we keep looking for an enclosing
4205 // block that may have a specified height and then use it. In strict mode, t his violates the 4239 // block that may have a specified height and then use it. In strict mode, t his violates the
4206 // specification, which states that percentage heights just revert to auto i f the containing 4240 // specification, which states that percentage heights just revert to auto i f the containing
(...skipping 29 matching lines...) Expand all
4236 return true; 4270 return true;
4237 if (cb->isDocumentElement() && isOutOfFlowPositioned) { 4271 if (cb->isDocumentElement() && isOutOfFlowPositioned) {
4238 // Match the positioned objects behavior, which is that positioned objec ts will fill their viewport 4272 // Match the positioned objects behavior, which is that positioned objec ts will fill their viewport
4239 // always. Note we could only hit this case by recurring into computePe rcentageLogicalHeight on a positioned containing block. 4273 // always. Note we could only hit this case by recurring into computePe rcentageLogicalHeight on a positioned containing block.
4240 return true; 4274 return true;
4241 } 4275 }
4242 4276
4243 return false; 4277 return false;
4244 } 4278 }
4245 4279
4280 bool RenderBox::hasDefiniteLogicalHeight() const
4281 {
4282 const Length& logicalHeight = style()->logicalHeight();
4283 if (logicalHeight.isIntrinsicOrAuto())
4284 return false;
4285 if (logicalHeight.isFixed())
4286 return true;
4287 // The size of the containing block of an absolutely positioned element is a lways definite with respect to that
4288 // element (http://dev.w3.org/csswg/css-sizing-3/#definite).
4289 if (isOutOfFlowPositioned())
4290 return true;
4291
4292 return percentageLogicalHeightIsResolvable(this);
4293 }
4294
4246 bool RenderBox::hasUnsplittableScrollingOverflow() const 4295 bool RenderBox::hasUnsplittableScrollingOverflow() const
4247 { 4296 {
4248 // We will paginate as long as we don't scroll overflow in the pagination di rection. 4297 // We will paginate as long as we don't scroll overflow in the pagination di rection.
4249 bool isHorizontal = isHorizontalWritingMode(); 4298 bool isHorizontal = isHorizontalWritingMode();
4250 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf lowX())) 4299 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf lowX()))
4251 return false; 4300 return false;
4252 4301
4253 // We do have overflow. We'll still be willing to paginate as long as the bl ock 4302 // We do have overflow. We'll still be willing to paginate as long as the bl ock
4254 // has auto logical height, auto or undefined max-logical-height and a zero or auto min-logical-height. 4303 // has auto logical height, auto or undefined max-logical-height and a zero or auto min-logical-height.
4255 // Note this is just a heuristic, and it's still possible to have overflow u nder these 4304 // Note this is just a heuristic, and it's still possible to have overflow u nder these
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
4577 } 4626 }
4578 4627
4579 void RenderBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c onst 4628 void RenderBox::invalidateDisplayItemClients(DisplayItemList* displayItemList) c onst
4580 { 4629 {
4581 RenderBoxModelObject::invalidateDisplayItemClients(displayItemList); 4630 RenderBoxModelObject::invalidateDisplayItemClients(displayItemList);
4582 if (LayerScrollableArea* area = scrollableArea()) 4631 if (LayerScrollableArea* area = scrollableArea())
4583 displayItemList->invalidate(area->displayItemClient()); 4632 displayItemList->invalidate(area->displayItemClient());
4584 } 4633 }
4585 4634
4586 } // namespace blink 4635 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderGrid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698