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

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

Issue 1007623003: Fix incorrect percentage top for positioned elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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/layout/LayoutBox.h ('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, 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 2699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2710 // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical w riting-mode. 2710 // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical w riting-mode.
2711 // https://bugs.webkit.org/show_bug.cgi?id=46500 2711 // https://bugs.webkit.org/show_bug.cgi?id=46500
2712 if (isLayoutBlock() && isOutOfFlowPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) { 2712 if (isLayoutBlock() && isOutOfFlowPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) {
2713 LayoutBlock* block = const_cast<LayoutBlock*>(toLayoutBlock(this)); 2713 LayoutBlock* block = const_cast<LayoutBlock*>(toLayoutBlock(this));
2714 LogicalExtentComputedValues computedValues; 2714 LogicalExtentComputedValues computedValues;
2715 block->computeLogicalHeight(block->logicalHeight(), 0, computedValues); 2715 block->computeLogicalHeight(block->logicalHeight(), 0, computedValues);
2716 LayoutUnit newContentHeight = computedValues.m_extent - block->borderAnd PaddingLogicalHeight() - block->scrollbarLogicalHeight(); 2716 LayoutUnit newContentHeight = computedValues.m_extent - block->borderAnd PaddingLogicalHeight() - block->scrollbarLogicalHeight();
2717 return adjustContentBoxLogicalHeightForBoxSizing(newContentHeight); 2717 return adjustContentBoxLogicalHeightForBoxSizing(newContentHeight);
2718 } 2718 }
2719 2719
2720 if (isLayoutBlock() && isOutOfFlowPositioned() && (heightType == IncludePadd ing)) {
rune 2015/03/13 12:49:13 What happens if you pass IncludePadding with non-o
changseok 2015/03/16 10:02:25 IncludePadding is only for position:absolute. so n
2721 LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(t his);
2722 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, avail ableHeight));
2723 }
2724
2720 // FIXME: This is wrong if the containingBlock has a perpendicular writing m ode. 2725 // FIXME: This is wrong if the containingBlock has a perpendicular writing m ode.
2721 LayoutUnit availableHeight = containingBlockLogicalHeightForContent(heightTy pe); 2726 LayoutUnit availableHeight = containingBlockLogicalHeightForContent(heightTy pe);
2722 if (heightType == ExcludeMarginBorderPadding) { 2727 if (heightType == ExcludeMarginBorderPadding) {
2723 // FIXME: Margin collapsing hasn't happened yet, so this incorrectly rem oves collapsed margins. 2728 // FIXME: Margin collapsing hasn't happened yet, so this incorrectly rem oves collapsed margins.
2724 availableHeight -= marginBefore() + marginAfter() + borderAndPaddingLogi calHeight(); 2729 availableHeight -= marginBefore() + marginAfter() + borderAndPaddingLogi calHeight();
2725 } 2730 }
2726 return availableHeight; 2731 return availableHeight;
2727 } 2732 }
2728 2733
2729 void LayoutBox::computeAndSetBlockDirectionMargins(const LayoutBlock* containing Block) 2734 void LayoutBox::computeAndSetBlockDirectionMargins(const LayoutBlock* containing Block)
(...skipping 1914 matching lines...) Expand 10 before | Expand all | Expand 10 after
4644 computedValues.m_margins.m_end = marginEnd(); 4649 computedValues.m_margins.m_end = marginEnd();
4645 4650
4646 setLogicalTop(oldLogicalTop); 4651 setLogicalTop(oldLogicalTop);
4647 setLogicalWidth(oldLogicalWidth); 4652 setLogicalWidth(oldLogicalWidth);
4648 setLogicalLeft(oldLogicalLeft); 4653 setLogicalLeft(oldLogicalLeft);
4649 setMarginLeft(oldMarginLeft); 4654 setMarginLeft(oldMarginLeft);
4650 setMarginRight(oldMarginRight); 4655 setMarginRight(oldMarginRight);
4651 } 4656 }
4652 4657
4653 } // namespace blink 4658 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698