| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
| 3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
| 4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
| 5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 10 * | 10 * |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 detachScrollbars(); | 294 detachScrollbars(); |
| 295 | 295 |
| 296 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 296 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
| 297 scrollingCoordinator->willDestroyScrollableArea(this); | 297 scrollingCoordinator->willDestroyScrollableArea(this); |
| 298 | 298 |
| 299 // We need to clear the RootFrameViewport's animator since it gets called | 299 // We need to clear the RootFrameViewport's animator since it gets called |
| 300 // from non-GC'd objects and RootFrameViewport will still have a pointer to | 300 // from non-GC'd objects and RootFrameViewport will still have a pointer to |
| 301 // this class. | 301 // this class. |
| 302 if (m_viewportScrollableArea) | 302 if (m_viewportScrollableArea) |
| 303 m_viewportScrollableArea->clearScrollableArea(); | 303 m_viewportScrollableArea->clearScrollAnimators(); |
| 304 | 304 |
| 305 clearScrollableArea(); | 305 clearScrollAnimators(); |
| 306 | 306 |
| 307 // Destroy |m_autoSizeInfo| as early as possible, to avoid dereferencing | 307 // Destroy |m_autoSizeInfo| as early as possible, to avoid dereferencing |
| 308 // partially destroyed |this| via |m_autoSizeInfo->m_frameView|. | 308 // partially destroyed |this| via |m_autoSizeInfo->m_frameView|. |
| 309 m_autoSizeInfo.clear(); | 309 m_autoSizeInfo.clear(); |
| 310 | 310 |
| 311 m_postLayoutTasksTimer.stop(); | 311 m_postLayoutTasksTimer.stop(); |
| 312 m_didScrollTimer.stop(); | 312 m_didScrollTimer.stop(); |
| 313 | 313 |
| 314 m_renderThrottlingObserverNotificationFactory->cancel(); | 314 m_renderThrottlingObserverNotificationFactory->cancel(); |
| 315 | 315 |
| (...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 | 1464 |
| 1465 if (ScrollingCoordinator* scrollingCoordinator = | 1465 if (ScrollingCoordinator* scrollingCoordinator = |
| 1466 this->scrollingCoordinator()) | 1466 this->scrollingCoordinator()) |
| 1467 scrollingCoordinator->frameViewFixedObjectsDidChange(this); | 1467 scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
| 1468 } | 1468 } |
| 1469 } | 1469 } |
| 1470 | 1470 |
| 1471 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { | 1471 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { |
| 1472 DCHECK(widthChanged || heightChanged); | 1472 DCHECK(widthChanged || heightChanged); |
| 1473 | 1473 |
| 1474 showOverlayScrollbars(); | |
| 1475 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 1474 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 1476 // The background must be repainted when the FrameView is resized, even if | 1475 // The background must be repainted when the FrameView is resized, even if |
| 1477 // the initial containing block does not change (so we can't rely on layout | 1476 // the initial containing block does not change (so we can't rely on layout |
| 1478 // to issue the invalidation). This is because the background fills the | 1477 // to issue the invalidation). This is because the background fills the |
| 1479 // main GraphicsLayer, which takes the size of the layout viewport. | 1478 // main GraphicsLayer, which takes the size of the layout viewport. |
| 1480 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents | 1479 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents |
| 1481 // layer and avoid this invalidation (http://crbug.com/568847). | 1480 // layer and avoid this invalidation (http://crbug.com/568847). |
| 1482 LayoutViewItem lvi = layoutViewItem(); | 1481 LayoutViewItem lvi = layoutViewItem(); |
| 1483 if (!lvi.isNull()) | 1482 if (!lvi.isNull()) |
| 1484 lvi.setShouldDoFullPaintInvalidation(); | 1483 lvi.setShouldDoFullPaintInvalidation(); |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2385 } | 2384 } |
| 2386 | 2385 |
| 2387 bool FrameView::scrollbarsCanBeActive() const { | 2386 bool FrameView::scrollbarsCanBeActive() const { |
| 2388 if (m_frame->view() != this) | 2387 if (m_frame->view() != this) |
| 2389 return false; | 2388 return false; |
| 2390 | 2389 |
| 2391 return !!m_frame->document(); | 2390 return !!m_frame->document(); |
| 2392 } | 2391 } |
| 2393 | 2392 |
| 2394 void FrameView::scrollbarVisibilityChanged() { | 2393 void FrameView::scrollbarVisibilityChanged() { |
| 2395 // Scrollbar enabled state is set from updateScrollbarGeometry. | |
| 2396 updateScrollbarGeometry(); | |
| 2397 LayoutViewItem viewItem = layoutViewItem(); | 2394 LayoutViewItem viewItem = layoutViewItem(); |
| 2398 if (!viewItem.isNull()) | 2395 if (!viewItem.isNull()) |
| 2399 viewItem.clearHitTestCache(); | 2396 viewItem.clearHitTestCache(); |
| 2400 } | 2397 } |
| 2401 | 2398 |
| 2402 IntRect FrameView::scrollableAreaBoundingBox() const { | 2399 IntRect FrameView::scrollableAreaBoundingBox() const { |
| 2403 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem(); | 2400 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem(); |
| 2404 if (ownerLayoutItem.isNull()) | 2401 if (ownerLayoutItem.isNull()) |
| 2405 return frameRect(); | 2402 return frameRect(); |
| 2406 | 2403 |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3600 | 3597 |
| 3601 return scrollbar->totalSize() - scrollbar->visibleSize(); | 3598 return scrollbar->totalSize() - scrollbar->visibleSize(); |
| 3602 } | 3599 } |
| 3603 | 3600 |
| 3604 void FrameView::updateScrollOffset(const ScrollOffset& offset, | 3601 void FrameView::updateScrollOffset(const ScrollOffset& offset, |
| 3605 ScrollType scrollType) { | 3602 ScrollType scrollType) { |
| 3606 ScrollOffset scrollDelta = offset - m_scrollOffset; | 3603 ScrollOffset scrollDelta = offset - m_scrollOffset; |
| 3607 if (scrollDelta.isZero()) | 3604 if (scrollDelta.isZero()) |
| 3608 return; | 3605 return; |
| 3609 | 3606 |
| 3610 showOverlayScrollbars(); | |
| 3611 | |
| 3612 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 3607 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 3613 // Don't scroll the FrameView! | 3608 // Don't scroll the FrameView! |
| 3614 ASSERT_NOT_REACHED(); | 3609 ASSERT_NOT_REACHED(); |
| 3615 } | 3610 } |
| 3616 | 3611 |
| 3617 m_scrollOffset = offset; | 3612 m_scrollOffset = offset; |
| 3618 | 3613 |
| 3619 if (!scrollbarsSuppressed()) | 3614 if (!scrollbarsSuppressed()) |
| 3620 m_pendingScrollDelta += scrollDelta; | 3615 m_pendingScrollDelta += scrollDelta; |
| 3621 | 3616 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3823 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && | 3818 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && |
| 3824 m_frame->isMainFrame(); | 3819 m_frame->isMainFrame(); |
| 3825 } | 3820 } |
| 3826 | 3821 |
| 3827 void FrameView::updateScrollbarsIfNeeded() { | 3822 void FrameView::updateScrollbarsIfNeeded() { |
| 3828 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || | 3823 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || |
| 3829 scrollOriginChanged()) | 3824 scrollOriginChanged()) |
| 3830 updateScrollbars(); | 3825 updateScrollbars(); |
| 3831 } | 3826 } |
| 3832 | 3827 |
| 3828 void FrameView::didChangeScrollbarsHidden() { |
| 3829 updateScrollbars(); |
| 3830 } |
| 3831 |
| 3833 void FrameView::updateScrollbars() { | 3832 void FrameView::updateScrollbars() { |
| 3834 m_needsScrollbarsUpdate = false; | 3833 m_needsScrollbarsUpdate = false; |
| 3835 | 3834 |
| 3836 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 3835 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
| 3837 return; | 3836 return; |
| 3838 | 3837 |
| 3839 // Avoid drawing two sets of scrollbars when visual viewport is enabled. | 3838 // Avoid drawing two sets of scrollbars when visual viewport is enabled. |
| 3840 if (visualViewportSuppliesScrollbars()) { | 3839 if (visualViewportSuppliesScrollbars()) { |
| 3841 m_scrollbarManager.setHasHorizontalScrollbar(false); | 3840 m_scrollbarManager.setHasHorizontalScrollbar(false); |
| 3842 m_scrollbarManager.setHasVerticalScrollbar(false); | 3841 m_scrollbarManager.setHasVerticalScrollbar(false); |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4548 DCHECK(m_frame->isMainFrame()); | 4547 DCHECK(m_frame->isMainFrame()); |
| 4549 return m_initialViewportSize.width(); | 4548 return m_initialViewportSize.width(); |
| 4550 } | 4549 } |
| 4551 | 4550 |
| 4552 int FrameView::initialViewportHeight() const { | 4551 int FrameView::initialViewportHeight() const { |
| 4553 DCHECK(m_frame->isMainFrame()); | 4552 DCHECK(m_frame->isMainFrame()); |
| 4554 return m_initialViewportSize.height(); | 4553 return m_initialViewportSize.height(); |
| 4555 } | 4554 } |
| 4556 | 4555 |
| 4557 } // namespace blink | 4556 } // namespace blink |
| OLD | NEW |