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

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

Issue 341523002: Resolve percent lengths for abs. positioned tables against padding box. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 2752 matching lines...) Expand 10 before | Expand all | Expand 10 after
2763 cb->computeLogicalHeight(cb->logicalHeight(), 0, computedValues); 2763 cb->computeLogicalHeight(cb->logicalHeight(), 0, computedValues);
2764 availableHeight = computedValues.m_extent - cb->borderAndPaddingLogicalH eight() - cb->scrollbarLogicalHeight(); 2764 availableHeight = computedValues.m_extent - cb->borderAndPaddingLogicalH eight() - cb->scrollbarLogicalHeight();
2765 } else if (cb->isRenderView()) 2765 } else if (cb->isRenderView())
2766 availableHeight = view()->viewLogicalHeightForPercentages(); 2766 availableHeight = view()->viewLogicalHeightForPercentages();
2767 2767
2768 if (availableHeight == -1) 2768 if (availableHeight == -1)
2769 return availableHeight; 2769 return availableHeight;
2770 2770
2771 availableHeight -= rootMarginBorderPaddingHeight; 2771 availableHeight -= rootMarginBorderPaddingHeight;
2772 2772
2773 if (isTable() && isOutOfFlowPositioned())
2774 availableHeight += cb->paddingLogicalHeight();
2775
2773 LayoutUnit result = valueForLength(height, availableHeight); 2776 LayoutUnit result = valueForLength(height, availableHeight);
2774 if (includeBorderPadding) { 2777 if (includeBorderPadding) {
2775 // FIXME: Table cells should default to box-sizing: border-box so we can avoid this hack. 2778 // FIXME: Table cells should default to box-sizing: border-box so we can avoid this hack.
2776 // It is necessary to use the border-box to match WinIE's broken 2779 // It is necessary to use the border-box to match WinIE's broken
2777 // box model. This is essential for sizing inside 2780 // box model. This is essential for sizing inside
2778 // table cells using percentage heights. 2781 // table cells using percentage heights.
2779 result -= borderAndPaddingLogicalHeight(); 2782 result -= borderAndPaddingLogicalHeight();
2780 return max<LayoutUnit>(0, result); 2783 return max<LayoutUnit>(0, result);
2781 } 2784 }
2782 return result; 2785 return result;
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after
4695 return 0; 4698 return 0;
4696 4699
4697 if (!layoutState && !flowThreadContainingBlock()) 4700 if (!layoutState && !flowThreadContainingBlock())
4698 return 0; 4701 return 0;
4699 4702
4700 RenderBlock* containerBlock = containingBlock(); 4703 RenderBlock* containerBlock = containingBlock();
4701 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4704 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4702 } 4705 }
4703 4706
4704 } // namespace WebCore 4707 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698