OLD | NEW |
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 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2849 bool skippedAutoHeightContainingBlock = false; | 2849 bool skippedAutoHeightContainingBlock = false; |
2850 RenderBlock* cb = containingBlock(); | 2850 RenderBlock* cb = containingBlock(); |
2851 const RenderBox* containingBlockChild = this; | 2851 const RenderBox* containingBlockChild = this; |
2852 LayoutUnit rootMarginBorderPaddingHeight = 0; | 2852 LayoutUnit rootMarginBorderPaddingHeight = 0; |
2853 while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation
(cb)) { | 2853 while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation
(cb)) { |
2854 if (cb->isBody() || cb->isRoot()) | 2854 if (cb->isBody() || cb->isRoot()) |
2855 rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfte
r() + cb->borderAndPaddingLogicalHeight(); | 2855 rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfte
r() + cb->borderAndPaddingLogicalHeight(); |
2856 skippedAutoHeightContainingBlock = true; | 2856 skippedAutoHeightContainingBlock = true; |
2857 containingBlockChild = cb; | 2857 containingBlockChild = cb; |
2858 cb = cb->containingBlock(); | 2858 cb = cb->containingBlock(); |
2859 cb->addPercentHeightDescendant(const_cast<RenderBox*>(this)); | |
2860 } | 2859 } |
| 2860 cb->addPercentHeightDescendant(const_cast<RenderBox*>(this)); |
2861 | 2861 |
2862 RenderStyle* cbstyle = cb->style(); | 2862 RenderStyle* cbstyle = cb->style(); |
2863 | 2863 |
2864 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height | 2864 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height |
2865 // explicitly specified that can be used for any percentage computations. | 2865 // explicitly specified that can be used for any percentage computations. |
2866 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle->logicalHeight().isAuto() || (!cbstyle->logicalTop().isAuto() && !c
bstyle->logicalBottom().isAuto())); | 2866 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle->logicalHeight().isAuto() || (!cbstyle->logicalTop().isAuto() && !c
bstyle->logicalBottom().isAuto())); |
2867 | 2867 |
2868 bool includeBorderPadding = isTable(); | 2868 bool includeBorderPadding = isTable(); |
2869 | 2869 |
2870 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) | 2870 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3002 | 3002 |
3003 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) co
nst | 3003 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) co
nst |
3004 { | 3004 { |
3005 switch (logicalHeight.type()) { | 3005 switch (logicalHeight.type()) { |
3006 case Fixed: | 3006 case Fixed: |
3007 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value
()); | 3007 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value
()); |
3008 case Percent: | 3008 case Percent: |
3009 case Calculated: | 3009 case Calculated: |
3010 { | 3010 { |
3011 RenderObject* cb = isOutOfFlowPositioned() ? container() : containin
gBlock(); | 3011 RenderObject* cb = isOutOfFlowPositioned() ? container() : containin
gBlock(); |
3012 while (cb->isAnonymous()) { | 3012 while (cb->isAnonymous()) |
3013 cb = cb->containingBlock(); | 3013 cb = cb->containingBlock(); |
| 3014 if (cb->isRenderBlock()) |
3014 toRenderBlock(cb)->addPercentHeightDescendant(const_cast<RenderB
ox*>(this)); | 3015 toRenderBlock(cb)->addPercentHeightDescendant(const_cast<RenderB
ox*>(this)); |
3015 } | |
3016 | 3016 |
3017 // FIXME: This calculation is not patched for block-flow yet. | 3017 // FIXME: This calculation is not patched for block-flow yet. |
3018 // https://bugs.webkit.org/show_bug.cgi?id=46500 | 3018 // https://bugs.webkit.org/show_bug.cgi?id=46500 |
3019 if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() &&
!(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { | 3019 if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() &&
!(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { |
3020 ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock()); | 3020 ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock()); |
3021 RenderBlock* block = toRenderBlock(cb); | 3021 RenderBlock* block = toRenderBlock(cb); |
3022 LogicalExtentComputedValues computedValues; | 3022 LogicalExtentComputedValues computedValues; |
3023 block->computeLogicalHeight(block->logicalHeight(), 0, computedV
alues); | 3023 block->computeLogicalHeight(block->logicalHeight(), 0, computedV
alues); |
3024 LayoutUnit newContentHeight = computedValues.m_extent - block->b
orderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); | 3024 LayoutUnit newContentHeight = computedValues.m_extent - block->b
orderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); |
3025 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBo
xSizing(newContentHeight); | 3025 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBo
xSizing(newContentHeight); |
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4917 return 0; | 4917 return 0; |
4918 | 4918 |
4919 if (!layoutState && !flowThreadContainingBlock()) | 4919 if (!layoutState && !flowThreadContainingBlock()) |
4920 return 0; | 4920 return 0; |
4921 | 4921 |
4922 RenderBlock* containerBlock = containingBlock(); | 4922 RenderBlock* containerBlock = containingBlock(); |
4923 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4923 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4924 } | 4924 } |
4925 | 4925 |
4926 } // namespace WebCore | 4926 } // namespace WebCore |
OLD | NEW |