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 3425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3436 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const | 3436 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const |
3437 { | 3437 { |
3438 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); | 3438 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); |
3439 } | 3439 } |
3440 | 3440 |
3441 IntSize FrameView::contentsSize() const | 3441 IntSize FrameView::contentsSize() const |
3442 { | 3442 { |
3443 return m_contentsSize; | 3443 return m_contentsSize; |
3444 } | 3444 } |
3445 | 3445 |
| 3446 void FrameView::clipPaintRect(FloatRect* paintRect) const |
| 3447 { |
| 3448 // Paint the whole rect if "mainFrameClipsContent" is false, meaning that |
| 3449 // WebPreferences::record_whole_document is true. |
| 3450 if (!m_frame->settings()->mainFrameClipsContent()) |
| 3451 return; |
| 3452 |
| 3453 paintRect->intersect( |
| 3454 page()->chromeClient().visibleContentRectForPainting().value_or( |
| 3455 visibleContentRect())); |
| 3456 } |
| 3457 |
3446 IntPoint FrameView::minimumScrollPosition() const | 3458 IntPoint FrameView::minimumScrollPosition() const |
3447 { | 3459 { |
3448 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); | 3460 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); |
3449 } | 3461 } |
3450 | 3462 |
3451 void FrameView::adjustScrollbarOpacity() | 3463 void FrameView::adjustScrollbarOpacity() |
3452 { | 3464 { |
3453 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { | 3465 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { |
3454 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); | 3466 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); |
3455 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); | 3467 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3514 } | 3526 } |
3515 | 3527 |
3516 if (m_didScrollTimer.isActive()) | 3528 if (m_didScrollTimer.isActive()) |
3517 m_didScrollTimer.stop(); | 3529 m_didScrollTimer.stop(); |
3518 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); | 3530 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); |
3519 | 3531 |
3520 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 3532 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
3521 cache->handleScrollPositionChanged(this); | 3533 cache->handleScrollPositionChanged(this); |
3522 | 3534 |
3523 frame().loader().saveScrollState(); | 3535 frame().loader().saveScrollState(); |
3524 frame().loader().client()->didChangeScrollOffset(); | 3536 didChangeScrollOffset(); |
3525 | 3537 |
3526 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { | 3538 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { |
3527 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) | 3539 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) |
3528 documentLoader->initialScrollState().wasScrolledByUser = true; | 3540 documentLoader->initialScrollState().wasScrolledByUser = true; |
3529 } | 3541 } |
3530 | 3542 |
3531 if (scrollType != AnchoringScroll) | 3543 if (scrollType != AnchoringScroll) |
3532 clearScrollAnchor(); | 3544 clearScrollAnchor(); |
3533 } | 3545 } |
3534 | 3546 |
| 3547 void FrameView::didChangeScrollOffset() |
| 3548 { |
| 3549 frame().loader().client()->didChangeScrollOffset(); |
| 3550 if (frame().isMainFrame()) |
| 3551 frame().host()->chromeClient().mainFrameScrollOffsetChanged(); |
| 3552 } |
| 3553 |
3535 void FrameView::clearScrollAnchor() | 3554 void FrameView::clearScrollAnchor() |
3536 { | 3555 { |
3537 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) | 3556 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) |
3538 return; | 3557 return; |
3539 m_scrollAnchor.clear(); | 3558 m_scrollAnchor.clear(); |
3540 } | 3559 } |
3541 | 3560 |
3542 void FrameView::windowResizerRectChanged() | 3561 void FrameView::windowResizerRectChanged() |
3543 { | 3562 { |
3544 updateScrollbars(); | 3563 updateScrollbars(); |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4394 } | 4413 } |
4395 | 4414 |
4396 bool FrameView::canThrottleRendering() const | 4415 bool FrameView::canThrottleRendering() const |
4397 { | 4416 { |
4398 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4417 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
4399 return false; | 4418 return false; |
4400 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4419 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
4401 } | 4420 } |
4402 | 4421 |
4403 } // namespace blink | 4422 } // namespace blink |
OLD | NEW |