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

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

Issue 359673003: Inapplicable top, bottom style shouldn't affect height calculation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Re-add experimentally removed code and fix it Created 6 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
« no previous file with comments | « LayoutTests/fast/css/replaced-element-ignore-top-bottom.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 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // what the CSS spec says to do with heights. Basically we 184 // what the CSS spec says to do with heights. Basically we
185 // don't care if the cell specified a height or not. 185 // don't care if the cell specified a height or not.
186 if (cb->isTableCell()) 186 if (cb->isTableCell())
187 return false; 187 return false;
188 188
189 // Match RenderBox::availableLogicalHeightUsing by special casing 189 // Match RenderBox::availableLogicalHeightUsing by special casing
190 // the render view. The available height is taken from the frame. 190 // the render view. The available height is taken from the frame.
191 if (cb->isRenderView()) 191 if (cb->isRenderView())
192 return false; 192 return false;
193 193
194 if (!cb->style()->logicalTop().isAuto() && !cb->style()->logicalBottom().isA uto()) 194 if (cb->isOutOfFlowPositioned() && !cb->style()->logicalTop().isAuto() && !c b->style()->logicalBottom().isAuto())
195 return false; 195 return false;
196 196
197 // If the height of the containing block computes to 'auto', then it hasn't been 'specified explictly'. 197 // If the height of the containing block computes to 'auto', then it hasn't been 'specified explicitly'.
198 if (!cb->hasAutoHeightOrContainingBlockWithAutoHeight()) 198 return cb->hasAutoHeightOrContainingBlockWithAutoHeight();
199 return false;
200
201 return true;
202 } 199 }
203 200
204 LayoutSize RenderBoxModelObject::relativePositionOffset() const 201 LayoutSize RenderBoxModelObject::relativePositionOffset() const
205 { 202 {
206 LayoutSize offset = accumulateInFlowPositionOffsets(this); 203 LayoutSize offset = accumulateInFlowPositionOffsets(this);
207 204
208 RenderBlock* containingBlock = this->containingBlock(); 205 RenderBlock* containingBlock = this->containingBlock();
209 206
210 // Objects that shrink to avoid floats normally use available line width whe n computing containing block width. However 207 // Objects that shrink to avoid floats normally use available line width whe n computing containing block width. However
211 // in the case of relative positioning using percentages, we can't do this. The offset should always be resolved using the 208 // in the case of relative positioning using percentages, we can't do this. The offset should always be resolved using the
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2732 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); 2729 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
2733 for (RenderObject* child = startChild; child && child != endChild; ) { 2730 for (RenderObject* child = startChild; child && child != endChild; ) {
2734 // Save our next sibling as moveChildTo will clear it. 2731 // Save our next sibling as moveChildTo will clear it.
2735 RenderObject* nextSibling = child->nextSibling(); 2732 RenderObject* nextSibling = child->nextSibling();
2736 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); 2733 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert);
2737 child = nextSibling; 2734 child = nextSibling;
2738 } 2735 }
2739 } 2736 }
2740 2737
2741 } // namespace WebCore 2738 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/replaced-element-ignore-top-bottom.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698