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