2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #include "ScrollView.h"
29 #include "AXObjectCache.h"
30 #include "GraphicsContext.h"
31 #include "GraphicsLayer.h"
32 #include "HostWindow.h"
33 #include "PlatformMouseEvent.h"
34 #include "PlatformWheelEvent.h"
35 #include "ScrollAnimator.h"
36 #include "Scrollbar.h"
37 #include "ScrollbarTheme.h"
38 #include <wtf/StdLibExtras.h>
44 ScrollView::ScrollView()
45 : m_horizontalScrollbarMode(ScrollbarAuto)
46 , m_verticalScrollbarMode(ScrollbarAuto)
47 , m_horizontalScrollbarLock(false)
48 , m_verticalScrollbarLock(false)
49 , m_prohibitsScrolling(false)
50 , m_canBlitOnScroll(true)
51 , m_scrollbarsAvoidingResizer(0)
52 , m_scrollbarsSuppressed(false)
53 , m_inUpdateScrollbars(false)
54 , m_updateScrollbarsPass(0)
55 , m_drawPanScrollIcon(false)
56 , m_useFixedLayout(false)
57 , m_paintsEntireContents(false)
58 , m_clipsRepaints(true)
59 , m_delegatesScrolling(false)
60 , m_containsScrollableAreaWithOverlayScrollbars(false)
65 ScrollView::~ScrollView()
70 void ScrollView::addChild(PassRefPtr<Widget> prpChild)
72 Widget* child = prpChild.get();
73 ASSERT(child != this && !child->parent());
74 child->setParent(this);
75 m_children.add(prpChild);
76 if (child->platformWidget())
77 platformAddChild(child);
80 void ScrollView::removeChild(Widget* child)
82 ASSERT(child->parent() == this);
84 m_children.remove(child);
85 if (child->platformWidget())
86 platformRemoveChild(child);
89 void ScrollView::setHasHorizontalScrollbar(bool hasBar)
91 ASSERT(!hasBar || !avoidScrollbarCreation());
92 if (hasBar && !m_horizontalScrollbar) {
93 m_horizontalScrollbar = createScrollbar(HorizontalScrollbar);
94 addChild(m_horizontalScrollbar.get());
95 didAddHorizontalScrollbar(m_horizontalScrollbar.get());
96 m_horizontalScrollbar->styleChanged();
97 } else if (!hasBar && m_horizontalScrollbar) {
98 willRemoveHorizontalScrollbar(m_horizontalScrollbar.get());
99 removeChild(m_horizontalScrollbar.get());
100 m_horizontalScrollbar = 0;
103 if (AXObjectCache::accessibilityEnabled() && axObjectCache())
104 axObjectCache()->handleScrollbarUpdate(this);
107 void ScrollView::setHasVerticalScrollbar(bool hasBar)
109 ASSERT(!hasBar || !avoidScrollbarCreation());
110 if (hasBar && !m_verticalScrollbar) {
111 m_verticalScrollbar = createScrollbar(VerticalScrollbar);
112 addChild(m_verticalScrollbar.get());
113 didAddVerticalScrollbar(m_verticalScrollbar.get());
114 m_verticalScrollbar->styleChanged();
115 } else if (!hasBar && m_verticalScrollbar) {
116 willRemoveVerticalScrollbar(m_verticalScrollbar.get());
117 removeChild(m_verticalScrollbar.get());
118 m_verticalScrollbar = 0;
121 if (AXObjectCache::accessibilityEnabled() && axObjectCache())
122 axObjectCache()->handleScrollbarUpdate(this);
126 PassRefPtr<Scrollbar> ScrollView::createScrollbar(ScrollbarOrientation orientation)
128 return Scrollbar::createNativeScrollbar(this, orientation, RegularScrollbar);
131 void ScrollView::setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalMode,
132 bool horizontalLock, bool verticalLock)
134 bool needsUpdate = false;
136 if (horizontalMode != horizontalScrollbarMode() && !m_horizontalScrollbarLock) {
137 m_horizontalScrollbarMode = horizontalMode;
141 if (verticalMode != verticalScrollbarMode() && !m_verticalScrollbarLock) {
142 m_verticalScrollbarMode = verticalMode;
147 setHorizontalScrollbarLock();
150 setVerticalScrollbarLock();
155 if (platformWidget())
156 platformSetScrollbarModes();
158 updateScrollbars(scrollOffset());
162 void ScrollView::scrollbarModes(ScrollbarMode& horizontalMode, ScrollbarMode& verticalMode) const
164 if (platformWidget()) {
165 platformScrollbarModes(horizontalMode, verticalMode);
168 horizontalMode = m_horizontalScrollbarMode;
169 verticalMode = m_verticalScrollbarMode;
172 void ScrollView::setCanHaveScrollbars(bool canScroll)
174 ScrollbarMode newHorizontalMode;
175 ScrollbarMode newVerticalMode;
177 scrollbarModes(newHorizontalMode, newVerticalMode);
179 if (canScroll && newVerticalMode == ScrollbarAlwaysOff)
180 newVerticalMode = ScrollbarAuto;
182 newVerticalMode = ScrollbarAlwaysOff;
184 if (canScroll && newHorizontalMode == ScrollbarAlwaysOff)
185 newHorizontalMode = ScrollbarAuto;
187 newHorizontalMode = ScrollbarAlwaysOff;
189 setScrollbarModes(newHorizontalMode, newVerticalMode);
192 void ScrollView::setCanBlitOnScroll(bool b)
194 if (platformWidget()) {
195 platformSetCanBlitOnScroll(b);
199 m_canBlitOnScroll = b;
202 bool ScrollView::canBlitOnScroll() const
204 if (platformWidget())
205 return platformCanBlitOnScroll();
207 return m_canBlitOnScroll;
210 void ScrollView::setPaintsEntireContents(bool paintsEntireContents)
212 m_paintsEntireContents = paintsEntireContents;
215 void ScrollView::setClipsRepaints(bool clipsRepaints)
217 m_clipsRepaints = clipsRepaints;
220 void ScrollView::setDelegatesScrolling(bool delegatesScrolling)
222 if (m_delegatesScrolling == delegatesScrolling)
225 m_delegatesScrolling = delegatesScrolling;
226 delegatesScrollingDidChange();
230 IntRect ScrollView::visibleContentRect(bool includeScrollbars) const
232 if (platformWidget())
233 return platformVisibleContentRect(includeScrollbars);
235 if (!m_fixedVisibleContentRect.isEmpty())
236 return m_fixedVisibleContentRect;
238 int verticalScrollbarWidth = 0;
239 int horizontalScrollbarHeight = 0;
241 if (!includeScrollbars) {
242 if (Scrollbar* verticalBar = verticalScrollbar())
243 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBar->width() : 0;
244 if (Scrollbar* horizontalBar = horizontalScrollbar())
245 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horizontalBar->height() : 0;
248 return IntRect(m_scrollOffset.width(),
249 m_scrollOffset.height(),
250 max(0, width() - verticalScrollbarWidth),
251 max(0, height() - horizontalScrollbarHeight));
255 int ScrollView::layoutWidth() const
257 return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleWidth() : m_fixedLayoutSize.width();
260 int ScrollView::layoutHeight() const
262 return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleHeight() : m_fixedLayoutSize.height();
265 IntSize ScrollView::fixedLayoutSize() const
267 return m_fixedLayoutSize;
270 void ScrollView::setFixedLayoutSize(const IntSize& newSize)
272 if (fixedLayoutSize() == newSize)
274 m_fixedLayoutSize = newSize;
275 updateScrollbars(scrollOffset());
278 bool ScrollView::useFixedLayout() const
280 return m_useFixedLayout;
283 void ScrollView::setUseFixedLayout(bool enable)
285 if (useFixedLayout() == enable)
287 m_useFixedLayout = enable;
288 updateScrollbars(scrollOffset());
291 IntSize ScrollView::contentsSize() const
293 return m_contentsSize;
296 void ScrollView::setContentsSize(const IntSize& newSize)
298 if (contentsSize() == newSize)
300 m_contentsSize = newSize;
301 if (platformWidget())
302 platformSetContentsSize();
304 updateScrollbars(scrollOffset());
305 updateOverhangAreas();
308 IntPoint ScrollView::maximumScrollPosition() const
310 IntPoint maximumOffset(contentsWidth() - visibleWidth() - scrollOrigin().x(), contentsHeight() - visibleHeight() - scrollOrigin().y());
311 maximumOffset.clampNegativeToZero();
312 return maximumOffset;
315 IntPoint ScrollView::minimumScrollPosition() const
317 return IntPoint(-scrollOrigin().x(), -scrollOrigin().y());
320 IntPoint ScrollView::adjustScrollPositionWithinRange(const IntPoint& scrollPoint) const
322 IntPoint newScrollPosition = scrollPoint.shrunkTo(maximumScrollPosition());
323 newScrollPosition = newScrollPosition.expandedTo(minimumScrollPosition());
324 return newScrollPosition;
327 int ScrollView::scrollSize(ScrollbarOrientation orientation) const
329 Scrollbar* scrollbar = ((orientation == HorizontalScrollbar) ? m_horizontalScrollbar : m_verticalScrollbar).get();
330 return scrollbar ? (scrollbar->totalSize() - scrollbar->visibleSize()) : 0;
333 void ScrollView::notifyPageThatContentAreaWillPaint() const
337 void ScrollView::setScrollOffset(const IntPoint& offset)
339 int horizontalOffset = offset.x();
340 int verticalOffset = offset.y();
341 if (constrainsScrollingToContentEdge()) {
342 horizontalOffset = max(min(horizontalOffset, contentsWidth() - visibleWidth()), 0);
343 verticalOffset = max(min(verticalOffset, contentsHeight() - visibleHeight()), 0);
346 IntSize newOffset = m_scrollOffset;
347 newOffset.setWidth(horizontalOffset - scrollOrigin().x());
348 newOffset.setHeight(verticalOffset - scrollOrigin().y());
353 void ScrollView::scrollTo(const IntSize& newOffset)
355 IntSize scrollDelta = newOffset - m_scrollOffset;
356 if (scrollDelta == IntSize())
358 m_scrollOffset = newOffset;
360 if (scrollbarsSuppressed())
363 repaintFixedElementsAfterScrolling();
364 scrollContents(scrollDelta);
367 int ScrollView::scrollPosition(Scrollbar* scrollbar) const
369 if (scrollbar->orientation() == HorizontalScrollbar)
370 return scrollPosition().x() + scrollOrigin().x();
371 if (scrollbar->orientation() == VerticalScrollbar)
372 return scrollPosition().y() + scrollOrigin().y();
376 void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
378 if (prohibitsScrolling())
381 if (platformWidget()) {
382 platformSetScrollPosition(scrollPoint);
386 #if USE(TILED_BACKING_STORE)
387 if (delegatesScrolling()) {
388 hostWindow()->delegatedScrollRequested(scrollPoint);
393 IntPoint newScrollPosition = adjustScrollPositionWithinRange(scrollPoint);
395 if (newScrollPosition == scrollPosition())
398 updateScrollbars(IntSize(newScrollPosition.x(), newScrollPosition.y()));
401 bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)
403 if (platformWidget())
404 return platformScroll(direction, granularity);
406 return ScrollableArea::scroll(direction, granularity);
409 bool ScrollView::logicalScroll(ScrollLogicalDirection direction, ScrollGranularity granularity)
411 return scroll(logicalToPhysical(direction, isVerticalDocument(), isFlippedDocument()), granularity);
414 IntSize ScrollView::overhangAmount() const
418 int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
419 if (physicalScrollY < 0)
420 stretch.setHeight(physicalScrollY);
421 else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight())
422 stretch.setHeight(physicalScrollY - (contentsHeight() - visibleHeight()));
424 int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
425 if (physicalScrollX < 0)
426 stretch.setWidth(physicalScrollX);
427 else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth())
428 stretch.setWidth(physicalScrollX - (contentsWidth() - visibleWidth()));
433 void ScrollView::windowResizerRectChanged()
435 if (platformWidget())
438 updateScrollbars(scrollOffset());
441 static const unsigned cMaxUpdateScrollbarsPass = 2;
443 void ScrollView::updateScrollbars(const IntSize& desiredOffset)
445 if (m_inUpdateScrollbars || prohibitsScrolling() || delegatesScrolling() || platformWidget())
448 // If we came in here with the view already needing a layout, then go ahead and do that
449 // first. (This will be the common case, e.g., when the page changes due to window resizing for example).
450 // This layout will not re-enter updateScrollbars and does not count towards our max layout pass total.
451 if (!m_scrollbarsSuppressed) {
452 m_inUpdateScrollbars = true;
453 visibleContentsResized();
454 m_inUpdateScrollbars = false;
457 IntRect oldScrollCornerRect = scrollCornerRect();
459 bool hasHorizontalScrollbar = m_horizontalScrollbar;
460 bool hasVerticalScrollbar = m_verticalScrollbar;
462 bool newHasHorizontalScrollbar = hasHorizontalScrollbar;
463 bool newHasVerticalScrollbar = hasVerticalScrollbar;
465 ScrollbarMode hScroll = m_horizontalScrollbarMode;
466 ScrollbarMode vScroll = m_verticalScrollbarMode;
468 if (hScroll != ScrollbarAuto)
469 newHasHorizontalScrollbar = (hScroll == ScrollbarAlwaysOn);
470 if (vScroll != ScrollbarAuto)
471 newHasVerticalScrollbar = (vScroll == ScrollbarAlwaysOn);
473 if (m_scrollbarsSuppressed || (hScroll != ScrollbarAuto && vScroll != ScrollbarAuto)) {
474 if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation()))
475 setHasHorizontalScrollbar(newHasHorizontalScrollbar);
476 if (hasVerticalScrollbar != newHasVerticalScrollbar && (hasVerticalScrollbar || !avoidScrollbarCreation()))
477 setHasVerticalScrollbar(newHasVerticalScrollbar);
479 bool sendContentResizedNotification = false;
481 IntSize docSize = contentsSize();
482 IntSize frameSize = frameRect().size();
484 if (hScroll == ScrollbarAuto) {
485 newHasHorizontalScrollbar = docSize.width() > visibleWidth();
486 if (newHasHorizontalScrollbar && !m_updateScrollbarsPass && docSize.width() <= frameSize.width() && docSize.height() <= frameSize.height())
487 newHasHorizontalScrollbar = false;
489 if (vScroll == ScrollbarAuto) {
490 newHasVerticalScrollbar = docSize.height() > visibleHeight();
491 if (newHasVerticalScrollbar && !m_updateScrollbarsPass && docSize.width() <= frameSize.width() && docSize.height() <= frameSize.height())
492 newHasVerticalScrollbar = false;
495 // If we ever turn one scrollbar off, always turn the other one off too. Never ever
496 // try to both gain/lose a scrollbar in the same pass.
497 if (!newHasHorizontalScrollbar && hasHorizontalScrollbar && vScroll != ScrollbarAlwaysOn)
498 newHasVerticalScrollbar = false;
499 if (!newHasVerticalScrollbar && hasVerticalScrollbar && hScroll != ScrollbarAlwaysOn)
500 newHasHorizontalScrollbar = false;
502 if (hasHorizontalScrollbar != newHasHorizontalScrollbar && (hasHorizontalScrollbar || !avoidScrollbarCreation())) {
503 if (scrollOrigin().y() && !newHasHorizontalScrollbar)
504 ScrollableArea::setScrollOrigin(IntPoint(scrollOrigin().x(), scrollOrigin().y() - m_horizontalScrollbar->height()));
505 if (m_horizontalScrollbar)
506 m_horizontalScrollbar->invalidate();
507 setHasHorizontalScrollbar(newHasHorizontalScrollbar);
508 sendContentResizedNotification = true;
511 if (hasVerticalScrollbar != newHasVerticalScrollbar && (hasVerticalScrollbar || !avoidScrollbarCreation())) {
512 if (scrollOrigin().x() && !newHasVerticalScrollbar)
513 ScrollableArea::setScrollOrigin(IntPoint(scrollOrigin().x() - m_verticalScrollbar->width(), scrollOrigin().y()));
514 if (m_verticalScrollbar)
515 m_verticalScrollbar->invalidate();
516 setHasVerticalScrollbar(newHasVerticalScrollbar);
517 sendContentResizedNotification = true;
520 if (sendContentResizedNotification && m_updateScrollbarsPass < cMaxUpdateScrollbarsPass) {
521 m_updateScrollbarsPass++;
523 visibleContentsResized();
524 IntSize newDocSize = contentsSize();
525 if (newDocSize == docSize) {
526 // The layout with the new scroll state had no impact on
527 // the document's overall size, so updateScrollbars didn't get called.
529 updateScrollbars(desiredOffset);
531 m_updateScrollbarsPass--;
535 // Set up the range (and page step/line step), but only do this if we're not in a nested call (to avoid
536 // doing it multiple times).
537 if (m_updateScrollbarsPass)
540 m_inUpdateScrollbars = true;
542 if (m_horizontalScrollbar) {
543 int clientWidth = visibleWidth();
544 int pageStep = max(max<int>(clientWidth * Scrollbar::minFractionToStepWhenPaging(), clientWidth - Scrollbar::maxOverlapBetweenPages()), 1);
545 IntRect oldRect(m_horizontalScrollbar->frameRect());
547 height() - m_horizontalScrollbar->height(),
548 width() - (m_verticalScrollbar ? m_verticalScrollbar->width() : 0),
549 m_horizontalScrollbar->height());
550 m_horizontalScrollbar->setFrameRect(hBarRect);
551 if (!m_scrollbarsSuppressed && oldRect != m_horizontalScrollbar->frameRect())
552 m_horizontalScrollbar->invalidate();
554 if (m_scrollbarsSuppressed)
555 m_horizontalScrollbar->setSuppressInvalidation(true);
556 m_horizontalScrollbar->setEnabled(contentsWidth() > clientWidth);
557 m_horizontalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
558 m_horizontalScrollbar->setProportion(clientWidth, contentsWidth());
559 if (m_scrollbarsSuppressed)
560 m_horizontalScrollbar->setSuppressInvalidation(false);
563 if (m_verticalScrollbar) {
564 int clientHeight = visibleHeight();
565 int pageStep = max(max<int>(clientHeight * Scrollbar::minFractionToStepWhenPaging(), clientHeight - Scrollbar::maxOverlapBetweenPages()), 1);
566 IntRect oldRect(m_verticalScrollbar->frameRect());
567 IntRect vBarRect(width() - m_verticalScrollbar->width(),
569 m_verticalScrollbar->width(),
570 height() - (m_horizontalScrollbar ? m_horizontalScrollbar->height() : 0));
571 m_verticalScrollbar->setFrameRect(vBarRect);
572 if (!m_scrollbarsSuppressed && oldRect != m_verticalScrollbar->frameRect())
573 m_verticalScrollbar->invalidate();
575 if (m_scrollbarsSuppressed)
576 m_verticalScrollbar->setSuppressInvalidation(true);
577 m_verticalScrollbar->setEnabled(contentsHeight() > clientHeight);
578 m_verticalScrollbar->setSteps(Scrollbar::pixelsPerLineStep(), pageStep);
579 m_verticalScrollbar->setProportion(clientHeight, contentsHeight());
580 if (m_scrollbarsSuppressed)
581 m_verticalScrollbar->setSuppressInvalidation(false);
584 if (hasHorizontalScrollbar != (m_horizontalScrollbar != 0) || hasVerticalScrollbar != (m_verticalScrollbar != 0)) {
585 // FIXME: Is frameRectsChanged really necessary here? Have any frame rects changed?
587 positionScrollbarLayers();
588 updateScrollCorner();
589 if (!m_horizontalScrollbar && !m_verticalScrollbar)
590 invalidateScrollCornerRect(oldScrollCornerRect);
593 IntPoint adjustedScrollPosition = adjustScrollPositionWithinRange(IntPoint(desiredOffset));
594 if (adjustedScrollPosition != scrollPosition() || scrollOriginChanged()) {
595 ScrollableArea::scrollToOffsetWithoutAnimation(adjustedScrollPosition + IntSize(scrollOrigin().x(), scrollOrigin().y()));
596 resetScrollOriginChanged();
599 // Make sure the scrollbar offsets are up to date.
600 if (m_horizontalScrollbar)
601 m_horizontalScrollbar->offsetDidChange();
602 if (m_verticalScrollbar)
603 m_verticalScrollbar->offsetDidChange();
605 m_inUpdateScrollbars = false;
608 const int panIconSizeLength = 16;
610 IntRect ScrollView::rectToCopyOnScroll() const
612 IntRect scrollViewRect = convertToRootView(IntRect(0, 0, visibleWidth(), visibleHeight()));
613 if (hasOverlayScrollbars()) {
614 int verticalScrollbarWidth = (verticalScrollbar() && !hasLayerForVerticalScrollbar()) ? verticalScrollbar()->width() : 0;
615 int horizontalScrollbarHeight = (horizontalScrollbar() && !hasLayerForHorizontalScrollbar()) ? horizontalScrollbar()->height() : 0;
617 scrollViewRect.setWidth(scrollViewRect.width() - verticalScrollbarWidth);
618 scrollViewRect.setHeight(scrollViewRect.height() - horizontalScrollbarHeight);
620 return scrollViewRect;
623 void ScrollView::scrollContents(const IntSize& scrollDelta)
628 // Since scrolling is double buffered, we will be blitting the scroll view's intersection
629 // with the clip rect every time to keep it smooth.
630 IntRect clipRect = windowClipRect();
631 IntRect scrollViewRect = rectToCopyOnScroll();
632 IntRect updateRect = clipRect;
633 updateRect.intersect(scrollViewRect);
635 // Invalidate the root view (not the backing store).
636 hostWindow()->invalidateRootView(updateRect, false /*immediate*/);
638 if (m_drawPanScrollIcon) {
639 // FIXME: the pan icon is broken when accelerated compositing is on, since it will draw under the compositing layers.
640 // https://bugs.webkit.org/show_bug.cgi?id=47837
641 int panIconDirtySquareSizeLength = 2 * (panIconSizeLength + max(abs(scrollDelta.width()), abs(scrollDelta.height()))); // We only want to repaint what's necessary
642 IntPoint panIconDirtySquareLocation = IntPoint(m_panScrollIconPoint.x() - (panIconDirtySquareSizeLength / 2), m_panScrollIconPoint.y() - (panIconDirtySquareSizeLength / 2));
643 IntRect panScrollIconDirtyRect = IntRect(panIconDirtySquareLocation, IntSize(panIconDirtySquareSizeLength, panIconDirtySquareSizeLength));
644 panScrollIconDirtyRect.intersect(clipRect);
645 hostWindow()->invalidateContentsAndRootView(panScrollIconDirtyRect, false /*immediate*/);
648 if (canBlitOnScroll()) { // The main frame can just blit the WebView window
649 // FIXME: Find a way to scroll subframes with this faster path
650 if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
651 scrollContentsSlowPath(updateRect);
653 // We need to go ahead and repaint the entire backing store. Do it now before moving the
655 scrollContentsSlowPath(updateRect);
658 // Invalidate the overhang areas if they are visible.
659 updateOverhangAreas();
661 // This call will move children with native widgets (plugins) and invalidate them as well.
664 // Now blit the backingstore into the window which should be very fast.
665 hostWindow()->invalidateRootView(IntRect(), true);
668 bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
670 hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
674 void ScrollView::scrollContentsSlowPath(const IntRect& updateRect)
676 hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
679 IntPoint ScrollView::rootViewToContents(const IntPoint& rootViewPoint) const
681 IntPoint viewPoint = convertFromRootView(rootViewPoint);
682 return viewPoint + scrollOffset();
685 IntPoint ScrollView::contentsToRootView(const IntPoint& contentsPoint) const
687 IntPoint viewPoint = contentsPoint - scrollOffset();
688 return convertToRootView(viewPoint);
691 IntRect ScrollView::rootViewToContents(const IntRect& rootViewRect) const
693 IntRect viewRect = convertFromRootView(rootViewRect);
694 viewRect.move(scrollOffset());
698 IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const
700 IntRect viewRect = contentsRect;
701 viewRect.move(-scrollOffset());
702 return convertToRootView(viewRect);
705 IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
707 if (delegatesScrolling())
708 return convertFromContainingWindow(windowPoint);
710 IntPoint viewPoint = convertFromContainingWindow(windowPoint);
711 return viewPoint + scrollOffset();
714 IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const
716 if (delegatesScrolling())
717 return convertToContainingWindow(contentsPoint);
719 IntPoint viewPoint = contentsPoint - scrollOffset();
720 return convertToContainingWindow(viewPoint);
723 IntRect ScrollView::windowToContents(const IntRect& windowRect) const
725 if (delegatesScrolling())
726 return convertFromContainingWindow(windowRect);
728 IntRect viewRect = convertFromContainingWindow(windowRect);
729 viewRect.move(scrollOffset());
733 IntRect ScrollView::contentsToWindow(const IntRect& contentsRect) const
735 if (delegatesScrolling())
736 return convertToContainingWindow(contentsRect);
738 IntRect viewRect = contentsRect;
739 viewRect.move(-scrollOffset());
740 return convertToContainingWindow(viewRect);
743 IntRect ScrollView::contentsToScreen(const IntRect& rect) const
745 if (platformWidget())
746 return platformContentsToScreen(rect);
749 return hostWindow()->rootViewToScreen(contentsToRootView(rect));
752 IntPoint ScrollView::screenToContents(const IntPoint& point) const
754 if (platformWidget())
755 return platformScreenToContents(point);
758 return rootViewToContents(hostWindow()->screenToRootView(point));
761 bool ScrollView::containsScrollbarsAvoidingResizer() const
763 return !m_scrollbarsAvoidingResizer;
766 void ScrollView::adjustScrollbarsAvoidingResizerCount(int overlapDelta)
768 int oldCount = m_scrollbarsAvoidingResizer;
769 m_scrollbarsAvoidingResizer += overlapDelta;
771 parent()->adjustScrollbarsAvoidingResizerCount(overlapDelta);
772 else if (!scrollbarsSuppressed()) {
773 // If we went from n to 0 or from 0 to n and we're the outermost view,
774 // we need to invalidate the windowResizerRect(), since it will now need to paint
776 if ((oldCount > 0 && m_scrollbarsAvoidingResizer == 0) ||
777 (oldCount == 0 && m_scrollbarsAvoidingResizer > 0))
778 invalidateRect(windowResizerRect());
782 void ScrollView::setParent(ScrollView* parentView)
784 if (parentView == parent())
787 if (m_scrollbarsAvoidingResizer && parent())
788 parent()->adjustScrollbarsAvoidingResizerCount(-m_scrollbarsAvoidingResizer);
790 Widget::setParent(parentView);
792 if (m_scrollbarsAvoidingResizer && parent())
793 parent()->adjustScrollbarsAvoidingResizerCount(m_scrollbarsAvoidingResizer);
796 void ScrollView::setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress)
798 if (suppressed == m_scrollbarsSuppressed)
801 m_scrollbarsSuppressed = suppressed;
803 if (platformWidget())
804 platformSetScrollbarsSuppressed(repaintOnUnsuppress);
805 else if (repaintOnUnsuppress && !suppressed) {
806 if (m_horizontalScrollbar)
807 m_horizontalScrollbar->invalidate();
808 if (m_verticalScrollbar)
809 m_verticalScrollbar->invalidate();
811 // Invalidate the scroll corner too on unsuppress.
812 invalidateRect(scrollCornerRect());
816 Scrollbar* ScrollView::scrollbarAtPoint(const IntPoint& windowPoint)
818 if (platformWidget())
821 IntPoint viewPoint = convertFromContainingWindow(windowPoint);
822 if (m_horizontalScrollbar && m_horizontalScrollbar->shouldParticipateInHitTesting() && m_horizontalScrollbar->frameRect().contains(viewPoint))
823 return m_horizontalScrollbar.get();
824 if (m_verticalScrollbar && m_verticalScrollbar->shouldParticipateInHitTesting() && m_verticalScrollbar->frameRect().contains(viewPoint))
825 return m_verticalScrollbar.get();
829 void ScrollView::setScrollbarOverlayStyle(ScrollbarOverlayStyle overlayStyle)
831 ScrollableArea::setScrollbarOverlayStyle(overlayStyle);
832 platformSetScrollbarOverlayStyle(overlayStyle);
835 void ScrollView::setFrameRect(const IntRect& newRect)
837 IntRect oldRect = frameRect();
839 if (newRect == oldRect)
842 Widget::setFrameRect(newRect);
846 updateScrollbars(scrollOffset());
848 if (!m_useFixedLayout && oldRect.size() != newRect.size())
852 void ScrollView::frameRectsChanged()
854 if (platformWidget())
857 HashSet<RefPtr<Widget> >::const_iterator end = m_children.end();
858 for (HashSet<RefPtr<Widget> >::const_iterator current = m_children.begin(); current != end; ++current)
859 (*current)->frameRectsChanged();
862 #if USE(ACCELERATED_COMPOSITING)
863 static void positionScrollbarLayer(GraphicsLayer* graphicsLayer, Scrollbar* scrollbar)
865 if (!graphicsLayer || !scrollbar)
868 IntRect scrollbarRect = scrollbar->frameRect();
869 graphicsLayer->setPosition(scrollbarRect.location());
871 if (scrollbarRect.size() == graphicsLayer->size())
874 graphicsLayer->setSize(scrollbarRect.size());
876 if (graphicsLayer->hasContentsLayer()) {
877 graphicsLayer->setContentsRect(IntRect(0, 0, scrollbarRect.width(), scrollbarRect.height()));
881 graphicsLayer->setDrawsContent(true);
882 graphicsLayer->setNeedsDisplay();
885 static void positionScrollCornerLayer(GraphicsLayer* graphicsLayer, const IntRect& cornerRect)
889 graphicsLayer->setDrawsContent(!cornerRect.isEmpty());
890 graphicsLayer->setPosition(cornerRect.location());
891 if (cornerRect.size() != graphicsLayer->size())
892 graphicsLayer->setNeedsDisplay();
893 graphicsLayer->setSize(cornerRect.size());
898 void ScrollView::positionScrollbarLayers()
900 #if USE(ACCELERATED_COMPOSITING)
901 positionScrollbarLayer(layerForHorizontalScrollbar(), horizontalScrollbar());
902 positionScrollbarLayer(layerForVerticalScrollbar(), verticalScrollbar());
903 positionScrollCornerLayer(layerForScrollCorner(), scrollCornerRect());
907 void ScrollView::repaintContentRectangle(const IntRect& rect, bool now)
909 IntRect paintRect = rect;
910 if (clipsRepaints() && !paintsEntireContents())
911 paintRect.intersect(visibleContentRect());
912 if (paintRect.isEmpty())
915 if (platformWidget()) {
916 notifyPageThatContentAreaWillPaint();
917 platformRepaintContentRectangle(paintRect, now);
922 hostWindow()->invalidateContentsAndRootView(contentsToWindow(paintRect), now /*immediate*/);
925 IntRect ScrollView::scrollCornerRect() const
929 if (hasOverlayScrollbars())
932 if (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0) {
933 cornerRect.unite(IntRect(m_horizontalScrollbar->width(),
934 height() - m_horizontalScrollbar->height(),
935 width() - m_horizontalScrollbar->width(),
936 m_horizontalScrollbar->height()));
939 if (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0) {
940 cornerRect.unite(IntRect(width() - m_verticalScrollbar->width(),
941 m_verticalScrollbar->height(),
942 m_verticalScrollbar->width(),
943 height() - m_verticalScrollbar->height()));
949 bool ScrollView::isScrollCornerVisible() const
951 return !scrollCornerRect().isEmpty();
954 void ScrollView::scrollbarStyleChanged(int, bool forceUpdate)
960 updateScrollbars(scrollOffset());
961 positionScrollbarLayers();
964 void ScrollView::updateScrollCorner()
968 void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& cornerRect)
970 ScrollbarTheme::theme()->paintScrollCorner(this, context, cornerRect);
973 void ScrollView::invalidateScrollCornerRect(const IntRect& rect)
975 invalidateRect(rect);
978 void ScrollView::paintScrollbars(GraphicsContext* context, const IntRect& rect)
980 if (m_horizontalScrollbar
981 #if USE(ACCELERATED_COMPOSITING)
982 && !layerForHorizontalScrollbar()
985 m_horizontalScrollbar->paint(context, rect);
986 if (m_verticalScrollbar
987 #if USE(ACCELERATED_COMPOSITING)
988 && !layerForVerticalScrollbar()
991 m_verticalScrollbar->paint(context, rect);
993 #if USE(ACCELERATED_COMPOSITING)
994 if (layerForScrollCorner())
997 paintScrollCorner(context, scrollCornerRect());
1000 void ScrollView::paintPanScrollIcon(GraphicsContext* context)
1002 static Image* panScrollIcon = Image::loadPlatformResource("panIcon").leakRef();
1003 context->drawImage(panScrollIcon, ColorSpaceDeviceRGB, m_panScrollIconPoint);
1006 void ScrollView::paint(GraphicsContext* context, const IntRect& rect)
1008 if (platformWidget()) {
1009 Widget::paint(context, rect);
1013 if (context->paintingDisabled() && !context->updatingControlTints())
1016 notifyPageThatContentAreaWillPaint();
1018 // If we encounter any overlay scrollbars as we paint, this will be set to true.
1019 m_containsScrollableAreaWithOverlayScrollbars = false;
1021 IntRect clipRect = frameRect();
1022 if (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
1023 clipRect.setWidth(clipRect.width() - verticalScrollbar()->width());
1024 if (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
1025 clipRect.setHeight(clipRect.height() - horizontalScrollbar()->height());
1027 IntRect documentDirtyRect = rect;
1028 documentDirtyRect.intersect(clipRect);
1030 if (!documentDirtyRect.isEmpty()) {
1031 GraphicsContextStateSaver stateSaver(*context);
1033 context->translate(x(), y());
1034 documentDirtyRect.moveBy(-location());
1036 if (!paintsEntireContents()) {
1037 context->translate(-scrollX(), -scrollY());
1038 documentDirtyRect.moveBy(scrollPosition());
1040 context->clip(visibleContentRect());
1043 paintContents(context, documentDirtyRect);
1046 #if USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
1047 if (!layerForOverhangAreas())
1048 calculateAndPaintOverhangAreas(context, rect);
1050 calculateAndPaintOverhangAreas(context, rect);
1053 // Now paint the scrollbars.
1054 if (!m_scrollbarsSuppressed && (m_horizontalScrollbar || m_verticalScrollbar)) {
1055 GraphicsContextStateSaver stateSaver(*context);
1056 IntRect scrollViewDirtyRect = rect;
1057 scrollViewDirtyRect.intersect(frameRect());
1058 context->translate(x(), y());
1059 scrollViewDirtyRect.moveBy(-location());
1061 paintScrollbars(context, scrollViewDirtyRect);
1064 // Paint the panScroll Icon
1065 if (m_drawPanScrollIcon)
1066 paintPanScrollIcon(context);
1069 void ScrollView::calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntRect& verticalOverhangRect)
1071 int verticalScrollbarWidth = (verticalScrollbar() && !verticalScrollbar()->isOverlayScrollbar())
1072 ? verticalScrollbar()->width() : 0;
1073 int horizontalScrollbarHeight = (horizontalScrollbar() && !horizontalScrollbar()->isOverlayScrollbar())
1074 ? horizontalScrollbar()->height() : 0;
1076 int physicalScrollY = scrollPosition().y() + scrollOrigin().y();
1077 if (physicalScrollY < 0) {
1078 horizontalOverhangRect = frameRect();
1079 horizontalOverhangRect.setHeight(-physicalScrollY);
1080 horizontalOverhangRect.setWidth(horizontalOverhangRect.width() - verticalScrollbarWidth);
1081 } else if (contentsHeight() && physicalScrollY > contentsHeight() - visibleHeight()) {
1082 int height = physicalScrollY - (contentsHeight() - visibleHeight());
1083 horizontalOverhangRect = frameRect();
1084 horizontalOverhangRect.setY(frameRect().maxY() - height - horizontalScrollbarHeight);
1085 horizontalOverhangRect.setHeight(height);
1086 horizontalOverhangRect.setWidth(horizontalOverhangRect.width() - verticalScrollbarWidth);
1089 int physicalScrollX = scrollPosition().x() + scrollOrigin().x();
1090 if (physicalScrollX < 0) {
1091 verticalOverhangRect.setWidth(-physicalScrollX);
1092 verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height() - horizontalScrollbarHeight);
1093 verticalOverhangRect.setX(frameRect().x());
1094 if (horizontalOverhangRect.y() == frameRect().y())
1095 verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
1097 verticalOverhangRect.setY(frameRect().y());
1098 } else if (contentsWidth() && physicalScrollX > contentsWidth() - visibleWidth()) {
1099 int width = physicalScrollX - (contentsWidth() - visibleWidth());
1100 verticalOverhangRect.setWidth(width);
1101 verticalOverhangRect.setHeight(frameRect().height() - horizontalOverhangRect.height() - horizontalScrollbarHeight);
1102 verticalOverhangRect.setX(frameRect().maxX() - width - verticalScrollbarWidth);
1103 if (horizontalOverhangRect.y() == frameRect().y())
1104 verticalOverhangRect.setY(frameRect().y() + horizontalOverhangRect.height());
1106 verticalOverhangRect.setY(frameRect().y());
1110 void ScrollView::updateOverhangAreas()
1115 IntRect horizontalOverhangRect;
1116 IntRect verticalOverhangRect;
1117 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
1118 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(CHROMIUM) && ENABLE(RUBBER_BANDING)
1119 if (GraphicsLayer* overhangLayer = layerForOverhangAreas()) {
1120 bool hasOverhangArea = !horizontalOverhangRect.isEmpty() || !verticalOverhangRect.isEmpty();
1121 overhangLayer->setDrawsContent(hasOverhangArea);
1122 if (hasOverhangArea)
1123 overhangLayer->setNeedsDisplay();
1126 if (!horizontalOverhangRect.isEmpty())
1127 hostWindow()->invalidateContentsAndRootView(horizontalOverhangRect, false /*immediate*/);
1128 if (!verticalOverhangRect.isEmpty())
1129 hostWindow()->invalidateContentsAndRootView(verticalOverhangRect, false /*immediate*/);
1132 void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& horizontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRect)
1134 ScrollbarTheme::theme()->paintOverhangAreas(this, context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
1137 void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const IntRect& dirtyRect)
1139 IntRect horizontalOverhangRect;
1140 IntRect verticalOverhangRect;
1141 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRect);
1143 if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(verticalOverhangRect))
1144 paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect, dirtyRect);
1147 bool ScrollView::isPointInScrollbarCorner(const IntPoint& windowPoint)
1149 if (!scrollbarCornerPresent())
1152 IntPoint viewPoint = convertFromContainingWindow(windowPoint);
1154 if (m_horizontalScrollbar) {
1155 int horizontalScrollbarYMin = m_horizontalScrollbar->frameRect().y();
1156 int horizontalScrollbarYMax = m_horizontalScrollbar->frameRect().y() + m_horizontalScrollbar->frameRect().height();
1157 int horizontalScrollbarXMin = m_horizontalScrollbar->frameRect().x() + m_horizontalScrollbar->frameRect().width();
1159 return viewPoint.y() > horizontalScrollbarYMin && viewPoint.y() < horizontalScrollbarYMax && viewPoint.x() > horizontalScrollbarXMin;
1162 int verticalScrollbarXMin = m_verticalScrollbar->frameRect().x();
1163 int verticalScrollbarXMax = m_verticalScrollbar->frameRect().x() + m_verticalScrollbar->frameRect().width();
1164 int verticalScrollbarYMin = m_verticalScrollbar->frameRect().y() + m_verticalScrollbar->frameRect().height();
1166 return viewPoint.x() > verticalScrollbarXMin && viewPoint.x() < verticalScrollbarXMax && viewPoint.y() > verticalScrollbarYMin;
1169 bool ScrollView::scrollbarCornerPresent() const
1171 return (m_horizontalScrollbar && width() - m_horizontalScrollbar->width() > 0)
1172 || (m_verticalScrollbar && height() - m_verticalScrollbar->height() > 0);
1175 IntRect ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntRect& localRect) const
1177 // Scrollbars won't be transformed within us
1178 IntRect newRect = localRect;
1179 newRect.moveBy(scrollbar->location());
1183 IntRect ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntRect& parentRect) const
1185 IntRect newRect = parentRect;
1186 // Scrollbars won't be transformed within us
1187 newRect.moveBy(-scrollbar->location());
1191 // FIXME: test these on windows
1192 IntPoint ScrollView::convertFromScrollbarToContainingView(const Scrollbar* scrollbar, const IntPoint& localPoint) const
1194 // Scrollbars won't be transformed within us
1195 IntPoint newPoint = localPoint;
1196 newPoint.moveBy(scrollbar->location());
1200 IntPoint ScrollView::convertFromContainingViewToScrollbar(const Scrollbar* scrollbar, const IntPoint& parentPoint) const
1202 IntPoint newPoint = parentPoint;
1203 // Scrollbars won't be transformed within us
1204 newPoint.moveBy(-scrollbar->location());
1208 void ScrollView::setParentVisible(bool visible)
1210 if (isParentVisible() == visible)
1213 Widget::setParentVisible(visible);
1215 if (!isSelfVisible())
1218 HashSet<RefPtr<Widget> >::iterator end = m_children.end();
1219 for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
1220 (*it)->setParentVisible(visible);
1223 void ScrollView::show()
1225 if (!isSelfVisible()) {
1226 setSelfVisible(true);
1227 if (isParentVisible()) {
1228 HashSet<RefPtr<Widget> >::iterator end = m_children.end();
1229 for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
1230 (*it)->setParentVisible(true);
1237 void ScrollView::hide()
1239 if (isSelfVisible()) {
1240 if (isParentVisible()) {
1241 HashSet<RefPtr<Widget> >::iterator end = m_children.end();
1242 for (HashSet<RefPtr<Widget> >::iterator it = m_children.begin(); it != end; ++it)
1243 (*it)->setParentVisible(false);
1245 setSelfVisible(false);
1251 bool ScrollView::isOffscreen() const
1253 if (platformWidget())
1254 return platformIsOffscreen();
1259 // FIXME: Add a HostWindow::isOffscreen method here. Since only Mac implements this method
1260 // currently, we can add the method when the other platforms decide to implement this concept.
1265 void ScrollView::addPanScrollIcon(const IntPoint& iconPosition)
1269 m_drawPanScrollIcon = true;
1270 m_panScrollIconPoint = IntPoint(iconPosition.x() - panIconSizeLength / 2 , iconPosition.y() - panIconSizeLength / 2) ;
1271 hostWindow()->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
1274 void ScrollView::removePanScrollIcon()
1278 m_drawPanScrollIcon = false;
1279 hostWindow()->invalidateContentsAndRootView(IntRect(m_panScrollIconPoint, IntSize(panIconSizeLength, panIconSizeLength)), true /*immediate*/);
1282 void ScrollView::setScrollOrigin(const IntPoint& origin, bool updatePositionAtAll, bool updatePositionSynchronously)
1284 if (scrollOrigin() == origin)
1287 ScrollableArea::setScrollOrigin(origin);
1289 if (platformWidget()) {
1290 platformSetScrollOrigin(origin, updatePositionAtAll, updatePositionSynchronously);
1294 // Update if the scroll origin changes, since our position will be different if the content size did not change.
1295 if (updatePositionAtAll && updatePositionSynchronously)
1296 updateScrollbars(scrollOffset());
1299 #if !PLATFORM(WX) && !PLATFORM(EFL)
1301 void ScrollView::platformInit()
1305 void ScrollView::platformDestroy()
1311 #if !PLATFORM(WX) && !PLATFORM(QT) && !PLATFORM(MAC)
1313 void ScrollView::platformAddChild(Widget*)
1317 void ScrollView::platformRemoveChild(Widget*)
1325 void ScrollView::platformSetScrollbarsSuppressed(bool)
1329 void ScrollView::platformSetScrollOrigin(const IntPoint&, bool updatePositionAtAll, bool updatePositionSynchronously)
1333 void ScrollView::platformSetScrollbarOverlayStyle(ScrollbarOverlayStyle)
1339 #if !PLATFORM(MAC) && !PLATFORM(WX)
1341 void ScrollView::platformSetScrollbarModes()
1345 void ScrollView::platformScrollbarModes(ScrollbarMode& horizontal, ScrollbarMode& vertical) const
1347 horizontal = ScrollbarAuto;
1348 vertical = ScrollbarAuto;
1351 void ScrollView::platformSetCanBlitOnScroll(bool)
1355 bool ScrollView::platformCanBlitOnScroll() const
1360 IntRect ScrollView::platformVisibleContentRect(bool) const
1365 void ScrollView::platformSetContentsSize()
1369 IntRect ScrollView::platformContentsToScreen(const IntRect& rect) const
1374 IntPoint ScrollView::platformScreenToContents(const IntPoint& point) const
1379 void ScrollView::platformSetScrollPosition(const IntPoint&)
1383 bool ScrollView::platformScroll(ScrollDirection, ScrollGranularity)
1388 void ScrollView::platformRepaintContentRectangle(const IntRect&, bool /*now*/)
1392 bool ScrollView::platformIsOffscreen() const