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

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

Issue 1943633002: [css-flexbox] Add test case for definite widths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: with test 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
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 4157 matching lines...) Expand 10 before | Expand all | Expand 10 after
4168 return; 4168 return;
4169 4169
4170 if (!hasSelfVisualOverflow() && contentsVisualOverflowRect().isEmpty()) { 4170 if (!hasSelfVisualOverflow() && contentsVisualOverflowRect().isEmpty()) {
4171 clearAllOverflows(); 4171 clearAllOverflows();
4172 return; 4172 return;
4173 } 4173 }
4174 4174
4175 m_overflow->setLayoutOverflow(noOverflowRect()); 4175 m_overflow->setLayoutOverflow(noOverflowRect());
4176 } 4176 }
4177 4177
4178 static bool logicalWidthIsResolvable(const LayoutBox& layoutBox) 4178 static bool logicalWidthIsResolvable(const LayoutBox& layoutBox)
mstensho (USE GERRIT) 2016/05/03 12:08:52 Not for this CL, but I think this function should
4179 { 4179 {
4180 const LayoutBox* box = &layoutBox; 4180 const LayoutBox* box = &layoutBox;
4181 while (!box->isLayoutView() && !box->isFloatingOrOutOfFlowPositioned() 4181 while (!box->isLayoutView() && !box->isFloatingOrOutOfFlowPositioned()
4182 && (box->style()->logicalWidth().isAuto() || box->isAnonymousBlock()) 4182 && (box->style()->logicalWidth().isAuto() || box->isAnonymousBlock())
4183 && !isStretchingColumnFlexItem(box)
4183 && !box->hasOverrideContainingBlockLogicalWidth()) 4184 && !box->hasOverrideContainingBlockLogicalWidth())
4184 box = box->containingBlock(); 4185 box = box->containingBlock();
4185 4186
4186 if (box->style()->logicalWidth().isFixed()) 4187 if (box->style()->logicalWidth().isFixed())
4187 return true; 4188 return true;
4188 if (box->isLayoutView()) 4189 if (box->isLayoutView())
4189 return true; 4190 return true;
4190 if (box->isOutOfFlowPositioned() && !box->style()->logicalLeft().isAuto() && !box->style()->logicalRight().isAuto()) 4191 if (box->isOutOfFlowPositioned() && !box->style()->logicalLeft().isAuto() && !box->style()->logicalRight().isAuto())
4191 return true; 4192 return true;
4193 if (isStretchingColumnFlexItem(box))
mstensho (USE GERRIT) 2016/05/03 12:08:52 logicalWidthIsResolvable(), isn't that about the s
4194 return true;
4192 if (box->hasOverrideContainingBlockLogicalWidth()) 4195 if (box->hasOverrideContainingBlockLogicalWidth())
4193 return box->overrideContainingBlockContentLogicalWidth() != -1; 4196 return box->overrideContainingBlockContentLogicalWidth() != -1;
4194 if (box->style()->logicalWidth().hasPercent()) 4197 if (box->style()->logicalWidth().hasPercent())
4195 return logicalWidthIsResolvable(*box->containingBlock()); 4198 return logicalWidthIsResolvable(*box->containingBlock());
4196 4199
4197 return false; 4200 return false;
4198 } 4201 }
4199 4202
4200 bool LayoutBox::hasDefiniteLogicalWidth() const 4203 bool LayoutBox::hasDefiniteLogicalWidth() const
4201 { 4204 {
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
4751 4754
4752 void LayoutBox::clearPercentHeightDescendants() 4755 void LayoutBox::clearPercentHeightDescendants()
4753 { 4756 {
4754 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4757 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4755 if (curr->isBox()) 4758 if (curr->isBox())
4756 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4759 toLayoutBox(curr)->removeFromPercentHeightContainer();
4757 } 4760 }
4758 } 4761 }
4759 4762
4760 } // namespace blink 4763 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698