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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 | 312 |
313 detachScrollbars(); | 313 detachScrollbars(); |
314 | 314 |
315 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) | 315 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) |
316 scrollingCoordinator->willDestroyScrollableArea(this); | 316 scrollingCoordinator->willDestroyScrollableArea(this); |
317 | 317 |
318 // We need to clear the RootFrameViewport's animator since it gets called | 318 // We need to clear the RootFrameViewport's animator since it gets called |
319 // from non-GC'd objects and RootFrameViewport will still have a pointer to | 319 // from non-GC'd objects and RootFrameViewport will still have a pointer to |
320 // this class. | 320 // this class. |
321 if (m_viewportScrollableArea) | 321 if (m_viewportScrollableArea) |
322 m_viewportScrollableArea->clearScrollableArea(); | 322 m_viewportScrollableArea->clearScrollAnimators(); |
323 | 323 |
324 clearScrollableArea(); | 324 clearScrollAnimators(); |
325 | 325 |
326 // Destroy |m_autoSizeInfo| as early as possible, to avoid dereferencing | 326 // Destroy |m_autoSizeInfo| as early as possible, to avoid dereferencing |
327 // partially destroyed |this| via |m_autoSizeInfo->m_frameView|. | 327 // partially destroyed |this| via |m_autoSizeInfo->m_frameView|. |
328 m_autoSizeInfo.clear(); | 328 m_autoSizeInfo.clear(); |
329 | 329 |
330 m_postLayoutTasksTimer.stop(); | 330 m_postLayoutTasksTimer.stop(); |
331 m_didScrollTimer.stop(); | 331 m_didScrollTimer.stop(); |
332 | 332 |
333 // FIXME: Do we need to do something here for OOPI? | 333 // FIXME: Do we need to do something here for OOPI? |
334 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); | 334 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1494 | 1494 |
1495 if (ScrollingCoordinator* scrollingCoordinator = | 1495 if (ScrollingCoordinator* scrollingCoordinator = |
1496 this->scrollingCoordinator()) | 1496 this->scrollingCoordinator()) |
1497 scrollingCoordinator->frameViewFixedObjectsDidChange(this); | 1497 scrollingCoordinator->frameViewFixedObjectsDidChange(this); |
1498 } | 1498 } |
1499 } | 1499 } |
1500 | 1500 |
1501 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { | 1501 void FrameView::viewportSizeChanged(bool widthChanged, bool heightChanged) { |
1502 DCHECK(widthChanged || heightChanged); | 1502 DCHECK(widthChanged || heightChanged); |
1503 | 1503 |
1504 showOverlayScrollbars(); | |
1505 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 1504 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
1506 // The background must be repainted when the FrameView is resized, even if | 1505 // The background must be repainted when the FrameView is resized, even if |
1507 // the initial containing block does not change (so we can't rely on layout | 1506 // the initial containing block does not change (so we can't rely on layout |
1508 // to issue the invalidation). This is because the background fills the | 1507 // to issue the invalidation). This is because the background fills the |
1509 // main GraphicsLayer, which takes the size of the layout viewport. | 1508 // main GraphicsLayer, which takes the size of the layout viewport. |
1510 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents | 1509 // TODO(skobes): Paint non-fixed backgrounds into the scrolling contents |
1511 // layer and avoid this invalidation (http://crbug.com/568847). | 1510 // layer and avoid this invalidation (http://crbug.com/568847). |
1512 LayoutViewItem lvi = layoutViewItem(); | 1511 LayoutViewItem lvi = layoutViewItem(); |
1513 if (!lvi.isNull()) | 1512 if (!lvi.isNull()) |
1514 lvi.setShouldDoFullPaintInvalidation(); | 1513 lvi.setShouldDoFullPaintInvalidation(); |
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2432 } | 2431 } |
2433 | 2432 |
2434 bool FrameView::scrollbarsCanBeActive() const { | 2433 bool FrameView::scrollbarsCanBeActive() const { |
2435 if (m_frame->view() != this) | 2434 if (m_frame->view() != this) |
2436 return false; | 2435 return false; |
2437 | 2436 |
2438 return !!m_frame->document(); | 2437 return !!m_frame->document(); |
2439 } | 2438 } |
2440 | 2439 |
2441 void FrameView::scrollbarVisibilityChanged() { | 2440 void FrameView::scrollbarVisibilityChanged() { |
2442 // Scrollbar enabled state is set from updateScrollbarGeometry. | |
2443 updateScrollbarGeometry(); | |
2444 LayoutViewItem viewItem = layoutViewItem(); | 2441 LayoutViewItem viewItem = layoutViewItem(); |
2445 if (!viewItem.isNull()) | 2442 if (!viewItem.isNull()) |
2446 viewItem.clearHitTestCache(); | 2443 viewItem.clearHitTestCache(); |
2447 } | 2444 } |
2448 | 2445 |
2449 IntRect FrameView::scrollableAreaBoundingBox() const { | 2446 IntRect FrameView::scrollableAreaBoundingBox() const { |
2450 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem(); | 2447 LayoutPartItem ownerLayoutItem = frame().ownerLayoutItem(); |
2451 if (ownerLayoutItem.isNull()) | 2448 if (ownerLayoutItem.isNull()) |
2452 return frameRect(); | 2449 return frameRect(); |
2453 | 2450 |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3651 | 3648 |
3652 return scrollbar->totalSize() - scrollbar->visibleSize(); | 3649 return scrollbar->totalSize() - scrollbar->visibleSize(); |
3653 } | 3650 } |
3654 | 3651 |
3655 void FrameView::updateScrollOffset(const ScrollOffset& offset, | 3652 void FrameView::updateScrollOffset(const ScrollOffset& offset, |
3656 ScrollType scrollType) { | 3653 ScrollType scrollType) { |
3657 ScrollOffset scrollDelta = offset - m_scrollOffset; | 3654 ScrollOffset scrollDelta = offset - m_scrollOffset; |
3658 if (scrollDelta.isZero()) | 3655 if (scrollDelta.isZero()) |
3659 return; | 3656 return; |
3660 | 3657 |
3661 showOverlayScrollbars(); | |
3662 | |
3663 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 3658 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
3664 // Don't scroll the FrameView! | 3659 // Don't scroll the FrameView! |
3665 ASSERT_NOT_REACHED(); | 3660 ASSERT_NOT_REACHED(); |
3666 } | 3661 } |
3667 | 3662 |
3668 m_scrollOffset = offset; | 3663 m_scrollOffset = offset; |
3669 | 3664 |
3670 if (!scrollbarsSuppressed()) | 3665 if (!scrollbarsSuppressed()) |
3671 m_pendingScrollDelta += scrollDelta; | 3666 m_pendingScrollDelta += scrollDelta; |
3672 | 3667 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3875 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && | 3870 return m_frame->settings()->ignoreMainFrameOverflowHiddenQuirk() && |
3876 m_frame->isMainFrame(); | 3871 m_frame->isMainFrame(); |
3877 } | 3872 } |
3878 | 3873 |
3879 void FrameView::updateScrollbarsIfNeeded() { | 3874 void FrameView::updateScrollbarsIfNeeded() { |
3880 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || | 3875 if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || |
3881 scrollOriginChanged()) | 3876 scrollOriginChanged()) |
3882 updateScrollbars(); | 3877 updateScrollbars(); |
3883 } | 3878 } |
3884 | 3879 |
| 3880 void FrameView::didChangeScrollbarsHidden() { |
| 3881 updateScrollbars(); |
| 3882 } |
| 3883 |
3885 void FrameView::updateScrollbars() { | 3884 void FrameView::updateScrollbars() { |
3886 m_needsScrollbarsUpdate = false; | 3885 m_needsScrollbarsUpdate = false; |
3887 | 3886 |
3888 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) | 3887 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) |
3889 return; | 3888 return; |
3890 | 3889 |
3891 // Avoid drawing two sets of scrollbars when visual viewport is enabled. | 3890 // Avoid drawing two sets of scrollbars when visual viewport is enabled. |
3892 if (visualViewportSuppliesScrollbars()) { | 3891 if (visualViewportSuppliesScrollbars()) { |
3893 m_scrollbarManager.setHasHorizontalScrollbar(false); | 3892 m_scrollbarManager.setHasHorizontalScrollbar(false); |
3894 m_scrollbarManager.setHasVerticalScrollbar(false); | 3893 m_scrollbarManager.setHasVerticalScrollbar(false); |
(...skipping 653 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 |