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

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

Issue 11017062: Merge 130549 - Deprecated flexboxes subtract scrollbar width/height twice (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 2 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 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 void RenderBox::clearOverrideSize() 701 void RenderBox::clearOverrideSize()
702 { 702 {
703 if (gOverrideHeightMap) 703 if (gOverrideHeightMap)
704 gOverrideHeightMap->remove(this); 704 gOverrideHeightMap->remove(this);
705 if (gOverrideWidthMap) 705 if (gOverrideWidthMap)
706 gOverrideWidthMap->remove(this); 706 gOverrideWidthMap->remove(this);
707 } 707 }
708 708
709 LayoutUnit RenderBox::overrideLogicalContentWidth() const 709 LayoutUnit RenderBox::overrideLogicalContentWidth() const
710 { 710 {
711 // FIXME: This should probably be returning contentLogicalWidth instead of c ontentWidth. 711 ASSERT(hasOverrideWidth());
712 return hasOverrideWidth() ? gOverrideWidthMap->get(this) : contentWidth(); 712 return gOverrideWidthMap->get(this);
713 } 713 }
714 714
715 LayoutUnit RenderBox::overrideLogicalContentHeight() const 715 LayoutUnit RenderBox::overrideLogicalContentHeight() const
716 { 716 {
717 // FIXME: This should probably be returning contentLogicalHeight instead of contentHeight. 717 ASSERT(hasOverrideHeight());
718 return hasOverrideHeight() ? gOverrideHeightMap->get(this) : contentHeight() ; 718 return gOverrideHeightMap->get(this);
719 } 719 }
720 720
721 LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const 721 LayoutUnit RenderBox::adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const
722 { 722 {
723 LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth(); 723 LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth();
724 if (style()->boxSizing() == CONTENT_BOX) 724 if (style()->boxSizing() == CONTENT_BOX)
725 return width + bordersPlusPadding; 725 return width + bordersPlusPadding;
726 return max(width, bordersPlusPadding); 726 return max(width, bordersPlusPadding);
727 } 727 }
728 728
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 } 2334 }
2335 2335
2336 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h) const 2336 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h) const
2337 { 2337 {
2338 if (isRenderView()) 2338 if (isRenderView())
2339 return isHorizontalWritingMode() ? toRenderView(this)->frameView()->visi bleHeight() : toRenderView(this)->frameView()->visibleWidth(); 2339 return isHorizontalWritingMode() ? toRenderView(this)->frameView()->visi bleHeight() : toRenderView(this)->frameView()->visibleWidth();
2340 2340
2341 // We need to stop here, since we don't want to increase the height of the t able 2341 // We need to stop here, since we don't want to increase the height of the t able
2342 // artificially. We're going to rely on this cell getting expanded to some new 2342 // artificially. We're going to rely on this cell getting expanded to some new
2343 // height, and then when we lay out again we'll use the calculation below. 2343 // height, and then when we lay out again we'll use the calculation below.
2344 if (isTableCell() && (h.isAuto() || h.isPercent())) 2344 if (isTableCell() && (h.isAuto() || h.isPercent())) {
2345 return overrideLogicalContentHeight(); 2345 if (hasOverrideHeight())
2346 return overrideLogicalContentHeight();
2347 return logicalHeight() - borderAndPaddingLogicalHeight();
2348 }
2346 2349
2347 if (h.isPercent() && isOutOfFlowPositioned()) { 2350 if (h.isPercent() && isOutOfFlowPositioned()) {
2348 // FIXME: This is wrong if the containingBlock has a perpendicular writi ng mode. 2351 // FIXME: This is wrong if the containingBlock has a perpendicular writi ng mode.
2349 LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(c ontainingBlock()); 2352 LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(c ontainingBlock());
2350 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, avail ableHeight)); 2353 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, avail ableHeight));
2351 } 2354 }
2352 2355
2353 LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeigh tUsing(MainOrPreferredSize, h); 2356 LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeigh tUsing(MainOrPreferredSize, h);
2354 if (heightIncludingScrollbar != -1) 2357 if (heightIncludingScrollbar != -1)
2355 return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing (heightIncludingScrollbar) - scrollbarLogicalHeight()); 2358 return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing (heightIncludingScrollbar) - scrollbarLogicalHeight());
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
4057 } 4060 }
4058 4061
4059 if (didSplitParentAnonymousBoxes) 4062 if (didSplitParentAnonymousBoxes)
4060 markBoxForRelayoutAfterSplit(this); 4063 markBoxForRelayoutAfterSplit(this);
4061 4064
4062 ASSERT(beforeChild->parent() == this); 4065 ASSERT(beforeChild->parent() == this);
4063 return beforeChild; 4066 return beforeChild;
4064 } 4067 }
4065 4068
4066 } // namespace WebCore 4069 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderBox.h ('k') | Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698