| 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. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. |
| 7 * All rights reserved. | 7 * All rights reserved. |
| 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2149 return !isMulticolValue; | 2149 return !isMulticolValue; |
| 2150 if (isMulticolValue) | 2150 if (isMulticolValue) |
| 2151 return true; | 2151 return true; |
| 2152 // If this is a flow thread for a multicol container, and we have a break | 2152 // If this is a flow thread for a multicol container, and we have a break |
| 2153 // value for paged, we need to keep looking. | 2153 // value for paged, we need to keep looking. |
| 2154 } | 2154 } |
| 2155 if (curr->isFloatingOrOutOfFlowPositioned()) | 2155 if (curr->isFloatingOrOutOfFlowPositioned()) |
| 2156 return false; | 2156 return false; |
| 2157 curr = curr->containingBlock(); | 2157 curr = curr->containingBlock(); |
| 2158 } | 2158 } |
| 2159 ASSERT_NOT_REACHED(); | 2159 NOTREACHED(); |
| 2160 return false; | 2160 return false; |
| 2161 } | 2161 } |
| 2162 | 2162 |
| 2163 bool LayoutBox::isBreakInsideControllable(EBreakInside breakValue) const { | 2163 bool LayoutBox::isBreakInsideControllable(EBreakInside breakValue) const { |
| 2164 if (breakValue == EBreakInside::kAuto) | 2164 if (breakValue == EBreakInside::kAuto) |
| 2165 return true; | 2165 return true; |
| 2166 // First check multicol. | 2166 // First check multicol. |
| 2167 const LayoutFlowThread* flowThread = flowThreadContainingBlock(); | 2167 const LayoutFlowThread* flowThread = flowThreadContainingBlock(); |
| 2168 // 'avoid-column' is only valid in a multicol context. | 2168 // 'avoid-column' is only valid in a multicol context. |
| 2169 if (breakValue == EBreakInside::kAvoidColumn) | 2169 if (breakValue == EBreakInside::kAvoidColumn) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2222 // "avoid*" values win over "auto". | 2222 // "avoid*" values win over "auto". |
| 2223 // "avoid-page" wins over "avoid-column". | 2223 // "avoid-page" wins over "avoid-column". |
| 2224 // "avoid" wins over "avoid-page". | 2224 // "avoid" wins over "avoid-page". |
| 2225 // Forced break values win over "avoid". | 2225 // Forced break values win over "avoid". |
| 2226 // Any forced page break value wins over "column" forced break. | 2226 // Any forced page break value wins over "column" forced break. |
| 2227 // More specific break values (left, right, recto, verso) wins over generic | 2227 // More specific break values (left, right, recto, verso) wins over generic |
| 2228 // "page" values. | 2228 // "page" values. |
| 2229 | 2229 |
| 2230 switch (breakValue) { | 2230 switch (breakValue) { |
| 2231 default: | 2231 default: |
| 2232 ASSERT_NOT_REACHED(); | 2232 NOTREACHED(); |
| 2233 // fall-through | 2233 // fall-through |
| 2234 case EBreakBetween::kAuto: | 2234 case EBreakBetween::kAuto: |
| 2235 return 0; | 2235 return 0; |
| 2236 case EBreakBetween::kAvoidColumn: | 2236 case EBreakBetween::kAvoidColumn: |
| 2237 return 1; | 2237 return 1; |
| 2238 case EBreakBetween::kAvoidPage: | 2238 case EBreakBetween::kAvoidPage: |
| 2239 return 2; | 2239 return 2; |
| 2240 case EBreakBetween::kAvoid: | 2240 case EBreakBetween::kAvoid: |
| 2241 return 3; | 2241 return 3; |
| 2242 case EBreakBetween::kColumn: | 2242 case EBreakBetween::kColumn: |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2678 return maxLogicalWidth + borderAndPadding; | 2678 return maxLogicalWidth + borderAndPadding; |
| 2679 | 2679 |
| 2680 if (logicalWidthLength.type() == FitContent) { | 2680 if (logicalWidthLength.type() == FitContent) { |
| 2681 minLogicalWidth += borderAndPadding; | 2681 minLogicalWidth += borderAndPadding; |
| 2682 maxLogicalWidth += borderAndPadding; | 2682 maxLogicalWidth += borderAndPadding; |
| 2683 return std::max( | 2683 return std::max( |
| 2684 minLogicalWidth, | 2684 minLogicalWidth, |
| 2685 std::min(maxLogicalWidth, fillAvailableMeasure(availableLogicalWidth))); | 2685 std::min(maxLogicalWidth, fillAvailableMeasure(availableLogicalWidth))); |
| 2686 } | 2686 } |
| 2687 | 2687 |
| 2688 ASSERT_NOT_REACHED(); | 2688 NOTREACHED(); |
| 2689 return LayoutUnit(); | 2689 return LayoutUnit(); |
| 2690 } | 2690 } |
| 2691 | 2691 |
| 2692 DISABLE_CFI_PERF | 2692 DISABLE_CFI_PERF |
| 2693 LayoutUnit LayoutBox::computeLogicalWidthUsing(SizeType widthType, | 2693 LayoutUnit LayoutBox::computeLogicalWidthUsing(SizeType widthType, |
| 2694 const Length& logicalWidth, | 2694 const Length& logicalWidth, |
| 2695 LayoutUnit availableLogicalWidth, | 2695 LayoutUnit availableLogicalWidth, |
| 2696 const LayoutBlock* cb) const { | 2696 const LayoutBlock* cb) const { |
| 2697 ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || | 2697 ASSERT(widthType == MinSize || widthType == MainOrPreferredSize || |
| 2698 !logicalWidth.isAuto()); | 2698 !logicalWidth.isAuto()); |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3155 logicalHeightLength.isMaxContent() || | 3155 logicalHeightLength.isMaxContent() || |
| 3156 logicalHeightLength.isFitContent()) { | 3156 logicalHeightLength.isFitContent()) { |
| 3157 if (isAtomicInlineLevel()) | 3157 if (isAtomicInlineLevel()) |
| 3158 return intrinsicSize().height(); | 3158 return intrinsicSize().height(); |
| 3159 return intrinsicContentHeight; | 3159 return intrinsicContentHeight; |
| 3160 } | 3160 } |
| 3161 if (logicalHeightLength.isFillAvailable()) | 3161 if (logicalHeightLength.isFillAvailable()) |
| 3162 return containingBlock()->availableLogicalHeight( | 3162 return containingBlock()->availableLogicalHeight( |
| 3163 ExcludeMarginBorderPadding) - | 3163 ExcludeMarginBorderPadding) - |
| 3164 borderAndPadding; | 3164 borderAndPadding; |
| 3165 ASSERT_NOT_REACHED(); | 3165 NOTREACHED(); |
| 3166 return LayoutUnit(); | 3166 return LayoutUnit(); |
| 3167 } | 3167 } |
| 3168 | 3168 |
| 3169 LayoutUnit LayoutBox::computeContentAndScrollbarLogicalHeightUsing( | 3169 LayoutUnit LayoutBox::computeContentAndScrollbarLogicalHeightUsing( |
| 3170 SizeType heightType, | 3170 SizeType heightType, |
| 3171 const Length& height, | 3171 const Length& height, |
| 3172 LayoutUnit intrinsicContentHeight) const { | 3172 LayoutUnit intrinsicContentHeight) const { |
| 3173 if (height.isAuto()) | 3173 if (height.isAuto()) |
| 3174 return heightType == MinSize ? LayoutUnit() : LayoutUnit(-1); | 3174 return heightType == MinSize ? LayoutUnit() : LayoutUnit(-1); |
| 3175 // FIXME(cbiesinger): The css-sizing spec is considering changing what | 3175 // FIXME(cbiesinger): The css-sizing spec is considering changing what |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3375 } | 3375 } |
| 3376 case Auto: | 3376 case Auto: |
| 3377 case MaxSizeNone: | 3377 case MaxSizeNone: |
| 3378 return intrinsicLogicalWidth(); | 3378 return intrinsicLogicalWidth(); |
| 3379 case ExtendToZoom: | 3379 case ExtendToZoom: |
| 3380 case DeviceWidth: | 3380 case DeviceWidth: |
| 3381 case DeviceHeight: | 3381 case DeviceHeight: |
| 3382 break; | 3382 break; |
| 3383 } | 3383 } |
| 3384 | 3384 |
| 3385 ASSERT_NOT_REACHED(); | 3385 NOTREACHED(); |
| 3386 return LayoutUnit(); | 3386 return LayoutUnit(); |
| 3387 } | 3387 } |
| 3388 | 3388 |
| 3389 LayoutUnit LayoutBox::computeReplacedLogicalHeight(LayoutUnit) const { | 3389 LayoutUnit LayoutBox::computeReplacedLogicalHeight(LayoutUnit) const { |
| 3390 return computeReplacedLogicalHeightRespectingMinMaxHeight( | 3390 return computeReplacedLogicalHeightRespectingMinMaxHeight( |
| 3391 computeReplacedLogicalHeightUsing(MainOrPreferredSize, | 3391 computeReplacedLogicalHeightUsing(MainOrPreferredSize, |
| 3392 style()->logicalHeight())); | 3392 style()->logicalHeight())); |
| 3393 } | 3393 } |
| 3394 | 3394 |
| 3395 bool LayoutBox::logicalHeightComputesAsNone(SizeType sizeType) const { | 3395 bool LayoutBox::logicalHeightComputesAsNone(SizeType sizeType) const { |
| (...skipping 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5753 | 5753 |
| 5754 void LayoutBox::MutableForPainting:: | 5754 void LayoutBox::MutableForPainting:: |
| 5755 savePreviousContentBoxSizeAndLayoutOverflowRect() { | 5755 savePreviousContentBoxSizeAndLayoutOverflowRect() { |
| 5756 auto& rareData = layoutBox().ensureRareData(); | 5756 auto& rareData = layoutBox().ensureRareData(); |
| 5757 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true; | 5757 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true; |
| 5758 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size(); | 5758 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size(); |
| 5759 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect(); | 5759 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect(); |
| 5760 } | 5760 } |
| 5761 | 5761 |
| 5762 } // namespace blink | 5762 } // namespace blink |
| OLD | NEW |