| 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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (!oldStyle->hasOutOfFlowPosition() && | 208 if (!oldStyle->hasOutOfFlowPosition() && |
| 209 newStyle.hasOutOfFlowPosition()) { | 209 newStyle.hasOutOfFlowPosition()) { |
| 210 // We're about to go out of flow. Before that takes place, we need to | 210 // We're about to go out of flow. Before that takes place, we need to |
| 211 // mark the current containing block chain for preferred widths | 211 // mark the current containing block chain for preferred widths |
| 212 // recalculation. | 212 // recalculation. |
| 213 setNeedsLayoutAndPrefWidthsRecalc( | 213 setNeedsLayoutAndPrefWidthsRecalc( |
| 214 LayoutInvalidationReason::StyleChange); | 214 LayoutInvalidationReason::StyleChange); |
| 215 } else { | 215 } else { |
| 216 markContainerChainForLayout(); | 216 markContainerChainForLayout(); |
| 217 } | 217 } |
| 218 if (oldStyle->position() == StaticPosition) | 218 if (oldStyle->position() == EPosition::kStatic) |
| 219 setShouldDoFullPaintInvalidation(); | 219 setShouldDoFullPaintInvalidation(); |
| 220 else if (newStyle.hasOutOfFlowPosition()) | 220 else if (newStyle.hasOutOfFlowPosition()) |
| 221 parent()->setChildNeedsLayout(); | 221 parent()->setChildNeedsLayout(); |
| 222 if (isFloating() && !isOutOfFlowPositioned() && | 222 if (isFloating() && !isOutOfFlowPositioned() && |
| 223 newStyle.hasOutOfFlowPosition()) | 223 newStyle.hasOutOfFlowPosition()) |
| 224 removeFloatingOrPositionedChildFromBlockLists(); | 224 removeFloatingOrPositionedChildFromBlockLists(); |
| 225 } | 225 } |
| 226 // FIXME: This branch runs when !oldStyle, which means that layout was never | 226 // FIXME: This branch runs when !oldStyle, which means that layout was never |
| 227 // called so what's the point in invalidating the whole view that we never | 227 // called so what's the point in invalidating the whole view that we never |
| 228 // painted? | 228 // painted? |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 } else { | 692 } else { |
| 693 parentBox = nullptr; | 693 parentBox = nullptr; |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 } | 696 } |
| 697 } | 697 } |
| 698 } | 698 } |
| 699 | 699 |
| 700 // If we are fixed-position and stick to the viewport, it is useless to | 700 // If we are fixed-position and stick to the viewport, it is useless to |
| 701 // scroll the parent. | 701 // scroll the parent. |
| 702 if (style()->position() == FixedPosition && | 702 if (style()->position() == EPosition::kFixed && |
| 703 containerForFixedPosition() == view()) { | 703 containerForFixedPosition() == view()) { |
| 704 return; | 704 return; |
| 705 } | 705 } |
| 706 | 706 |
| 707 if (frame()->page()->autoscrollController().autoscrollInProgress()) | 707 if (frame()->page()->autoscrollController().autoscrollInProgress()) |
| 708 parentBox = enclosingScrollableBox(); | 708 parentBox = enclosingScrollableBox(); |
| 709 | 709 |
| 710 if (parentBox) | 710 if (parentBox) |
| 711 parentBox->scrollRectToVisible(newRect, alignX, alignY, scrollType, | 711 parentBox->scrollRectToVisible(newRect, alignX, alignY, scrollType, |
| 712 makeVisibleInVisualViewport); | 712 makeVisibleInVisualViewport); |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 return false; | 1533 return false; |
| 1534 if (hasClipPath()) | 1534 if (hasClipPath()) |
| 1535 return false; | 1535 return false; |
| 1536 if (style()->hasBlendMode()) | 1536 if (style()->hasBlendMode()) |
| 1537 return false; | 1537 return false; |
| 1538 return backgroundRect(BackgroundKnownOpaqueRect).contains(localRect); | 1538 return backgroundRect(BackgroundKnownOpaqueRect).contains(localRect); |
| 1539 } | 1539 } |
| 1540 | 1540 |
| 1541 static bool isCandidateForOpaquenessTest(const LayoutBox& childBox) { | 1541 static bool isCandidateForOpaquenessTest(const LayoutBox& childBox) { |
| 1542 const ComputedStyle& childStyle = childBox.styleRef(); | 1542 const ComputedStyle& childStyle = childBox.styleRef(); |
| 1543 if (childStyle.position() != StaticPosition && | 1543 if (childStyle.position() != EPosition::kStatic && |
| 1544 childBox.containingBlock() != childBox.parent()) | 1544 childBox.containingBlock() != childBox.parent()) |
| 1545 return false; | 1545 return false; |
| 1546 if (childStyle.visibility() != EVisibility::kVisible || | 1546 if (childStyle.visibility() != EVisibility::kVisible || |
| 1547 childStyle.shapeOutside()) | 1547 childStyle.shapeOutside()) |
| 1548 return false; | 1548 return false; |
| 1549 if (childBox.size().isZero()) | 1549 if (childBox.size().isZero()) |
| 1550 return false; | 1550 return false; |
| 1551 if (PaintLayer* childLayer = childBox.layer()) { | 1551 if (PaintLayer* childLayer = childBox.layer()) { |
| 1552 // FIXME: perhaps this could be less conservative? | 1552 // FIXME: perhaps this could be less conservative? |
| 1553 if (childLayer->compositingState() != NotComposited) | 1553 if (childLayer->compositingState() != NotComposited) |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1908 | 1908 |
| 1909 LayoutUnit LayoutBox::containingBlockLogicalHeightForGetComputedStyle() const { | 1909 LayoutUnit LayoutBox::containingBlockLogicalHeightForGetComputedStyle() const { |
| 1910 if (hasOverrideContainingBlockLogicalHeight()) | 1910 if (hasOverrideContainingBlockLogicalHeight()) |
| 1911 return overrideContainingBlockContentLogicalHeight(); | 1911 return overrideContainingBlockContentLogicalHeight(); |
| 1912 | 1912 |
| 1913 if (!isPositioned()) | 1913 if (!isPositioned()) |
| 1914 return containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); | 1914 return containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding); |
| 1915 | 1915 |
| 1916 LayoutBoxModelObject* cb = toLayoutBoxModelObject(container()); | 1916 LayoutBoxModelObject* cb = toLayoutBoxModelObject(container()); |
| 1917 LayoutUnit height = containingBlockLogicalHeightForPositioned(cb); | 1917 LayoutUnit height = containingBlockLogicalHeightForPositioned(cb); |
| 1918 if (styleRef().position() != AbsolutePosition) | 1918 if (styleRef().position() != EPosition::kAbsolute) |
| 1919 height -= cb->paddingLogicalHeight(); | 1919 height -= cb->paddingLogicalHeight(); |
| 1920 return height; | 1920 return height; |
| 1921 } | 1921 } |
| 1922 | 1922 |
| 1923 LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const { | 1923 LayoutUnit LayoutBox::containingBlockLogicalWidthForContent() const { |
| 1924 if (hasOverrideContainingBlockLogicalWidth()) | 1924 if (hasOverrideContainingBlockLogicalWidth()) |
| 1925 return overrideContainingBlockContentLogicalWidth(); | 1925 return overrideContainingBlockContentLogicalWidth(); |
| 1926 | 1926 |
| 1927 LayoutBlock* cb = containingBlock(); | 1927 LayoutBlock* cb = containingBlock(); |
| 1928 if (isOutOfFlowPositioned()) | 1928 if (isOutOfFlowPositioned()) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1974 } | 1974 } |
| 1975 | 1975 |
| 1976 // Use the content box logical height as specified by the style. | 1976 // Use the content box logical height as specified by the style. |
| 1977 return cb->adjustContentBoxLogicalHeightForBoxSizing( | 1977 return cb->adjustContentBoxLogicalHeightForBoxSizing( |
| 1978 LayoutUnit(logicalHeightLength.value())); | 1978 LayoutUnit(logicalHeightLength.value())); |
| 1979 } | 1979 } |
| 1980 | 1980 |
| 1981 void LayoutBox::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, | 1981 void LayoutBox::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, |
| 1982 TransformState& transformState, | 1982 TransformState& transformState, |
| 1983 MapCoordinatesFlags mode) const { | 1983 MapCoordinatesFlags mode) const { |
| 1984 bool isFixedPos = style()->position() == FixedPosition; | 1984 bool isFixedPos = style()->position() == EPosition::kFixed; |
| 1985 | 1985 |
| 1986 // If this box has a transform or contains paint, it acts as a fixed position | 1986 // If this box has a transform or contains paint, it acts as a fixed position |
| 1987 // container for fixed descendants, and may itself also be fixed position. So | 1987 // container for fixed descendants, and may itself also be fixed position. So |
| 1988 // propagate 'fixed' up only if this box is fixed position. | 1988 // propagate 'fixed' up only if this box is fixed position. |
| 1989 if (style()->canContainFixedPositionObjects() && !isFixedPos) | 1989 if (style()->canContainFixedPositionObjects() && !isFixedPos) |
| 1990 mode &= ~IsFixed; | 1990 mode &= ~IsFixed; |
| 1991 else if (isFixedPos) | 1991 else if (isFixedPos) |
| 1992 mode |= IsFixed; | 1992 mode |= IsFixed; |
| 1993 | 1993 |
| 1994 LayoutBoxModelObject::mapLocalToAncestor(ancestor, transformState, mode); | 1994 LayoutBoxModelObject::mapLocalToAncestor(ancestor, transformState, mode); |
| 1995 } | 1995 } |
| 1996 | 1996 |
| 1997 void LayoutBox::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, | 1997 void LayoutBox::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, |
| 1998 TransformState& transformState, | 1998 TransformState& transformState, |
| 1999 MapCoordinatesFlags mode) const { | 1999 MapCoordinatesFlags mode) const { |
| 2000 if (this == ancestor) | 2000 if (this == ancestor) |
| 2001 return; | 2001 return; |
| 2002 | 2002 |
| 2003 bool isFixedPos = style()->position() == FixedPosition; | 2003 bool isFixedPos = style()->position() == EPosition::kFixed; |
| 2004 | 2004 |
| 2005 // If this box has a transform or contains paint, it acts as a fixed position | 2005 // If this box has a transform or contains paint, it acts as a fixed position |
| 2006 // container for fixed descendants, and may itself also be fixed position. So | 2006 // container for fixed descendants, and may itself also be fixed position. So |
| 2007 // propagate 'fixed' up only if this box is fixed position. | 2007 // propagate 'fixed' up only if this box is fixed position. |
| 2008 if (style()->canContainFixedPositionObjects() && !isFixedPos) | 2008 if (style()->canContainFixedPositionObjects() && !isFixedPos) |
| 2009 mode &= ~IsFixed; | 2009 mode &= ~IsFixed; |
| 2010 else if (isFixedPos) | 2010 else if (isFixedPos) |
| 2011 mode |= IsFixed; | 2011 mode |= IsFixed; |
| 2012 | 2012 |
| 2013 LayoutBoxModelObject::mapAncestorToLocal(ancestor, transformState, mode); | 2013 LayoutBoxModelObject::mapAncestorToLocal(ancestor, transformState, mode); |
| 2014 } | 2014 } |
| 2015 | 2015 |
| 2016 LayoutSize LayoutBox::offsetFromContainer(const LayoutObject* o) const { | 2016 LayoutSize LayoutBox::offsetFromContainer(const LayoutObject* o) const { |
| 2017 ASSERT(o == container()); | 2017 ASSERT(o == container()); |
| 2018 | 2018 |
| 2019 LayoutSize offset; | 2019 LayoutSize offset; |
| 2020 if (isInFlowPositioned()) | 2020 if (isInFlowPositioned()) |
| 2021 offset += offsetForInFlowPosition(); | 2021 offset += offsetForInFlowPosition(); |
| 2022 | 2022 |
| 2023 offset += physicalLocationOffset(); | 2023 offset += physicalLocationOffset(); |
| 2024 | 2024 |
| 2025 if (o->hasOverflowClip()) | 2025 if (o->hasOverflowClip()) |
| 2026 offset -= toLayoutBox(o)->scrolledContentOffset(); | 2026 offset -= toLayoutBox(o)->scrolledContentOffset(); |
| 2027 | 2027 |
| 2028 if (style()->position() == AbsolutePosition && o->isInFlowPositioned() && | 2028 if (style()->position() == EPosition::kAbsolute && o->isInFlowPositioned() && |
| 2029 o->isLayoutInline()) | 2029 o->isLayoutInline()) |
| 2030 offset += toLayoutInline(o)->offsetForInFlowPositionedInline(*this); | 2030 offset += toLayoutInline(o)->offsetForInFlowPositionedInline(*this); |
| 2031 | 2031 |
| 2032 return offset; | 2032 return offset; |
| 2033 } | 2033 } |
| 2034 | 2034 |
| 2035 InlineBox* LayoutBox::createInlineBox() { | 2035 InlineBox* LayoutBox::createInlineBox() { |
| 2036 return new InlineBox(LineLayoutItem(this)); | 2036 return new InlineBox(LineLayoutItem(this)); |
| 2037 } | 2037 } |
| 2038 | 2038 |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2390 // TODO(wkorman): Generalize Ruby specialization and/or document more | 2390 // TODO(wkorman): Generalize Ruby specialization and/or document more |
| 2391 // clearly. See the accompanying specialization in | 2391 // clearly. See the accompanying specialization in |
| 2392 // LayoutInline::mapToVisualRectInAncestorSpace. | 2392 // LayoutInline::mapToVisualRectInAncestorSpace. |
| 2393 topLeft.moveBy(physicalLocation()); | 2393 topLeft.moveBy(physicalLocation()); |
| 2394 } else { | 2394 } else { |
| 2395 topLeft.moveBy(location()); | 2395 topLeft.moveBy(location()); |
| 2396 } | 2396 } |
| 2397 | 2397 |
| 2398 const ComputedStyle& styleToUse = styleRef(); | 2398 const ComputedStyle& styleToUse = styleRef(); |
| 2399 EPosition position = styleToUse.position(); | 2399 EPosition position = styleToUse.position(); |
| 2400 if (position == AbsolutePosition && container->isInFlowPositioned() && | 2400 if (position == EPosition::kAbsolute && container->isInFlowPositioned() && |
| 2401 container->isLayoutInline()) { | 2401 container->isLayoutInline()) { |
| 2402 topLeft += | 2402 topLeft += |
| 2403 toLayoutInline(container)->offsetForInFlowPositionedInline(*this); | 2403 toLayoutInline(container)->offsetForInFlowPositionedInline(*this); |
| 2404 } else if (styleToUse.hasInFlowPosition() && layer()) { | 2404 } else if (styleToUse.hasInFlowPosition() && layer()) { |
| 2405 // Apply the relative position offset when invalidating a rectangle. The | 2405 // Apply the relative position offset when invalidating a rectangle. The |
| 2406 // layer is translated, but the layout box isn't, so we need to do this to | 2406 // layer is translated, but the layout box isn't, so we need to do this to |
| 2407 // get the right dirty rect. Since this is called from | 2407 // get the right dirty rect. Since this is called from |
| 2408 // LayoutObject::setStyle, the relative position flag on the LayoutObject | 2408 // LayoutObject::setStyle, the relative position flag on the LayoutObject |
| 2409 // has been cleared, so use the one on the style(). | 2409 // has been cleared, so use the one on the style(). |
| 2410 topLeft += layer()->offsetForInFlowPosition(); | 2410 topLeft += layer()->offsetForInFlowPosition(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 2421 return false; | 2421 return false; |
| 2422 | 2422 |
| 2423 if (skipInfo.ancestorSkipped()) { | 2423 if (skipInfo.ancestorSkipped()) { |
| 2424 // If the ancestor is below the container, then we need to map the rect into | 2424 // If the ancestor is below the container, then we need to map the rect into |
| 2425 // ancestor's coordinates. | 2425 // ancestor's coordinates. |
| 2426 LayoutSize containerOffset = | 2426 LayoutSize containerOffset = |
| 2427 ancestor->offsetFromAncestorContainer(container); | 2427 ancestor->offsetFromAncestorContainer(container); |
| 2428 rect.move(-containerOffset); | 2428 rect.move(-containerOffset); |
| 2429 // If the ancestor is fixed, then the rect is already in its coordinates so | 2429 // If the ancestor is fixed, then the rect is already in its coordinates so |
| 2430 // doesn't need viewport-adjusting. | 2430 // doesn't need viewport-adjusting. |
| 2431 if (ancestor->style()->position() != FixedPosition && | 2431 if (ancestor->style()->position() != EPosition::kFixed && |
| 2432 container->isLayoutView() && position == FixedPosition) | 2432 container->isLayoutView() && position == EPosition::kFixed) |
| 2433 rect.move(toLayoutView(container)->offsetForFixedPosition(true)); | 2433 rect.move(toLayoutView(container)->offsetForFixedPosition(true)); |
| 2434 return true; | 2434 return true; |
| 2435 } | 2435 } |
| 2436 | 2436 |
| 2437 if (container->isLayoutView()) | 2437 if (container->isLayoutView()) |
| 2438 return toLayoutView(container)->mapToVisualRectInAncestorSpace( | 2438 return toLayoutView(container)->mapToVisualRectInAncestorSpace( |
| 2439 ancestor, rect, position == FixedPosition ? IsFixed : 0, | 2439 ancestor, rect, position == EPosition::kFixed ? IsFixed : 0, |
| 2440 visualRectFlags); | 2440 visualRectFlags); |
| 2441 else | 2441 else |
| 2442 return container->mapToVisualRectInAncestorSpace(ancestor, rect, | 2442 return container->mapToVisualRectInAncestorSpace(ancestor, rect, |
| 2443 visualRectFlags); | 2443 visualRectFlags); |
| 2444 } | 2444 } |
| 2445 | 2445 |
| 2446 void LayoutBox::inflateVisualRectForFilter(LayoutRect& visualRect) const { | 2446 void LayoutBox::inflateVisualRectForFilter(LayoutRect& visualRect) const { |
| 2447 if (layer() && layer()->hasFilterInducingProperty()) | 2447 if (layer() && layer()->hasFilterInducingProperty()) |
| 2448 visualRect = layer()->mapLayoutRectForFilter(visualRect); | 2448 visualRect = layer()->mapLayoutRectForFilter(visualRect); |
| 2449 } | 2449 } |
| (...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3600 } | 3600 } |
| 3601 | 3601 |
| 3602 LayoutUnit LayoutBox::containingBlockLogicalWidthForPositioned( | 3602 LayoutUnit LayoutBox::containingBlockLogicalWidthForPositioned( |
| 3603 const LayoutBoxModelObject* containingBlock, | 3603 const LayoutBoxModelObject* containingBlock, |
| 3604 bool checkForPerpendicularWritingMode) const { | 3604 bool checkForPerpendicularWritingMode) const { |
| 3605 if (checkForPerpendicularWritingMode && | 3605 if (checkForPerpendicularWritingMode && |
| 3606 containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode()) | 3606 containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode()) |
| 3607 return containingBlockLogicalHeightForPositioned(containingBlock, false); | 3607 return containingBlockLogicalHeightForPositioned(containingBlock, false); |
| 3608 | 3608 |
| 3609 // Use viewport as container for top-level fixed-position elements. | 3609 // Use viewport as container for top-level fixed-position elements. |
| 3610 if (style()->position() == FixedPosition && containingBlock->isLayoutView() && | 3610 if (style()->position() == EPosition::kFixed && |
| 3611 !document().printing()) { | 3611 containingBlock->isLayoutView() && !document().printing()) { |
| 3612 const LayoutView* view = toLayoutView(containingBlock); | 3612 const LayoutView* view = toLayoutView(containingBlock); |
| 3613 if (FrameView* frameView = view->frameView()) { | 3613 if (FrameView* frameView = view->frameView()) { |
| 3614 // Don't use visibleContentRect since the PaintLayer's size has not been | 3614 // Don't use visibleContentRect since the PaintLayer's size has not been |
| 3615 // set yet. | 3615 // set yet. |
| 3616 LayoutSize viewportSize( | 3616 LayoutSize viewportSize( |
| 3617 frameView->layoutViewportScrollableArea()->excludeScrollbars( | 3617 frameView->layoutViewportScrollableArea()->excludeScrollbars( |
| 3618 frameView->frameRect().size())); | 3618 frameView->frameRect().size())); |
| 3619 return LayoutUnit(containingBlock->isHorizontalWritingMode() | 3619 return LayoutUnit(containingBlock->isHorizontalWritingMode() |
| 3620 ? viewportSize.width() | 3620 ? viewportSize.width() |
| 3621 : viewportSize.height()); | 3621 : viewportSize.height()); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3661 } | 3661 } |
| 3662 | 3662 |
| 3663 LayoutUnit LayoutBox::containingBlockLogicalHeightForPositioned( | 3663 LayoutUnit LayoutBox::containingBlockLogicalHeightForPositioned( |
| 3664 const LayoutBoxModelObject* containingBlock, | 3664 const LayoutBoxModelObject* containingBlock, |
| 3665 bool checkForPerpendicularWritingMode) const { | 3665 bool checkForPerpendicularWritingMode) const { |
| 3666 if (checkForPerpendicularWritingMode && | 3666 if (checkForPerpendicularWritingMode && |
| 3667 containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode()) | 3667 containingBlock->isHorizontalWritingMode() != isHorizontalWritingMode()) |
| 3668 return containingBlockLogicalWidthForPositioned(containingBlock, false); | 3668 return containingBlockLogicalWidthForPositioned(containingBlock, false); |
| 3669 | 3669 |
| 3670 // Use viewport as container for top-level fixed-position elements. | 3670 // Use viewport as container for top-level fixed-position elements. |
| 3671 if (style()->position() == FixedPosition && containingBlock->isLayoutView() && | 3671 if (style()->position() == EPosition::kFixed && |
| 3672 !document().printing()) { | 3672 containingBlock->isLayoutView() && !document().printing()) { |
| 3673 const LayoutView* view = toLayoutView(containingBlock); | 3673 const LayoutView* view = toLayoutView(containingBlock); |
| 3674 if (FrameView* frameView = view->frameView()) { | 3674 if (FrameView* frameView = view->frameView()) { |
| 3675 // Don't use visibleContentRect since the PaintLayer's size has not been | 3675 // Don't use visibleContentRect since the PaintLayer's size has not been |
| 3676 // set yet. | 3676 // set yet. |
| 3677 LayoutSize viewportSize( | 3677 LayoutSize viewportSize( |
| 3678 frameView->layoutViewportScrollableArea()->excludeScrollbars( | 3678 frameView->layoutViewportScrollableArea()->excludeScrollbars( |
| 3679 frameView->frameRect().size())); | 3679 frameView->frameRect().size())); |
| 3680 return containingBlock->isHorizontalWritingMode() ? viewportSize.height() | 3680 return containingBlock->isHorizontalWritingMode() ? viewportSize.height() |
| 3681 : viewportSize.width(); | 3681 : viewportSize.width(); |
| 3682 } | 3682 } |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5042 style()->logicalMinHeight().isPositive() && | 5042 style()->logicalMinHeight().isPositive() && |
| 5043 (!style()->logicalMinHeight().isPercentOrCalc() || | 5043 (!style()->logicalMinHeight().isPercentOrCalc() || |
| 5044 percentageLogicalHeightIsResolvable())); | 5044 percentageLogicalHeightIsResolvable())); |
| 5045 } | 5045 } |
| 5046 | 5046 |
| 5047 LayoutBox::PaginationBreakability LayoutBox::getPaginationBreakability() const { | 5047 LayoutBox::PaginationBreakability LayoutBox::getPaginationBreakability() const { |
| 5048 // TODO(mstensho): It is wrong to check isAtomicInlineLevel() as we | 5048 // TODO(mstensho): It is wrong to check isAtomicInlineLevel() as we |
| 5049 // actually look for replaced elements. | 5049 // actually look for replaced elements. |
| 5050 if (isAtomicInlineLevel() || hasUnsplittableScrollingOverflow() || | 5050 if (isAtomicInlineLevel() || hasUnsplittableScrollingOverflow() || |
| 5051 (parent() && isWritingModeRoot()) || | 5051 (parent() && isWritingModeRoot()) || |
| 5052 (isOutOfFlowPositioned() && style()->position() == FixedPosition)) | 5052 (isOutOfFlowPositioned() && style()->position() == EPosition::kFixed)) |
| 5053 return ForbidBreaks; | 5053 return ForbidBreaks; |
| 5054 | 5054 |
| 5055 EBreakInside breakValue = breakInside(); | 5055 EBreakInside breakValue = breakInside(); |
| 5056 if (breakValue == EBreakInside::kAvoid || | 5056 if (breakValue == EBreakInside::kAvoid || |
| 5057 breakValue == EBreakInside::kAvoidPage || | 5057 breakValue == EBreakInside::kAvoidPage || |
| 5058 breakValue == EBreakInside::kAvoidColumn) | 5058 breakValue == EBreakInside::kAvoidColumn) |
| 5059 return AvoidBreaks; | 5059 return AvoidBreaks; |
| 5060 return AllowAnyBreaks; | 5060 return AllowAnyBreaks; |
| 5061 } | 5061 } |
| 5062 | 5062 |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5714 block->adjustChildDebugRect(rect); | 5714 block->adjustChildDebugRect(rect); |
| 5715 | 5715 |
| 5716 return rect; | 5716 return rect; |
| 5717 } | 5717 } |
| 5718 | 5718 |
| 5719 bool LayoutBox::shouldClipOverflow() const { | 5719 bool LayoutBox::shouldClipOverflow() const { |
| 5720 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); | 5720 return hasOverflowClip() || styleRef().containsPaint() || hasControlClip(); |
| 5721 } | 5721 } |
| 5722 | 5722 |
| 5723 } // namespace blink | 5723 } // namespace blink |
| OLD | NEW |