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 3372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3383 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const | 3383 IntRect FrameView::visibleContentRect(IncludeScrollbarsInRect scrollbarInclusion
) const |
3384 { | 3384 { |
3385 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); | 3385 return IntRect(flooredIntPoint(m_scrollPosition), visibleContentSize(scrollb
arInclusion)); |
3386 } | 3386 } |
3387 | 3387 |
3388 IntSize FrameView::contentsSize() const | 3388 IntSize FrameView::contentsSize() const |
3389 { | 3389 { |
3390 return m_contentsSize; | 3390 return m_contentsSize; |
3391 } | 3391 } |
3392 | 3392 |
| 3393 void FrameView::clipPaintRect(FloatRect* paintRect) const |
| 3394 { |
| 3395 // Paint the whole rect if "mainFrameClipsContent" is false, meaning that |
| 3396 // WebPreferences::record_whole_document is true. |
| 3397 if (!m_frame->settings()->mainFrameClipsContent()) |
| 3398 return; |
| 3399 |
| 3400 paintRect->intersect( |
| 3401 page()->chromeClient().visibleContentRectForPainting().value_or( |
| 3402 visibleContentRect())); |
| 3403 } |
| 3404 |
3393 IntPoint FrameView::minimumScrollPosition() const | 3405 IntPoint FrameView::minimumScrollPosition() const |
3394 { | 3406 { |
3395 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); | 3407 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y()); |
3396 } | 3408 } |
3397 | 3409 |
3398 void FrameView::adjustScrollbarOpacity() | 3410 void FrameView::adjustScrollbarOpacity() |
3399 { | 3411 { |
3400 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { | 3412 if (m_horizontalScrollbar && layerForHorizontalScrollbar()) { |
3401 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); | 3413 bool isOpaqueScrollbar = !m_horizontalScrollbar->isOverlayScrollbar(); |
3402 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); | 3414 layerForHorizontalScrollbar()->setContentsOpaque(isOpaqueScrollbar); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3461 } | 3473 } |
3462 | 3474 |
3463 if (m_didScrollTimer.isActive()) | 3475 if (m_didScrollTimer.isActive()) |
3464 m_didScrollTimer.stop(); | 3476 m_didScrollTimer.stop(); |
3465 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); | 3477 m_didScrollTimer.startOneShot(resourcePriorityUpdateDelayAfterScroll, BLINK_
FROM_HERE); |
3466 | 3478 |
3467 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) | 3479 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) |
3468 cache->handleScrollPositionChanged(this); | 3480 cache->handleScrollPositionChanged(this); |
3469 | 3481 |
3470 frame().loader().saveScrollState(); | 3482 frame().loader().saveScrollState(); |
3471 frame().loader().client()->didChangeScrollOffset(); | 3483 didChangeScrollOffset(); |
3472 | 3484 |
3473 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { | 3485 if (scrollType == CompositorScroll && m_frame->isMainFrame()) { |
3474 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) | 3486 if (DocumentLoader* documentLoader = m_frame->loader().documentLoader()) |
3475 documentLoader->initialScrollState().wasScrolledByUser = true; | 3487 documentLoader->initialScrollState().wasScrolledByUser = true; |
3476 } | 3488 } |
3477 | 3489 |
3478 if (scrollType != AnchoringScroll) | 3490 if (scrollType != AnchoringScroll) |
3479 clearScrollAnchor(); | 3491 clearScrollAnchor(); |
3480 } | 3492 } |
3481 | 3493 |
| 3494 void FrameView::didChangeScrollOffset() |
| 3495 { |
| 3496 frame().loader().client()->didChangeScrollOffset(); |
| 3497 if (frame().isMainFrame()) |
| 3498 frame().host()->chromeClient().mainFrameScrollOffsetChanged(); |
| 3499 } |
| 3500 |
3482 void FrameView::clearScrollAnchor() | 3501 void FrameView::clearScrollAnchor() |
3483 { | 3502 { |
3484 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) | 3503 if (!RuntimeEnabledFeatures::scrollAnchoringEnabled()) |
3485 return; | 3504 return; |
3486 m_scrollAnchor.clear(); | 3505 m_scrollAnchor.clear(); |
3487 } | 3506 } |
3488 | 3507 |
3489 void FrameView::windowResizerRectChanged() | 3508 void FrameView::windowResizerRectChanged() |
3490 { | 3509 { |
3491 updateScrollbars(); | 3510 updateScrollbars(); |
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4336 } | 4355 } |
4337 | 4356 |
4338 bool FrameView::canThrottleRendering() const | 4357 bool FrameView::canThrottleRendering() const |
4339 { | 4358 { |
4340 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4359 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
4341 return false; | 4360 return false; |
4342 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); | 4361 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot
tling); |
4343 } | 4362 } |
4344 | 4363 |
4345 } // namespace blink | 4364 } // namespace blink |
OLD | NEW |