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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 if (isOrthogonalWritingModeRoot()) | 249 if (isOrthogonalWritingModeRoot()) |
250 markOrthogonalWritingModeRoot(); | 250 markOrthogonalWritingModeRoot(); |
251 else | 251 else |
252 unmarkOrthogonalWritingModeRoot(); | 252 unmarkOrthogonalWritingModeRoot(); |
253 } | 253 } |
254 | 254 |
255 clearPercentHeightDescendants(); | 255 clearPercentHeightDescendants(); |
256 } | 256 } |
257 | 257 |
258 // If our zoom factor changes and we have a defined scrollLeft/Top, we need to
adjust that value into the | 258 // If our zoom factor changes and we have a defined scrollLeft/Top, we need to
adjust that value into the |
259 // new zoomed coordinate space. Note that the new scroll position may be outs
ide the normal min/max | 259 // new zoomed coordinate space. Note that the new scroll offset may be outsid
e the normal min/max |
260 // range of the scrollable area, which is weird but OK, because the scrollable
area will update its | 260 // range of the scrollable area, which is weird but OK, because the scrollable
area will update its |
261 // min/max in updateAfterLayout(). | 261 // min/max in updateAfterLayout(). |
262 if (hasOverflowClip() && oldStyle && | 262 if (hasOverflowClip() && oldStyle && |
263 oldStyle->effectiveZoom() != newStyle.effectiveZoom()) { | 263 oldStyle->effectiveZoom() != newStyle.effectiveZoom()) { |
264 PaintLayerScrollableArea* scrollableArea = this->getScrollableArea(); | 264 PaintLayerScrollableArea* scrollableArea = this->getScrollableArea(); |
265 ASSERT(scrollableArea); | 265 ASSERT(scrollableArea); |
266 // We use scrollPosition() rather than offsetFromOrigin(), because scrollPos
ition is the distance | 266 // We use scrollOffset() rather than offsetFromOrigin(), because scrollOffse
t is the distance |
267 // from the beginning of flow for the box, which is the dimension we want to
preserve. | 267 // from the beginning of flow for the box, which is the dimension we want to
preserve. |
268 DoublePoint oldPosition = scrollableArea->scrollPositionDouble(); | 268 ScrollOffset oldOffset = scrollableArea->scrollOffset(); |
269 if (oldPosition.x() || oldPosition.y()) { | 269 if (oldOffset.width() || oldOffset.height()) { |
270 DoublePoint newPosition = oldPosition.scaledBy(newStyle.effectiveZoom() / | 270 ScrollOffset newOffset = oldOffset.scaledBy(newStyle.effectiveZoom() / |
271 oldStyle->effectiveZoom()); | 271 oldStyle->effectiveZoom()); |
272 scrollableArea->setScrollPositionUnconditionally(newPosition); | 272 scrollableArea->setScrollOffsetUnconditionally(newOffset); |
273 } | 273 } |
274 } | 274 } |
275 | 275 |
276 // Our opaqueness might have changed without triggering layout. | 276 // Our opaqueness might have changed without triggering layout. |
277 if (diff.needsPaintInvalidation()) { | 277 if (diff.needsPaintInvalidation()) { |
278 LayoutObject* parentToInvalidate = parent(); | 278 LayoutObject* parentToInvalidate = parent(); |
279 for (unsigned i = 0; | 279 for (unsigned i = 0; |
280 i < backgroundObscurationTestMaxDepth && parentToInvalidate; ++i) { | 280 i < backgroundObscurationTestMaxDepth && parentToInvalidate; ++i) { |
281 parentToInvalidate->invalidateBackgroundObscurationStatus(); | 281 parentToInvalidate->invalidateBackgroundObscurationStatus(); |
282 parentToInvalidate = parentToInvalidate->parent(); | 282 parentToInvalidate = parentToInvalidate->parent(); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 LayoutUnit LayoutBox::scrollHeight() const { | 508 LayoutUnit LayoutBox::scrollHeight() const { |
509 if (hasOverflowClip()) | 509 if (hasOverflowClip()) |
510 return getScrollableArea()->scrollHeight(); | 510 return getScrollableArea()->scrollHeight(); |
511 // For objects with visible overflow, this matches IE. | 511 // For objects with visible overflow, this matches IE. |
512 // FIXME: Need to work right with writing modes. | 512 // FIXME: Need to work right with writing modes. |
513 return std::max(clientHeight(), layoutOverflowRect().maxY() - borderTop()); | 513 return std::max(clientHeight(), layoutOverflowRect().maxY() - borderTop()); |
514 } | 514 } |
515 | 515 |
516 LayoutUnit LayoutBox::scrollLeft() const { | 516 LayoutUnit LayoutBox::scrollLeft() const { |
517 return hasOverflowClip() | 517 return hasOverflowClip() |
518 ? LayoutUnit(getScrollableArea()->offsetFromOrigin().width()) | 518 ? LayoutUnit(getScrollableArea()->absolutePosition().x()) |
519 : LayoutUnit(); | 519 : LayoutUnit(); |
520 } | 520 } |
521 | 521 |
522 LayoutUnit LayoutBox::scrollTop() const { | 522 LayoutUnit LayoutBox::scrollTop() const { |
523 return hasOverflowClip() | 523 return hasOverflowClip() |
524 ? LayoutUnit(getScrollableArea()->offsetFromOrigin().height()) | 524 ? LayoutUnit(getScrollableArea()->absolutePosition().y()) |
525 : LayoutUnit(); | 525 : LayoutUnit(); |
526 } | 526 } |
527 | 527 |
528 int LayoutBox::pixelSnappedScrollWidth() const { | 528 int LayoutBox::pixelSnappedScrollWidth() const { |
529 return snapSizeToPixel(scrollWidth(), location().x() + clientLeft()); | 529 return snapSizeToPixel(scrollWidth(), location().x() + clientLeft()); |
530 } | 530 } |
531 | 531 |
532 int LayoutBox::pixelSnappedScrollHeight() const { | 532 int LayoutBox::pixelSnappedScrollHeight() const { |
533 if (hasOverflowClip()) | 533 if (hasOverflowClip()) |
534 return snapSizeToPixel(getScrollableArea()->scrollHeight(), | 534 return snapSizeToPixel(getScrollableArea()->scrollHeight(), |
535 location().y() + clientTop()); | 535 location().y() + clientTop()); |
536 // For objects with visible overflow, this matches IE. | 536 // For objects with visible overflow, this matches IE. |
537 // FIXME: Need to work right with writing modes. | 537 // FIXME: Need to work right with writing modes. |
538 return snapSizeToPixel(scrollHeight(), location().y() + clientTop()); | 538 return snapSizeToPixel(scrollHeight(), location().y() + clientTop()); |
539 } | 539 } |
540 | 540 |
541 void LayoutBox::setScrollLeft(LayoutUnit newLeft) { | 541 void LayoutBox::setScrollLeft(LayoutUnit newLeft) { |
542 // This doesn't hit in any tests, but since the equivalent code in setScrollTo
p | 542 // This doesn't hit in any tests, but since the equivalent code in setScrollTo
p |
543 // does, presumably this code does as well. | 543 // does, presumably this code does as well. |
544 DisableCompositingQueryAsserts disabler; | 544 DisableCompositingQueryAsserts disabler; |
545 | 545 |
546 if (!hasOverflowClip()) | 546 if (!hasOverflowClip()) |
547 return; | 547 return; |
548 | 548 |
549 PaintLayerScrollableArea* scrollableArea = getScrollableArea(); | 549 PaintLayerScrollableArea* scrollableArea = getScrollableArea(); |
550 DoubleSize newOffset(newLeft, scrollableArea->offsetFromOrigin().height()); | 550 FloatPoint newPosition(newLeft.toFloat(), |
551 scrollableArea->scrollToOffsetFromOrigin(newOffset, ScrollBehaviorAuto); | 551 scrollableArea->absolutePosition().y()); |
| 552 scrollableArea->scrollToAbsolutePosition(newPosition, ScrollBehaviorAuto); |
552 } | 553 } |
553 | 554 |
554 void LayoutBox::setScrollTop(LayoutUnit newTop) { | 555 void LayoutBox::setScrollTop(LayoutUnit newTop) { |
555 // Hits in compositing/overflow/do-not-assert-on-invisible-composited-layers.h
tml | 556 // Hits in compositing/overflow/do-not-assert-on-invisible-composited-layers.h
tml |
556 DisableCompositingQueryAsserts disabler; | 557 DisableCompositingQueryAsserts disabler; |
557 | 558 |
558 if (!hasOverflowClip()) | 559 if (!hasOverflowClip()) |
559 return; | 560 return; |
560 | 561 |
561 PaintLayerScrollableArea* scrollableArea = getScrollableArea(); | 562 PaintLayerScrollableArea* scrollableArea = getScrollableArea(); |
562 DoubleSize newOffset(scrollableArea->offsetFromOrigin().width(), newTop); | 563 FloatPoint newPosition(scrollableArea->absolutePosition().x(), |
563 scrollableArea->scrollToOffsetFromOrigin(newOffset, ScrollBehaviorAuto); | 564 newTop.toFloat()); |
| 565 scrollableArea->scrollToAbsolutePosition(newPosition, ScrollBehaviorAuto); |
564 } | 566 } |
565 | 567 |
566 void LayoutBox::scrollToOffset(const DoubleSize& offset, | 568 void LayoutBox::scrollToPosition(const FloatPoint& position, |
567 ScrollBehavior scrollBehavior) { | 569 ScrollBehavior scrollBehavior) { |
568 // This doesn't hit in any tests, but since the equivalent code in setScrollTo
p | 570 // This doesn't hit in any tests, but since the equivalent code in setScrollTo
p |
569 // does, presumably this code does as well. | 571 // does, presumably this code does as well. |
570 DisableCompositingQueryAsserts disabler; | 572 DisableCompositingQueryAsserts disabler; |
571 | 573 |
572 if (!hasOverflowClip()) | 574 if (!hasOverflowClip()) |
573 return; | 575 return; |
574 | 576 |
575 getScrollableArea()->scrollToOffsetFromOrigin(offset, scrollBehavior); | 577 getScrollableArea()->scrollToAbsolutePosition(position, scrollBehavior); |
576 } | 578 } |
577 | 579 |
578 // Returns true iff we are attempting an autoscroll inside an iframe with scroll
ing="no". | 580 // Returns true iff we are attempting an autoscroll inside an iframe with scroll
ing="no". |
579 static bool isDisallowedAutoscroll(HTMLFrameOwnerElement* ownerElement, | 581 static bool isDisallowedAutoscroll(HTMLFrameOwnerElement* ownerElement, |
580 FrameView* frameView) { | 582 FrameView* frameView) { |
581 if (ownerElement && isHTMLFrameElementBase(*ownerElement)) { | 583 if (ownerElement && isHTMLFrameElementBase(*ownerElement)) { |
582 HTMLFrameElementBase* frameElementBase = | 584 HTMLFrameElementBase* frameElementBase = |
583 toHTMLFrameElementBase(ownerElement); | 585 toHTMLFrameElementBase(ownerElement); |
584 if (Page* page = frameView->frame().page()) { | 586 if (Page* page = frameView->frame().page()) { |
585 return page->autoscrollController().autoscrollInProgress() && | 587 return page->autoscrollController().autoscrollInProgress() && |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 IntSize LayoutBox::calculateAutoscrollDirection( | 998 IntSize LayoutBox::calculateAutoscrollDirection( |
997 const IntPoint& pointInRootFrame) const { | 999 const IntPoint& pointInRootFrame) const { |
998 if (!frame()) | 1000 if (!frame()) |
999 return IntSize(); | 1001 return IntSize(); |
1000 | 1002 |
1001 FrameView* frameView = frame()->view(); | 1003 FrameView* frameView = frame()->view(); |
1002 if (!frameView) | 1004 if (!frameView) |
1003 return IntSize(); | 1005 return IntSize(); |
1004 | 1006 |
1005 IntRect box(absoluteBoundingBoxRect()); | 1007 IntRect box(absoluteBoundingBoxRect()); |
1006 box.move(view()->frameView()->scrollOffset()); | 1008 box.move(view()->frameView()->scrollOffsetInt()); |
1007 IntRect windowBox = view()->frameView()->contentsToRootFrame(box); | 1009 IntRect windowBox = view()->frameView()->contentsToRootFrame(box); |
1008 | 1010 |
1009 IntPoint windowAutoscrollPoint = pointInRootFrame; | 1011 IntPoint windowAutoscrollPoint = pointInRootFrame; |
1010 | 1012 |
1011 if (windowAutoscrollPoint.x() < windowBox.x() + autoscrollBeltSize) | 1013 if (windowAutoscrollPoint.x() < windowBox.x() + autoscrollBeltSize) |
1012 windowAutoscrollPoint.move(-autoscrollBeltSize, 0); | 1014 windowAutoscrollPoint.move(-autoscrollBeltSize, 0); |
1013 else if (windowAutoscrollPoint.x() > windowBox.maxX() - autoscrollBeltSize) | 1015 else if (windowAutoscrollPoint.x() > windowBox.maxX() - autoscrollBeltSize) |
1014 windowAutoscrollPoint.move(autoscrollBeltSize, 0); | 1016 windowAutoscrollPoint.move(autoscrollBeltSize, 0); |
1015 | 1017 |
1016 if (windowAutoscrollPoint.y() < windowBox.y() + autoscrollBeltSize) | 1018 if (windowAutoscrollPoint.y() < windowBox.y() + autoscrollBeltSize) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 if (abs(delta.width()) <= | 1082 if (abs(delta.width()) <= |
1081 AutoscrollController:: | 1083 AutoscrollController:: |
1082 noMiddleClickAutoscrollRadius) // at the center we let the space for
the icon | 1084 noMiddleClickAutoscrollRadius) // at the center we let the space for
the icon |
1083 delta.setWidth(0); | 1085 delta.setWidth(0); |
1084 if (abs(delta.height()) <= | 1086 if (abs(delta.height()) <= |
1085 AutoscrollController::noMiddleClickAutoscrollRadius) | 1087 AutoscrollController::noMiddleClickAutoscrollRadius) |
1086 delta.setHeight(0); | 1088 delta.setHeight(0); |
1087 scroll(ScrollByPixel, FloatSize(adjustedScrollDelta(delta))); | 1089 scroll(ScrollByPixel, FloatSize(adjustedScrollDelta(delta))); |
1088 } | 1090 } |
1089 | 1091 |
1090 void LayoutBox::scrollByRecursively(const DoubleSize& delta) { | 1092 void LayoutBox::scrollByRecursively(const ScrollOffset& delta) { |
1091 if (delta.isZero()) | 1093 if (delta.isZero()) |
1092 return; | 1094 return; |
1093 | 1095 |
1094 bool restrictedByLineClamp = false; | 1096 bool restrictedByLineClamp = false; |
1095 if (parent()) | 1097 if (parent()) |
1096 restrictedByLineClamp = !parent()->style()->lineClamp().isNone(); | 1098 restrictedByLineClamp = !parent()->style()->lineClamp().isNone(); |
1097 | 1099 |
1098 if (hasOverflowClip() && !restrictedByLineClamp) { | 1100 if (hasOverflowClip() && !restrictedByLineClamp) { |
1099 PaintLayerScrollableArea* scrollableArea = this->getScrollableArea(); | 1101 PaintLayerScrollableArea* scrollableArea = this->getScrollableArea(); |
1100 ASSERT(scrollableArea); | 1102 ASSERT(scrollableArea); |
1101 | 1103 |
1102 DoubleSize newScrollOffset = scrollableArea->offsetFromOrigin() + delta; | 1104 ScrollOffset newScrollOffset = scrollableArea->scrollOffset() + delta; |
1103 scrollableArea->scrollToOffsetFromOrigin(newScrollOffset); | 1105 scrollableArea->setScrollOffset(newScrollOffset, ProgrammaticScroll); |
1104 | 1106 |
1105 // If this layer can't do the scroll we ask the next layer up that can scrol
l to try | 1107 // If this layer can't do the scroll we ask the next layer up that can scrol
l to try |
1106 DoubleSize remainingScrollOffset = | 1108 ScrollOffset remainingScrollOffset = |
1107 newScrollOffset - scrollableArea->offsetFromOrigin(); | 1109 newScrollOffset - scrollableArea->scrollOffset(); |
1108 if (!remainingScrollOffset.isZero() && parent()) { | 1110 if (!remainingScrollOffset.isZero() && parent()) { |
1109 if (LayoutBox* scrollableBox = enclosingScrollableBox()) | 1111 if (LayoutBox* scrollableBox = enclosingScrollableBox()) |
1110 scrollableBox->scrollByRecursively(remainingScrollOffset); | 1112 scrollableBox->scrollByRecursively(remainingScrollOffset); |
1111 | 1113 |
1112 LocalFrame* frame = this->frame(); | 1114 LocalFrame* frame = this->frame(); |
1113 if (frame && frame->page()) | 1115 if (frame && frame->page()) |
1114 frame->page()->autoscrollController().updateAutoscrollLayoutObject(); | 1116 frame->page()->autoscrollController().updateAutoscrollLayoutObject(); |
1115 } | 1117 } |
1116 } else if (view()->frameView()) { | 1118 } else if (view()->frameView()) { |
1117 // If we are here, we were called on a layoutObject that can be programmatic
ally scrolled, but doesn't | 1119 // If we are here, we were called on a layoutObject that can be programmatic
ally scrolled, but doesn't |
1118 // have an overflow clip. Which means that it is a document node that can be
scrolled. | 1120 // have an overflow clip. Which means that it is a document node that can be
scrolled. |
1119 // FIXME: Pass in DoubleSize. crbug.com/414283. | 1121 // FIXME: Pass in DoubleSize. crbug.com/414283. |
1120 view()->frameView()->scrollBy(flooredIntSize(delta), UserScroll); | 1122 view()->frameView()->scrollBy(delta, UserScroll); |
1121 | 1123 |
1122 // FIXME: If we didn't scroll the whole way, do we want to try looking at th
e frames ownerElement? | 1124 // FIXME: If we didn't scroll the whole way, do we want to try looking at th
e frames ownerElement? |
1123 // https://bugs.webkit.org/show_bug.cgi?id=28237 | 1125 // https://bugs.webkit.org/show_bug.cgi?id=28237 |
1124 } | 1126 } |
1125 } | 1127 } |
1126 | 1128 |
1127 bool LayoutBox::needsPreferredWidthsRecalculation() const { | 1129 bool LayoutBox::needsPreferredWidthsRecalculation() const { |
1128 return style()->paddingStart().isPercentOrCalc() || | 1130 return style()->paddingStart().isPercentOrCalc() || |
1129 style()->paddingEnd().isPercentOrCalc(); | 1131 style()->paddingEnd().isPercentOrCalc(); |
1130 } | 1132 } |
1131 | 1133 |
1132 IntSize LayoutBox::originAdjustmentForScrollbars() const { | 1134 IntSize LayoutBox::originAdjustmentForScrollbars() const { |
1133 IntSize size; | 1135 IntSize size; |
1134 int adjustmentWidth = verticalScrollbarWidth(); | 1136 int adjustmentWidth = verticalScrollbarWidth(); |
1135 if (hasFlippedBlocksWritingMode() || | 1137 if (hasFlippedBlocksWritingMode() || |
1136 (isHorizontalWritingMode() && | 1138 (isHorizontalWritingMode() && |
1137 shouldPlaceBlockDirectionScrollbarOnLogicalLeft())) { | 1139 shouldPlaceBlockDirectionScrollbarOnLogicalLeft())) { |
1138 size.expand(adjustmentWidth, 0); | 1140 size.expand(adjustmentWidth, 0); |
1139 } | 1141 } |
1140 return size; | 1142 return size; |
1141 } | 1143 } |
1142 | 1144 |
1143 IntSize LayoutBox::scrolledContentOffset() const { | 1145 IntSize LayoutBox::scrolledContentOffset() const { |
1144 ASSERT(hasOverflowClip()); | 1146 ASSERT(hasOverflowClip()); |
1145 ASSERT(hasLayer()); | 1147 ASSERT(hasLayer()); |
1146 // FIXME: Return DoubleSize here. crbug.com/414283. | 1148 // FIXME: Return DoubleSize here. crbug.com/414283. |
1147 PaintLayerScrollableArea* scrollableArea = getScrollableArea(); | 1149 PaintLayerScrollableArea* scrollableArea = getScrollableArea(); |
1148 IntSize result = flooredIntSize(scrollableArea->scrollPosition()) + | 1150 IntSize result = |
1149 originAdjustmentForScrollbars(); | 1151 scrollableArea->scrollOffsetInt() + originAdjustmentForScrollbars(); |
1150 if (isHorizontalWritingMode() && | 1152 if (isHorizontalWritingMode() && |
1151 shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) | 1153 shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) |
1152 result.expand(-verticalScrollbarWidth(), 0); | 1154 result.expand(-verticalScrollbarWidth(), 0); |
1153 return result; | 1155 return result; |
1154 } | 1156 } |
1155 | 1157 |
1156 LayoutRect LayoutBox::clippingRect() const { | 1158 LayoutRect LayoutBox::clippingRect() const { |
1157 LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect()); | 1159 LayoutRect result = LayoutRect(LayoutRect::infiniteIntRect()); |
1158 if (hasOverflowClip() || style()->containsPaint()) | 1160 if (hasOverflowClip() || style()->containsPaint()) |
1159 result = overflowClipRect(LayoutPoint()); | 1161 result = overflowClipRect(LayoutPoint()); |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1726 } | 1728 } |
1727 | 1729 |
1728 bool LayoutBox::intersectsVisibleViewport() const { | 1730 bool LayoutBox::intersectsVisibleViewport() const { |
1729 LayoutRect rect = visualOverflowRect(); | 1731 LayoutRect rect = visualOverflowRect(); |
1730 LayoutView* layoutView = view(); | 1732 LayoutView* layoutView = view(); |
1731 while (!layoutView->frame()->ownerLayoutItem().isNull()) | 1733 while (!layoutView->frame()->ownerLayoutItem().isNull()) |
1732 layoutView = | 1734 layoutView = |
1733 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem()) | 1735 LayoutAPIShim::layoutObjectFrom(layoutView->frame()->ownerLayoutItem()) |
1734 ->view(); | 1736 ->view(); |
1735 mapToVisualRectInAncestorSpace(layoutView, rect); | 1737 mapToVisualRectInAncestorSpace(layoutView, rect); |
1736 return rect.intersects(LayoutRect(layoutView->frameView() | 1738 return rect.intersects(LayoutRect( |
1737 ->getScrollableArea() | 1739 layoutView->frameView()->getScrollableArea()->visibleContentRect())); |
1738 ->visibleContentRectDouble())); | |
1739 } | 1740 } |
1740 | 1741 |
1741 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded( | 1742 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded( |
1742 const PaintInvalidationState& paintInvalidationState) { | 1743 const PaintInvalidationState& paintInvalidationState) { |
1743 if (hasBoxDecorationBackground() | 1744 if (hasBoxDecorationBackground() |
1744 // We also paint overflow controls in background phase. | 1745 // We also paint overflow controls in background phase. |
1745 || (hasOverflowClip() && getScrollableArea()->hasOverflowControls())) { | 1746 || (hasOverflowClip() && getScrollableArea()->hasOverflowControls())) { |
1746 PaintLayer& layer = paintInvalidationState.paintingLayer(); | 1747 PaintLayer& layer = paintInvalidationState.paintingLayer(); |
1747 if (layer.layoutObject() != this) | 1748 if (layer.layoutObject() != this) |
1748 layer.setNeedsPaintPhaseDescendantBlockBackgrounds(); | 1749 layer.setNeedsPaintPhaseDescendantBlockBackgrounds(); |
(...skipping 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5474 LayoutRect rect = frameRect(); | 5475 LayoutRect rect = frameRect(); |
5475 | 5476 |
5476 LayoutBlock* block = containingBlock(); | 5477 LayoutBlock* block = containingBlock(); |
5477 if (block) | 5478 if (block) |
5478 block->adjustChildDebugRect(rect); | 5479 block->adjustChildDebugRect(rect); |
5479 | 5480 |
5480 return rect; | 5481 return rect; |
5481 } | 5482 } |
5482 | 5483 |
5483 } // namespace blink | 5484 } // namespace blink |
OLD | NEW |