2011-06-30  Anders Carlsson  <andersca@apple.com>

        Reviewed by Dan Bernstein.

        More ScrollableArea scaffolding
        https://bugs.webkit.org/show_bug.cgi?id=63678

        Add an enclosingScrollableArea stub.

        * src/WebScrollbarImpl.cpp:
        (WebKit::WebScrollbarImpl::enclosingScrollableArea):
        * src/WebScrollbarImpl.h:
2011-06-30  Anders Carlsson  <andersca@apple.com>

        Reviewed by Dan Bernstein.

        More ScrollableArea scaffolding
        https://bugs.webkit.org/show_bug.cgi?id=63678

        * WebScrollBar.h:
        (WebScrollBar::enclosingScrollableArea):
        Always return 0, WebScrollbar has no concept of an enclosing scrollable area.
2011-06-30  Anders Carlsson  <andersca@apple.com>

        Reviewed by Dan Bernstein.

        More ScrollableArea scaffolding
        https://bugs.webkit.org/show_bug.cgi?id=63678

        Add a way to get the enclosing scrollable area for a given scrollable area.
        Also, add ScrollableArea::isPinnedInDirectionOfScrollDelta.

        * page/FrameView.cpp:
        (WebCore::FrameView::enclosingScrollableArea):
        Return 0 for now.

        * page/FrameView.h:
        Add FrameView::enclosingScrollableArea.

        * platform/ScrollableArea.cpp:
        (WebCore::ScrollableArea::isPinnedInDirectionOfScrollDelta):
        Return whether the area is pinned in the direction of the scroll delta.

        * platform/ScrollableArea.h:
        Add new member functions.

        * platform/chromium/FramelessScrollView.cpp:
        (WebCore::FramelessScrollView::enclosingScrollableArea):
        * platform/chromium/FramelessScrollView.h:
        Add stub.

        * platform/win/PopupMenuWin.h:
        (WebCore::PopupMenuWin::enclosingScrollableArea):
        Always return 0.

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::enclosingScrollableLayer):
        Add helper function.

        (WebCore::RenderLayer::scrollByRecursively):
        Use the new enclosingScrollableLayer helper function.

        (WebCore::RenderLayer::enclosingScrollableArea):
        Return the enclosing scrollable area.

        * rendering/RenderLayer.h:
        Add new member function.

        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::enclosingScrollableArea):
        Return 0 for now.
        
        * rendering/RenderListBox.h:
        Add new member function.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@90152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/platform/ScrollableArea.h b/Source/WebCore/platform/ScrollableArea.h
index b7456c0..8534cae 100644
--- a/Source/WebCore/platform/ScrollableArea.h
+++ b/Source/WebCore/platform/ScrollableArea.h
@@ -144,6 +144,11 @@
     bool isVerticalScrollerPinnedToMinimumPosition() const { return !verticalScrollbar() || scrollPosition(verticalScrollbar()) <= minimumScrollPosition().y(); }
     bool isVerticalScrollerPinnedToMaximumPosition() const { return !verticalScrollbar() || scrollPosition(verticalScrollbar()) >= maximumScrollPosition().y(); }
 
+    // Note that this only returns scrollable areas that can actually be scrolled.
+    virtual ScrollableArea* enclosingScrollableArea() const = 0;
+
+    bool isPinnedInDirection(const IntSize&) const;
+
     virtual bool shouldRubberBandInDirection(ScrollDirection) const { return true; }
 
     virtual void disconnectFromPage() { }