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 25 matching lines...) Expand all Loading... |
36 #include "core/html/HTMLFrameOwnerElement.h" | 36 #include "core/html/HTMLFrameOwnerElement.h" |
37 #include "core/frame/Frame.h" | 37 #include "core/frame/Frame.h" |
38 #include "core/frame/FrameView.h" | 38 #include "core/frame/FrameView.h" |
39 #include "core/page/AutoscrollController.h" | 39 #include "core/page/AutoscrollController.h" |
40 #include "core/page/EventHandler.h" | 40 #include "core/page/EventHandler.h" |
41 #include "core/page/Page.h" | 41 #include "core/page/Page.h" |
42 #include "core/rendering/HitTestResult.h" | 42 #include "core/rendering/HitTestResult.h" |
43 #include "core/rendering/LayoutRectRecorder.h" | 43 #include "core/rendering/LayoutRectRecorder.h" |
44 #include "core/rendering/PaintInfo.h" | 44 #include "core/rendering/PaintInfo.h" |
45 #include "core/rendering/RenderBoxRegionInfo.h" | 45 #include "core/rendering/RenderBoxRegionInfo.h" |
| 46 #include "core/rendering/RenderDeprecatedFlexibleBox.h" |
46 #include "core/rendering/RenderFlexibleBox.h" | 47 #include "core/rendering/RenderFlexibleBox.h" |
47 #include "core/rendering/RenderFlowThread.h" | 48 #include "core/rendering/RenderFlowThread.h" |
48 #include "core/rendering/RenderGeometryMap.h" | 49 #include "core/rendering/RenderGeometryMap.h" |
49 #include "core/rendering/RenderGrid.h" | 50 #include "core/rendering/RenderGrid.h" |
50 #include "core/rendering/RenderInline.h" | 51 #include "core/rendering/RenderInline.h" |
51 #include "core/rendering/RenderLayer.h" | 52 #include "core/rendering/RenderLayer.h" |
52 #include "core/rendering/RenderLayerCompositor.h" | 53 #include "core/rendering/RenderLayerCompositor.h" |
53 #include "core/rendering/RenderListMarker.h" | 54 #include "core/rendering/RenderListMarker.h" |
54 #include "core/rendering/RenderRegion.h" | 55 #include "core/rendering/RenderRegion.h" |
55 #include "core/rendering/RenderTableCell.h" | 56 #include "core/rendering/RenderTableCell.h" |
(...skipping 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2714 else if (treatAsReplaced) | 2715 else if (treatAsReplaced) |
2715 h = Length(computeReplacedLogicalHeight(), Fixed); | 2716 h = Length(computeReplacedLogicalHeight(), Fixed); |
2716 else { | 2717 else { |
2717 h = style()->logicalHeight(); | 2718 h = style()->logicalHeight(); |
2718 checkMinMaxHeight = true; | 2719 checkMinMaxHeight = true; |
2719 } | 2720 } |
2720 | 2721 |
2721 // Block children of horizontal flexible boxes fill the height of the bo
x. | 2722 // Block children of horizontal flexible boxes fill the height of the bo
x. |
2722 // FIXME: Account for block-flow in flexible boxes. | 2723 // FIXME: Account for block-flow in flexible boxes. |
2723 // https://bugs.webkit.org/show_bug.cgi?id=46418 | 2724 // https://bugs.webkit.org/show_bug.cgi?id=46418 |
2724 if (h.isAuto() && parent()->isDeprecatedFlexibleBox() && parent()->style
()->boxOrient() == HORIZONTAL | 2725 if (h.isAuto() && inHorizontalBox && toRenderDeprecatedFlexibleBox(paren
t())->isStretchingChildren()) { |
2725 && parent()->isStretchingChildren()) { | |
2726 h = Length(parentBox()->contentLogicalHeight() - marginBefore() - ma
rginAfter() - borderAndPaddingLogicalHeight(), Fixed); | 2726 h = Length(parentBox()->contentLogicalHeight() - marginBefore() - ma
rginAfter() - borderAndPaddingLogicalHeight(), Fixed); |
2727 checkMinMaxHeight = false; | 2727 checkMinMaxHeight = false; |
2728 } | 2728 } |
2729 | 2729 |
2730 LayoutUnit heightResult; | 2730 LayoutUnit heightResult; |
2731 if (checkMinMaxHeight) { | 2731 if (checkMinMaxHeight) { |
2732 heightResult = computeLogicalHeightUsing(style()->logicalHeight(), c
omputedValues.m_extent - borderAndPaddingLogicalHeight()); | 2732 heightResult = computeLogicalHeightUsing(style()->logicalHeight(), c
omputedValues.m_extent - borderAndPaddingLogicalHeight()); |
2733 if (heightResult == -1) | 2733 if (heightResult == -1) |
2734 heightResult = computedValues.m_extent; | 2734 heightResult = computedValues.m_extent; |
2735 heightResult = constrainLogicalHeightByMinMax(heightResult, computed
Values.m_extent - borderAndPaddingLogicalHeight()); | 2735 heightResult = constrainLogicalHeightByMinMax(heightResult, computed
Values.m_extent - borderAndPaddingLogicalHeight()); |
2736 } else { | 2736 } else { |
2737 // The only times we don't check min/max height are when a fixed len
gth has | 2737 // The only times we don't check min/max height are when a fixed len
gth has |
2738 // been given as an override. Just use that. The value has already
been adjusted | 2738 // been given as an override. Just use that. The value has already
been adjusted |
2739 // for box-sizing. | 2739 // for box-sizing. |
2740 ASSERT(h.isFixed()); | 2740 ASSERT(h.isFixed()); |
2741 heightResult = h.value() + borderAndPaddingLogicalHeight(); | 2741 heightResult = h.value() + borderAndPaddingLogicalHeight(); |
2742 } | 2742 } |
2743 | 2743 |
2744 computedValues.m_extent = heightResult; | 2744 computedValues.m_extent = heightResult; |
2745 | 2745 |
2746 if (hasPerpendicularContainingBlock) { | 2746 if (hasPerpendicularContainingBlock) { |
2747 bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(
), style()); | 2747 bool shouldFlipBeforeAfter = shouldFlipBeforeAfterMargins(cb->style(
), style()); |
2748 computeInlineDirectionMargins(cb, containingBlockLogicalWidthForCont
ent(), heightResult, | 2748 computeInlineDirectionMargins(cb, containingBlockLogicalWidthForCont
ent(), heightResult, |
2749 shouldFlipBeforeAfter ? computedValues.m_margins.m_after : c
omputedValues.m_margins.m_before, | 2749 shouldFlipBeforeAfter ? computedValues.m_margins.m_after : compu
tedValues.m_margins.m_before, |
2750 shouldFlipBeforeAfter ? computedValues.m_margins.m_before :
computedValues.m_margins.m_after); | 2750 shouldFlipBeforeAfter ? computedValues.m_margins.m_before : comp
utedValues.m_margins.m_after); |
2751 } | 2751 } |
2752 } | 2752 } |
2753 | 2753 |
2754 // WinIE quirk: The <html> block always fills the entire canvas in quirks mo
de. The <body> always fills the | 2754 // WinIE quirk: The <html> block always fills the entire canvas in quirks mo
de. The <body> always fills the |
2755 // <html> block in quirks mode. Only apply this quirk if the block is norma
l flow and no height | 2755 // <html> block in quirks mode. Only apply this quirk if the block is norma
l flow and no height |
2756 // is specified. When we're printing, we also need this quirk if the body or
root has a percentage | 2756 // is specified. When we're printing, we also need this quirk if the body or
root has a percentage |
2757 // height since we don't set a height in RenderView when we're printing. So
without this quirk, the | 2757 // height since we don't set a height in RenderView when we're printing. So
without this quirk, the |
2758 // height has nothing to be a percentage of, and it ends up being 0. That is
bad. | 2758 // height has nothing to be a percentage of, and it ends up being 0. That is
bad. |
2759 bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercent(
) | 2759 bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercent(
) |
2760 && (isRoot() || (isBody() && document().documentElement()->renderer()->s
tyle()->logicalHeight().isPercent())) && !isInline(); | 2760 && (isRoot() || (isBody() && document().documentElement()->renderer()->s
tyle()->logicalHeight().isPercent())) && !isInline(); |
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4908 return 0; | 4908 return 0; |
4909 | 4909 |
4910 if (!layoutState && !flowThreadContainingBlock()) | 4910 if (!layoutState && !flowThreadContainingBlock()) |
4911 return 0; | 4911 return 0; |
4912 | 4912 |
4913 RenderBlock* containerBlock = containingBlock(); | 4913 RenderBlock* containerBlock = containingBlock(); |
4914 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4914 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4915 } | 4915 } |
4916 | 4916 |
4917 } // namespace WebCore | 4917 } // namespace WebCore |
OLD | NEW |