| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@gmail.com> | 10 * Christian Biesinger <cbiesinger@gmail.com> |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 556 } |
| 557 | 557 |
| 558 int PaintLayerScrollableArea::visibleWidth() const { | 558 int PaintLayerScrollableArea::visibleWidth() const { |
| 559 return layer()->size().width(); | 559 return layer()->size().width(); |
| 560 } | 560 } |
| 561 | 561 |
| 562 IntSize PaintLayerScrollableArea::contentsSize() const { | 562 IntSize PaintLayerScrollableArea::contentsSize() const { |
| 563 return IntSize(pixelSnappedScrollWidth(), pixelSnappedScrollHeight()); | 563 return IntSize(pixelSnappedScrollWidth(), pixelSnappedScrollHeight()); |
| 564 } | 564 } |
| 565 | 565 |
| 566 void PaintLayerScrollableArea::contentsResized() { |
| 567 ScrollableArea::contentsResized(); |
| 568 // Need to update the bounds of the scroll property. |
| 569 box().setNeedsPaintPropertyUpdate(); |
| 570 } |
| 571 |
| 566 bool PaintLayerScrollableArea::isScrollable() const { | 572 bool PaintLayerScrollableArea::isScrollable() const { |
| 567 return scrollsOverflow(); | 573 return scrollsOverflow(); |
| 568 } | 574 } |
| 569 | 575 |
| 570 IntPoint PaintLayerScrollableArea::lastKnownMousePosition() const { | 576 IntPoint PaintLayerScrollableArea::lastKnownMousePosition() const { |
| 571 return box().frame() ? box().frame()->eventHandler().lastKnownMousePosition() | 577 return box().frame() ? box().frame()->eventHandler().lastKnownMousePosition() |
| 572 : IntPoint(); | 578 : IntPoint(); |
| 573 } | 579 } |
| 574 | 580 |
| 575 bool PaintLayerScrollableArea::scrollAnimatorEnabled() const { | 581 bool PaintLayerScrollableArea::scrollAnimatorEnabled() const { |
| 576 if (Settings* settings = box().frame()->settings()) | 582 if (Settings* settings = box().frame()->settings()) |
| 577 return settings->getScrollAnimatorEnabled(); | 583 return settings->getScrollAnimatorEnabled(); |
| 578 return false; | 584 return false; |
| 579 } | 585 } |
| 580 | 586 |
| 581 bool PaintLayerScrollableArea::shouldSuspendScrollAnimations() const { | 587 bool PaintLayerScrollableArea::shouldSuspendScrollAnimations() const { |
| 582 LayoutView* view = box().view(); | 588 LayoutView* view = box().view(); |
| 583 if (!view) | 589 if (!view) |
| 584 return true; | 590 return true; |
| 585 return view->frameView()->shouldSuspendScrollAnimations(); | 591 return view->frameView()->shouldSuspendScrollAnimations(); |
| 586 } | 592 } |
| 587 | 593 |
| 588 void PaintLayerScrollableArea::scrollbarVisibilityChanged() { | 594 void PaintLayerScrollableArea::scrollbarVisibilityChanged() { |
| 589 updateScrollbarEnabledState(); | 595 updateScrollbarEnabledState(); |
| 590 | 596 |
| 591 if (LayoutView* view = box().view()) | 597 if (LayoutView* view = box().view()) |
| 592 return view->clearHitTestCache(); | 598 return view->clearHitTestCache(); |
| 593 } | 599 } |
| 594 | 600 |
| 601 void PaintLayerScrollableArea::scrollbarFrameRectChanged() { |
| 602 // Size of non-overlay scrollbar affects overflow clip rect. |
| 603 if (!hasOverlayScrollbars()) |
| 604 box().setNeedsPaintPropertyUpdate(); |
| 605 } |
| 606 |
| 595 bool PaintLayerScrollableArea::scrollbarsCanBeActive() const { | 607 bool PaintLayerScrollableArea::scrollbarsCanBeActive() const { |
| 596 LayoutView* view = box().view(); | 608 LayoutView* view = box().view(); |
| 597 if (!view) | 609 if (!view) |
| 598 return false; | 610 return false; |
| 599 return view->frameView()->scrollbarsCanBeActive(); | 611 return view->frameView()->scrollbarsCanBeActive(); |
| 600 } | 612 } |
| 601 | 613 |
| 602 IntRect PaintLayerScrollableArea::scrollableAreaBoundingBox() const { | 614 IntRect PaintLayerScrollableArea::scrollableAreaBoundingBox() const { |
| 603 return box().absoluteBoundingBoxRect(TraverseDocumentBoundaries); | 615 return box().absoluteBoundingBoxRect(TraverseDocumentBoundaries); |
| 604 } | 616 } |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2118 | 2130 |
| 2119 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2131 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 2120 clampScrollableAreas() { | 2132 clampScrollableAreas() { |
| 2121 for (auto& scrollableArea : *s_needsClamp) | 2133 for (auto& scrollableArea : *s_needsClamp) |
| 2122 scrollableArea->clampScrollOffsetAfterOverflowChange(); | 2134 scrollableArea->clampScrollOffsetAfterOverflowChange(); |
| 2123 delete s_needsClamp; | 2135 delete s_needsClamp; |
| 2124 s_needsClamp = nullptr; | 2136 s_needsClamp = nullptr; |
| 2125 } | 2137 } |
| 2126 | 2138 |
| 2127 } // namespace blink | 2139 } // namespace blink |
| OLD | NEW |