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 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2707 bool skippedAutoHeightContainingBlock = false; | 2707 bool skippedAutoHeightContainingBlock = false; |
2708 RenderBlock* cb = containingBlock(); | 2708 RenderBlock* cb = containingBlock(); |
2709 const RenderBox* containingBlockChild = this; | 2709 const RenderBox* containingBlockChild = this; |
2710 LayoutUnit rootMarginBorderPaddingHeight = 0; | 2710 LayoutUnit rootMarginBorderPaddingHeight = 0; |
2711 while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation
(cb)) { | 2711 while (!cb->isRenderView() && skipContainingBlockForPercentHeightCalculation
(cb)) { |
2712 if (cb->isBody() || cb->isRoot()) | 2712 if (cb->isBody() || cb->isRoot()) |
2713 rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfte
r() + cb->borderAndPaddingLogicalHeight(); | 2713 rootMarginBorderPaddingHeight += cb->marginBefore() + cb->marginAfte
r() + cb->borderAndPaddingLogicalHeight(); |
2714 skippedAutoHeightContainingBlock = true; | 2714 skippedAutoHeightContainingBlock = true; |
2715 containingBlockChild = cb; | 2715 containingBlockChild = cb; |
2716 cb = cb->containingBlock(); | 2716 cb = cb->containingBlock(); |
2717 cb->addPercentHeightDescendant(const_cast<RenderBox*>(this)); | |
2718 } | 2717 } |
| 2718 cb->addPercentHeightDescendant(const_cast<RenderBox*>(this)); |
2719 | 2719 |
2720 RenderStyle* cbstyle = cb->style(); | 2720 RenderStyle* cbstyle = cb->style(); |
2721 | 2721 |
2722 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height | 2722 // A positioned element that specified both top/bottom or that specifies hei
ght should be treated as though it has a height |
2723 // explicitly specified that can be used for any percentage computations. | 2723 // explicitly specified that can be used for any percentage computations. |
2724 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle->logicalHeight().isAuto() || (!cbstyle->logicalTop().isAuto() && !c
bstyle->logicalBottom().isAuto())); | 2724 bool isOutOfFlowPositionedWithSpecifiedHeight = cb->isOutOfFlowPositioned()
&& (!cbstyle->logicalHeight().isAuto() || (!cbstyle->logicalTop().isAuto() && !c
bstyle->logicalBottom().isAuto())); |
2725 | 2725 |
2726 bool includeBorderPadding = isTable(); | 2726 bool includeBorderPadding = isTable(); |
2727 | 2727 |
2728 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) | 2728 if (isHorizontalWritingMode() != cb->isHorizontalWritingMode()) |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2860 | 2860 |
2861 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) co
nst | 2861 LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) co
nst |
2862 { | 2862 { |
2863 switch (logicalHeight.type()) { | 2863 switch (logicalHeight.type()) { |
2864 case Fixed: | 2864 case Fixed: |
2865 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value
()); | 2865 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value
()); |
2866 case Percent: | 2866 case Percent: |
2867 case Calculated: | 2867 case Calculated: |
2868 { | 2868 { |
2869 RenderObject* cb = isOutOfFlowPositioned() ? container() : containin
gBlock(); | 2869 RenderObject* cb = isOutOfFlowPositioned() ? container() : containin
gBlock(); |
2870 while (cb->isAnonymous()) { | 2870 while (cb->isAnonymous()) |
2871 cb = cb->containingBlock(); | 2871 cb = cb->containingBlock(); |
| 2872 if (cb->isRenderBlock()) |
2872 toRenderBlock(cb)->addPercentHeightDescendant(const_cast<RenderB
ox*>(this)); | 2873 toRenderBlock(cb)->addPercentHeightDescendant(const_cast<RenderB
ox*>(this)); |
2873 } | |
2874 | 2874 |
2875 // FIXME: This calculation is not patched for block-flow yet. | 2875 // FIXME: This calculation is not patched for block-flow yet. |
2876 // https://bugs.webkit.org/show_bug.cgi?id=46500 | 2876 // https://bugs.webkit.org/show_bug.cgi?id=46500 |
2877 if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() &&
!(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { | 2877 if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() &&
!(cb->style()->top().isAuto() || cb->style()->bottom().isAuto())) { |
2878 ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock()); | 2878 ASSERT_WITH_SECURITY_IMPLICATION(cb->isRenderBlock()); |
2879 RenderBlock* block = toRenderBlock(cb); | 2879 RenderBlock* block = toRenderBlock(cb); |
2880 LogicalExtentComputedValues computedValues; | 2880 LogicalExtentComputedValues computedValues; |
2881 block->computeLogicalHeight(block->logicalHeight(), 0, computedV
alues); | 2881 block->computeLogicalHeight(block->logicalHeight(), 0, computedV
alues); |
2882 LayoutUnit newContentHeight = computedValues.m_extent - block->b
orderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); | 2882 LayoutUnit newContentHeight = computedValues.m_extent - block->b
orderAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); |
2883 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBo
xSizing(newContentHeight); | 2883 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBo
xSizing(newContentHeight); |
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4705 return 0; | 4705 return 0; |
4706 | 4706 |
4707 if (!layoutState && !flowThreadContainingBlock()) | 4707 if (!layoutState && !flowThreadContainingBlock()) |
4708 return 0; | 4708 return 0; |
4709 | 4709 |
4710 RenderBlock* containerBlock = containingBlock(); | 4710 RenderBlock* containerBlock = containingBlock(); |
4711 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4711 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4712 } | 4712 } |
4713 | 4713 |
4714 } // namespace WebCore | 4714 } // namespace WebCore |
OLD | NEW |