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 3381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3392 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const | 3392 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const |
3393 { | 3393 { |
3394 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); | 3394 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); |
3395 } | 3395 } |
3396 | 3396 |
3397 IntSize FrameView::contentsSize() const | 3397 IntSize FrameView::contentsSize() const |
3398 { | 3398 { |
3399 return m_contentsSize; | 3399 return m_contentsSize; |
3400 } | 3400 } |
3401 | 3401 |
| 3402 void FrameView::clipPaintRect(FloatRect* paintRect) const |
| 3403 { |
| 3404 // Paint the whole rect if "mainFrameClipsContent" is false, meaning that |
| 3405 // WebPreferences::record_whole_document is true. |
| 3406 if (!m_frame->settings()->mainFrameClipsContent()) |
| 3407 return; |
| 3408 |
| 3409 paintRect->intersect( |
| 3410 page()->chromeClient().visibleContentRectForPainting().value_or( |
| 3411 visibleContentRect())); |
| 3412 } |
| 3413 |
3402 IntPoint FrameView::minimumScrollPosition() const | 3414 IntPoint FrameView::minimumScrollPosition() const |
3403 { | 3415 { |
3404 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); | 3416 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); |
3405 } | 3417 } |
3406 | 3418 |
3407 void FrameView::adjustScrollbarOpacity() | 3419 void FrameView::adjustScrollbarOpacity() |
3408 { | 3420 { |
3409 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { | 3421 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { |
3410 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); | 3422 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); |
3411 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); | 3423 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 } | 3482 } |
3471 | 3483 |
3472 if (m_didScrollTimer.isActive()) | 3484 if (m_didScrollTimer.isActive()) |
3473 m_didScrollTimer.stop(); | 3485 m_didScrollTimer.stop(); |
3474 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); | 3486 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); |
3475 | 3487 |
3476 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 3488 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
3477 cache->handleScrollPositionChanged(this); | 3489 cache->handleScrollPositionChanged(this); |
3478 | 3490 |
3479 frame().loader().saveScrollState(); | 3491 frame().loader().saveScrollState(); |
3480 frame().loader().client()->didChangeScrollOffset(); | 3492 didChangeScrollOffset(); |
3481 | 3493 |
3482 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { | 3494 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { |
3483 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) | 3495 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) |
3484 documentLoader->initialScrollState().wasScrolledByUser = true; | 3496 documentLoader->initialScrollState().wasScrolledByUser = true; |
3485 } | 3497 } |
3486 | 3498 |
3487 if (scrollType != AnchoringScroll) | 3499 if (scrollType != AnchoringScroll) |
3488 clearScrollAnchor(); | 3500 clearScrollAnchor(); |
3489 } | 3501 } |
3490 | 3502 |
| 3503 void FrameView::didChangeScrollOffset() |
| 3504 { |
| 3505 frame().loader().client()->didChangeScrollOffset(); |
| 3506 if (frame().isMainFrame()) |
| 3507 frame().host()->chromeClient().mainFrameScrollOffsetChanged(); |
| 3508 } |
| 3509 |
3491 void FrameView::clearScrollAnchor() | 3510 void FrameView::clearScrollAnchor() |
3492 { | 3511 { |
3493 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) | 3512 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) |
3494 return; | 3513 return; |
3495 m_scrollAnchor.clear(); | 3514 m_scrollAnchor.clear(); |
3496 } | 3515 } |
3497 | 3516 |
3498 void FrameView::windowResizerRectChanged() | 3517 void FrameView::windowResizerRectChanged() |
3499 { | 3518 { |
3500 updateScrollbars(); | 3519 updateScrollbars(); |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4349 } | 4368 } |
4350 | 4369 |
4351 bool FrameView::canThrottleRendering() const | 4370 bool FrameView::canThrottleRendering() const |
4352 { | 4371 { |
4353 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4372 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
4354 return false; | 4373 return false; |
4355 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4374 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
4356 } | 4375 } |
4357 | 4376 |
4358 } // namespace blink | 4377 } // namespace blink |
OLD | NEW |