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 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 | 2906 |
2907 switch (logicalHeight.type()) { | 2907 switch (logicalHeight.type()) { |
2908 case Fixed: | 2908 case Fixed: |
2909 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value()); | 2909 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value()); |
2910 case Percent: | 2910 case Percent: |
2911 case Calculated: | 2911 case Calculated: |
2912 { | 2912 { |
2913 LayoutObject* cb = isOutOfFlowPositioned() ? container() : containingBlo
ck(); | 2913 LayoutObject* cb = isOutOfFlowPositioned() ? container() : containingBlo
ck(); |
2914 while (cb->isAnonymous()) | 2914 while (cb->isAnonymous()) |
2915 cb = cb->containingBlock(); | 2915 cb = cb->containingBlock(); |
2916 LayoutUnit stretchedFlexHeight(-1); | 2916 LayoutUnit stretchedHeight(-1); |
2917 if (cb->isLayoutBlock()) { | 2917 if (cb->isLayoutBlock()) { |
2918 LayoutBlock* block = toLayoutBlock(cb); | 2918 LayoutBlock* block = toLayoutBlock(cb); |
2919 block->addPercentHeightDescendant(const_cast<LayoutBox*>(this)); | 2919 block->addPercentHeightDescendant(const_cast<LayoutBox*>(this)); |
2920 if (block->isFlexItem()) | 2920 if (block->isFlexItem()) |
2921 stretchedFlexHeight = toLayoutFlexibleBox(block->parent())->chil
dLogicalHeightForPercentageResolution(*block); | 2921 stretchedHeight = toLayoutFlexibleBox(block->parent())->childLog
icalHeightForPercentageResolution(*block); |
2922 | 2922 else if (block->isGridItem() && block->hasOverrideLogicalContentHeig
ht()) |
| 2923 stretchedHeight = block->overrideLogicalContentHeight(); |
2923 } | 2924 } |
2924 | 2925 |
2925 if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() && !(c
b->style()->top().isAuto() || cb->style()->bottom().isAuto())) { | 2926 if (cb->isOutOfFlowPositioned() && cb->style()->height().isAuto() && !(c
b->style()->top().isAuto() || cb->style()->bottom().isAuto())) { |
2926 ASSERT_WITH_SECURITY_IMPLICATION(cb->isLayoutBlock()); | 2927 ASSERT_WITH_SECURITY_IMPLICATION(cb->isLayoutBlock()); |
2927 LayoutBlock* block = toLayoutBlock(cb); | 2928 LayoutBlock* block = toLayoutBlock(cb); |
2928 LogicalExtentComputedValues computedValues; | 2929 LogicalExtentComputedValues computedValues; |
2929 block->computeLogicalHeight(block->logicalHeight(), LayoutUnit(), co
mputedValues); | 2930 block->computeLogicalHeight(block->logicalHeight(), LayoutUnit(), co
mputedValues); |
2930 LayoutUnit newContentHeight = computedValues.m_extent - block->borde
rAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); | 2931 LayoutUnit newContentHeight = computedValues.m_extent - block->borde
rAndPaddingLogicalHeight() - block->scrollbarLogicalHeight(); |
2931 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSiz
ing(newContentHeight); | 2932 LayoutUnit newHeight = block->adjustContentBoxLogicalHeightForBoxSiz
ing(newContentHeight); |
2932 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logi
calHeight, newHeight)); | 2933 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(logi
calHeight, newHeight)); |
2933 } | 2934 } |
2934 | 2935 |
2935 // FIXME: availableLogicalHeight() is wrong if the replaced element's wr
iting-mode is perpendicular to the | 2936 // FIXME: availableLogicalHeight() is wrong if the replaced element's wr
iting-mode is perpendicular to the |
2936 // containing block's writing-mode. | 2937 // containing block's writing-mode. |
2937 // https://bugs.webkit.org/show_bug.cgi?id=46496 | 2938 // https://bugs.webkit.org/show_bug.cgi?id=46496 |
2938 LayoutUnit availableHeight; | 2939 LayoutUnit availableHeight; |
2939 if (isOutOfFlowPositioned()) { | 2940 if (isOutOfFlowPositioned()) { |
2940 availableHeight = containingBlockLogicalHeightForPositioned(toLayout
BoxModelObject(cb)); | 2941 availableHeight = containingBlockLogicalHeightForPositioned(toLayout
BoxModelObject(cb)); |
2941 } else if (stretchedFlexHeight != -1) { | 2942 } else if (stretchedHeight != -1) { |
2942 availableHeight = stretchedFlexHeight; | 2943 availableHeight = stretchedHeight; |
| 2944 } else if (isGridItem() && hasOverrideContainingBlockLogicalHeight()) { |
| 2945 availableHeight = overrideContainingBlockContentLogicalHeight(); |
2943 } else { | 2946 } else { |
2944 availableHeight = containingBlockLogicalHeightForContent(IncludeMarg
inBorderPadding); | 2947 availableHeight = containingBlockLogicalHeightForContent(IncludeMarg
inBorderPadding); |
2945 // It is necessary to use the border-box to match WinIE's broken | 2948 // It is necessary to use the border-box to match WinIE's broken |
2946 // box model. This is essential for sizing inside | 2949 // box model. This is essential for sizing inside |
2947 // table cells using percentage heights. | 2950 // table cells using percentage heights. |
2948 // FIXME: This needs to be made writing-mode-aware. If the cell and
image are perpendicular writing-modes, this isn't right. | 2951 // FIXME: This needs to be made writing-mode-aware. If the cell and
image are perpendicular writing-modes, this isn't right. |
2949 // https://bugs.webkit.org/show_bug.cgi?id=46997 | 2952 // https://bugs.webkit.org/show_bug.cgi?id=46997 |
2950 while (cb && !cb->isLayoutView() && (cb->style()->logicalHeight().is
Auto() || cb->style()->logicalHeight().hasPercent())) { | 2953 while (cb && !cb->isLayoutView() && (cb->style()->logicalHeight().is
Auto() || cb->style()->logicalHeight().hasPercent())) { |
2951 if (cb->isTableCell()) { | 2954 if (cb->isTableCell()) { |
2952 // Don't let table cells squeeze percent-height replaced ele
ments | 2955 // Don't let table cells squeeze percent-height replaced ele
ments |
(...skipping 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4928 m_rareData->m_snapAreas->remove(&snapArea); | 4931 m_rareData->m_snapAreas->remove(&snapArea); |
4929 } | 4932 } |
4930 } | 4933 } |
4931 | 4934 |
4932 SnapAreaSet* LayoutBox::snapAreas() const | 4935 SnapAreaSet* LayoutBox::snapAreas() const |
4933 { | 4936 { |
4934 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; | 4937 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; |
4935 } | 4938 } |
4936 | 4939 |
4937 } // namespace blink | 4940 } // namespace blink |
OLD | NEW |