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 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2680 } | 2680 } |
2681 if (height.isFixed()) | 2681 if (height.isFixed()) |
2682 return height.value(); | 2682 return height.value(); |
2683 if (height.isPercent()) | 2683 if (height.isPercent()) |
2684 return computePercentageLogicalHeight(height); | 2684 return computePercentageLogicalHeight(height); |
2685 return -1; | 2685 return -1; |
2686 } | 2686 } |
2687 | 2687 |
2688 bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox*
containingBlock) const | 2688 bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox*
containingBlock) const |
2689 { | 2689 { |
| 2690 // Flow threads for multicol or paged overflow should be skipped. They are i
nvisible to the DOM, |
| 2691 // and percent heights of children should be resolved against the multicol o
r paged container. |
| 2692 if (containingBlock->isRenderFlowThread()) |
| 2693 return true; |
| 2694 |
2690 // For quirks mode and anonymous blocks, we skip auto-height containingBlock
s when computing percentages. | 2695 // For quirks mode and anonymous blocks, we skip auto-height containingBlock
s when computing percentages. |
2691 // For standards mode, we treat the percentage as auto if it has an auto-hei
ght containing block. | 2696 // For standards mode, we treat the percentage as auto if it has an auto-hei
ght containing block. |
2692 if (!document().inQuirksMode() && !containingBlock->isAnonymousBlock()) | 2697 if (!document().inQuirksMode() && !containingBlock->isAnonymousBlock()) |
2693 return false; | 2698 return false; |
2694 return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPosit
ioned() && containingBlock->style()->logicalHeight().isAuto() && isHorizontalWri
tingMode() == containingBlock->isHorizontalWritingMode(); | 2699 return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPosit
ioned() && containingBlock->style()->logicalHeight().isAuto() && isHorizontalWri
tingMode() == containingBlock->isHorizontalWritingMode(); |
2695 } | 2700 } |
2696 | 2701 |
2697 LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const | 2702 LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const |
2698 { | 2703 { |
2699 LayoutUnit availableHeight = -1; | 2704 LayoutUnit availableHeight = -1; |
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4690 return 0; | 4695 return 0; |
4691 | 4696 |
4692 if (!layoutState && !flowThreadContainingBlock()) | 4697 if (!layoutState && !flowThreadContainingBlock()) |
4693 return 0; | 4698 return 0; |
4694 | 4699 |
4695 RenderBlock* containerBlock = containingBlock(); | 4700 RenderBlock* containerBlock = containingBlock(); |
4696 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4701 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4697 } | 4702 } |
4698 | 4703 |
4699 } // namespace WebCore | 4704 } // namespace WebCore |
OLD | NEW |