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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 , m_needsUpdateWidgetGeometries(false) | 151 , m_needsUpdateWidgetGeometries(false) |
152 , m_needsUpdateViewportIntersection(true) | 152 , m_needsUpdateViewportIntersection(true) |
153 , m_needsUpdateViewportIntersectionInSubtree(true) | 153 , m_needsUpdateViewportIntersectionInSubtree(true) |
154 #if ENABLE(ASSERT) | 154 #if ENABLE(ASSERT) |
155 , m_hasBeenDisposed(false) | 155 , m_hasBeenDisposed(false) |
156 #endif | 156 #endif |
157 , m_horizontalScrollbarMode(ScrollbarAuto) | 157 , m_horizontalScrollbarMode(ScrollbarAuto) |
158 , m_verticalScrollbarMode(ScrollbarAuto) | 158 , m_verticalScrollbarMode(ScrollbarAuto) |
159 , m_horizontalScrollbarLock(false) | 159 , m_horizontalScrollbarLock(false) |
160 , m_verticalScrollbarLock(false) | 160 , m_verticalScrollbarLock(false) |
| 161 , m_visibleContentRectForPainting(nullptr) |
161 , m_scrollbarsAvoidingResizer(0) | 162 , m_scrollbarsAvoidingResizer(0) |
162 , m_scrollbarsSuppressed(false) | 163 , m_scrollbarsSuppressed(false) |
163 , m_inUpdateScrollbars(false) | 164 , m_inUpdateScrollbars(false) |
164 , m_frameTimingRequestsDirty(true) | 165 , m_frameTimingRequestsDirty(true) |
165 , m_viewportIntersectionValid(false) | 166 , m_viewportIntersectionValid(false) |
166 , m_hiddenForThrottling(false) | 167 , m_hiddenForThrottling(false) |
167 , m_crossOriginForThrottling(false) | 168 , m_crossOriginForThrottling(false) |
168 , m_subtreeThrottled(false) | 169 , m_subtreeThrottled(false) |
169 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized
) | 170 , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized
) |
170 , m_suppressAdjustViewSize(false) | 171 , m_suppressAdjustViewSize(false) |
(...skipping 3131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3302 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const | 3303 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const |
3303 { | 3304 { |
3304 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); | 3305 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); |
3305 } | 3306 } |
3306 | 3307 |
3307 IntSize FrameView::contentsSize() const | 3308 IntSize FrameView::contentsSize() const |
3308 { | 3309 { |
3309 return m_contentsSize; | 3310 return m_contentsSize; |
3310 } | 3311 } |
3311 | 3312 |
| 3313 IntRect FrameView::visibleContentRectForPainting() const |
| 3314 { |
| 3315 if (m_visibleContentRectForPainting) |
| 3316 return *m_visibleContentRectForPainting; |
| 3317 return visibleContentRect(); |
| 3318 } |
| 3319 |
| 3320 void FrameView::setVisibleContentRectForPainting(const IntRect& rect) |
| 3321 { |
| 3322 m_visibleContentRectForPainting.reset(new IntRect(rect)); |
| 3323 } |
| 3324 |
| 3325 void FrameView::resetVisibleContentRectForPainting() |
| 3326 { |
| 3327 m_visibleContentRectForPainting.reset(); |
| 3328 } |
| 3329 |
3312 IntPoint FrameView::minimumScrollPosition() const | 3330 IntPoint FrameView::minimumScrollPosition() const |
3313 { | 3331 { |
3314 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); | 3332 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); |
3315 } | 3333 } |
3316 | 3334 |
3317 void FrameView::adjustScrollbarOpacity() | 3335 void FrameView::adjustScrollbarOpacity() |
3318 { | 3336 { |
3319 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { | 3337 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { |
3320 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); | 3338 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); |
3321 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); | 3339 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3380 } | 3398 } |
3381 | 3399 |
3382 if (m_didScrollTimer.isActive()) | 3400 if (m_didScrollTimer.isActive()) |
3383 m_didScrollTimer.stop(); | 3401 m_didScrollTimer.stop(); |
3384 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); | 3402 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); |
3385 | 3403 |
3386 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 3404 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
3387 cache->handleScrollPositionChanged(this); | 3405 cache->handleScrollPositionChanged(this); |
3388 | 3406 |
3389 frame().loader().saveScrollState(); | 3407 frame().loader().saveScrollState(); |
3390 frame().loader().client()->didChangeScrollOffset(); | 3408 didChangeScrollOffset(); |
3391 | 3409 |
3392 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { | 3410 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { |
3393 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) | 3411 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) |
3394 documentLoader->initialScrollState().wasScrolledByUser = true; | 3412 documentLoader->initialScrollState().wasScrolledByUser = true; |
3395 } | 3413 } |
3396 | 3414 |
3397 if (scrollType != AnchoringScroll) | 3415 if (scrollType != AnchoringScroll) |
3398 clearScrollAnchor(); | 3416 clearScrollAnchor(); |
3399 } | 3417 } |
3400 | 3418 |
| 3419 void FrameView::didChangeScrollOffset() |
| 3420 { |
| 3421 frame().loader().client()->didChangeScrollOffset(); |
| 3422 if (frame().isMainFrame()) |
| 3423 frame().host()->chromeClient().mainFrameScrollOffsetChanged(); |
| 3424 } |
| 3425 |
3401 void FrameView::clearScrollAnchor() | 3426 void FrameView::clearScrollAnchor() |
3402 { | 3427 { |
3403 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) | 3428 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) |
3404 return; | 3429 return; |
3405 m_scrollAnchor.clear(); | 3430 m_scrollAnchor.clear(); |
3406 } | 3431 } |
3407 | 3432 |
3408 void FrameView::windowResizerRectChanged() | 3433 void FrameView::windowResizerRectChanged() |
3409 { | 3434 { |
3410 updateScrollbars(); | 3435 updateScrollbars(); |
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4247 } | 4272 } |
4248 | 4273 |
4249 bool FrameView::canThrottleRendering() const | 4274 bool FrameView::canThrottleRendering() const |
4250 { | 4275 { |
4251 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4276 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
4252 return false; | 4277 return false; |
4253 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4278 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
4254 } | 4279 } |
4255 | 4280 |
4256 } // namespace blink | 4281 } // namespace blink |
OLD | NEW |