[BlackBerry] Tie up the scrolling machinery to the graphics tree when applicable...
[WebKit-https.git] / Source / WebKit / blackberry / WebKitSupport / InRegionScrollableArea.cpp
index 76a980e..d42059e 100644 (file)
 #include "InRegionScrollableArea.h"
 
 #include "Frame.h"
+#include "LayerCompositingThread.h"
+#include "LayerWebKitThread.h"
 #include "RenderBox.h"
 #include "RenderLayer.h"
+#include "RenderLayerBacking.h"
 #include "RenderObject.h"
 #include "RenderView.h"
 #include "WebPage_p.h"
@@ -68,6 +71,8 @@ InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLa
         m_scrollsVertically = view->contentsHeight() > view->visibleHeight();
 
         m_overscrollLimitFactor = 0.0; // FIXME eventually support overscroll
+        m_cachedCompositedScrollableLayer = 0; // FIXME: Needs composited layer for inner frames.
+
     } else { // RenderBox-based elements case (scrollable boxes (div's, p's, textarea's, etc)).
 
         RenderBox* box = m_layer->renderBox();
@@ -82,7 +87,13 @@ InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLa
         m_scrollsHorizontally = box->scrollWidth() != box->clientWidth() && box->scrollsOverflowX();
         m_scrollsVertically = box->scrollHeight() != box->clientHeight() && box->scrollsOverflowY();
 
-        m_overscrollLimitFactor = 0.0; // FIXME eventually support overscroll
+        if (m_layer->usesCompositedScrolling()) {
+            m_supportsCompositedScrolling = true;
+            ASSERT(m_layer->backing()->hasScrollingLayer());
+            m_cachedCompositedScrollableLayer = reinterpret_cast<unsigned>(m_layer->backing()->scrollingLayer()->platformLayer()->layerCompositingThread());
+        }
+
+        m_overscrollLimitFactor = 0.0;
     }
 }