Diff
Modified: trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp (126513 => 126514)
--- trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp 2012-08-24 00:36:04 UTC (rev 126513)
+++ trunk/Source/WebKit/blackberry/Api/InRegionScroller.cpp 2012-08-24 00:39:42 UTC (rev 126514)
@@ -33,6 +33,7 @@
#include "RenderLayerBacking.h"
#include "RenderObject.h"
#include "RenderView.h"
+#include "SelectionHandler.h"
#include "WebPage_p.h"
using namespace WebCore;
@@ -146,16 +147,6 @@
return setLayerScrollPosition(layer, scrollPosition);
}
-bool InRegionScrollerPrivate::scrollBy(const Platform::IntSize& delta)
-{
- ASSERT(Platform::webkitThreadMessageClient()->isCurrentThread());
-
- if (!canScroll())
- return false;
-
- return scrollNodeRecursively(node(), delta);
-}
-
void InRegionScrollerPrivate::calculateInRegionScrollableAreasForPoint(const WebCore::IntPoint& point)
{
ASSERT(m_activeInRegionScrollableAreas.empty());
@@ -252,8 +243,23 @@
Frame* frame = view->frame();
ASSERT_UNUSED(frame, frame);
+ ASSERT(canScrollInnerFrame(frame));
+ view->setCanBlitOnScroll(false);
+
+ BackingStoreClient* backingStoreClient = m_webPage->backingStoreClientForFrame(view->frame());
+ if (backingStoreClient) {
+ backingStoreClient->setIsClientGeneratedScroll(true);
+ backingStoreClient->setIsScrollNotificationSuppressed(true);
+ }
+
view->setScrollPosition(scrollPosition);
+
+ if (backingStoreClient) {
+ backingStoreClient->setIsClientGeneratedScroll(false);
+ backingStoreClient->setIsScrollNotificationSuppressed(false);
+ }
+
return true;
}
@@ -261,106 +267,15 @@
layer->scrollToOffset(scrollPosition.x(), scrollPosition.y());
// FIXME_agomes: Please recheck if it is needed still!
layer->renderer()->repaint(true);
+
+ m_webPage->m_selectionHandler->selectionPositionChanged();
+ // FIXME: We have code in place to handle scrolling and clipping tap highlight
+ // on in-region scrolling. As soon as it is fast enough (i.e. we have it backed by
+ // a backing store), we can reliably make use of it in the real world.
+ // m_touchEventHandler->drawTapHighlight();
return true;
}
-bool InRegionScrollerPrivate::scrollNodeRecursively(WebCore::Node* node, const WebCore::IntSize& delta)
-{
- if (delta.isZero())
- return true;
-
- if (!node)
- return false;
-
- RenderObject* renderer = node->renderer();
- if (!renderer)
- return false;
-
- FrameView* view = renderer->view()->frameView();
- if (!view)
- return false;
-
- // Try scrolling the renderer.
- if (scrollRenderer(renderer, delta))
- return true;
-
- // We've hit the page, don't scroll it and return false.
- if (view == m_webPage->m_mainFrame->view())
- return false;
-
- // Try scrolling the FrameView.
- if (canScrollInnerFrame(view->frame())) {
- IntSize viewDelta = delta;
- IntPoint newViewOffset = view->scrollPosition();
- IntPoint maxViewOffset = view->maximumScrollPosition();
- adjustScrollDelta(maxViewOffset, newViewOffset, viewDelta);
-
- if (!viewDelta.isZero()) {
- view->setCanBlitOnScroll(false);
-
- BackingStoreClient* backingStoreClient = m_webPage->backingStoreClientForFrame(view->frame());
- if (backingStoreClient) {
- backingStoreClient->setIsClientGeneratedScroll(true);
- backingStoreClient->setIsScrollNotificationSuppressed(true);
- }
-
- setNode(view->frame()->document());
-
- view->scrollBy(viewDelta);
-
- if (backingStoreClient) {
- backingStoreClient->setIsClientGeneratedScroll(false);
- backingStoreClient->setIsScrollNotificationSuppressed(false);
- }
-
- return true;
- }
- }
-
- // Try scrolling the node of the enclosing frame.
- Frame* frame = node->document()->frame();
- if (frame) {
- Node* ownerNode = frame->ownerElement();
- if (scrollNodeRecursively(ownerNode, delta))
- return true;
- }
-
- return false;
-}
-
-bool InRegionScrollerPrivate::scrollRenderer(WebCore::RenderObject* renderer, const WebCore::IntSize& delta)
-{
- RenderLayer* layer = renderer->enclosingLayer();
- if (!layer)
- return false;
-
- // Try to scroll layer.
- bool restrictedByLineClamp = false;
- if (renderer->parent())
- restrictedByLineClamp = !renderer->parent()->style()->lineClamp().isNone();
-
- if (renderer->hasOverflowClip() && !restrictedByLineClamp) {
- IntSize layerDelta = delta;
- IntPoint maxOffset(layer->scrollWidth() - layer->renderBox()->clientWidth(), layer->scrollHeight() - layer->renderBox()->clientHeight());
- IntPoint currentOffset(layer->scrollXOffset(), layer->scrollYOffset());
- adjustScrollDelta(maxOffset, currentOffset, layerDelta);
- if (!layerDelta.isZero()) {
- setNode(enclosingLayerNode(layer));
- IntPoint newOffset = currentOffset + layerDelta;
- layer->scrollToOffset(IntSize(newOffset.x(), newOffset.y()));
- renderer->repaint(true);
- return true;
- }
- }
-
- while (layer = layer->parent()) {
- if (canScrollRenderBox(layer->renderBox()))
- return scrollRenderer(layer->renderBox(), delta);
- }
-
- return false;
-}
-
void InRegionScrollerPrivate::adjustScrollDelta(const WebCore::IntPoint& maxOffset, const WebCore::IntPoint& currentOffset, WebCore::IntSize& delta) const
{
if (currentOffset.x() + delta.width() > maxOffset.x())
Modified: trunk/Source/WebKit/blackberry/Api/InRegionScroller_p.h (126513 => 126514)
--- trunk/Source/WebKit/blackberry/Api/InRegionScroller_p.h 2012-08-24 00:36:04 UTC (rev 126513)
+++ trunk/Source/WebKit/blackberry/Api/InRegionScroller_p.h 2012-08-24 00:39:42 UTC (rev 126514)
@@ -49,8 +49,6 @@
bool canScroll() const;
bool hasNode() const;
- bool scrollBy(const Platform::IntSize& delta);
-
bool setScrollPositionCompositingThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition);
bool setScrollPositionWebKitThread(unsigned camouflagedLayer, const WebCore::IntPoint& scrollPosition, bool supportsAcceleratedScrolling);
@@ -64,9 +62,6 @@
void pushBackInRegionScrollable(InRegionScrollableArea*);
- // Obsolete codepath.
- bool scrollNodeRecursively(WebCore::Node*, const WebCore::IntSize& delta);
- bool scrollRenderer(WebCore::RenderObject*, const WebCore::IntSize& delta);
void adjustScrollDelta(const WebCore::IntPoint& maxOffset, const WebCore::IntPoint& currentOffset, WebCore::IntSize& delta) const;
RefPtr<WebCore::Node> m_inRegionScrollStartingNode;
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (126513 => 126514)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-08-24 00:36:04 UTC (rev 126513)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-08-24 00:39:42 UTC (rev 126514)
@@ -1467,40 +1467,17 @@
task->perform(this);
}
-bool WebPagePrivate::scrollBy(int deltaX, int deltaY, bool scrollMainFrame)
+void WebPagePrivate::scrollBy(int deltaX, int deltaY)
{
IntSize delta(deltaX, deltaY);
- if (!scrollMainFrame) {
- // We need to work around the fact that ::map{To,From}Transformed do not
- // work well with negative values, like a negative width or height of an IntSize.
- IntSize copiedDelta(IntSize(abs(delta.width()), abs(delta.height())));
- IntSize untransformedCopiedDelta = mapFromTransformed(copiedDelta);
- delta = IntSize(
- delta.width() < 0 ? -untransformedCopiedDelta.width() : untransformedCopiedDelta.width(),
- delta.height() < 0 ? -untransformedCopiedDelta.height(): untransformedCopiedDelta.height());
-
- if (m_inRegionScroller->d->scrollBy(delta)) {
- m_selectionHandler->selectionPositionChanged();
- // FIXME: We have code in place to handle scrolling and clipping tap highlight
- // on in-region scrolling. As soon as it is fast enough (i.e. we have it backed by
- // a backing store), we can reliably make use of it in the real world.
- // m_touchEventHandler->drawTapHighlight();
- return true;
- }
-
- return false;
- }
-
setScrollPosition(scrollPosition() + delta);
- return true;
}
-bool WebPage::scrollBy(const Platform::IntSize& delta, bool scrollMainFrame)
+void WebPage::scrollBy(const Platform::IntSize& delta)
{
d->m_backingStoreClient->setIsClientGeneratedScroll(true);
- bool b = d->scrollBy(delta.width(), delta.height(), scrollMainFrame);
+ d->scrollBy(delta.width(), delta.height());
d->m_backingStoreClient->setIsClientGeneratedScroll(false);
- return b;
}
void WebPagePrivate::notifyInRegionScrollStopped()
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.h (126513 => 126514)
--- trunk/Source/WebKit/blackberry/Api/WebPage.h 2012-08-24 00:36:04 UTC (rev 126513)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.h 2012-08-24 00:39:42 UTC (rev 126514)
@@ -175,7 +175,7 @@
Platform::IntPoint scrollPosition() const;
// Scroll position provided should be in transformed coordinates.
void setScrollPosition(const Platform::IntPoint&);
- bool scrollBy(const Platform::IntSize&, bool scrollMainFrame = true);
+ void scrollBy(const Platform::IntSize&);
void notifyInRegionScrollStopped();
void setScrollOriginPoint(const Platform::IntPoint&);
Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (126513 => 126514)
--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-08-24 00:36:04 UTC (rev 126513)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h 2012-08-24 00:39:42 UTC (rev 126514)
@@ -150,7 +150,7 @@
WebCore::IntPoint scrollPosition() const;
WebCore::IntPoint maximumScrollPosition() const;
void setScrollPosition(const WebCore::IntPoint&);
- bool scrollBy(int deltaX, int deltaY, bool scrollMainFrame = true);
+ void scrollBy(int deltaX, int deltaY);
void enqueueRenderingOfClippedContentOfScrollableNodeAfterInRegionScrolling(WebCore::Node*);
void notifyInRegionScrollStopped();
Modified: trunk/Source/WebKit/blackberry/ChangeLog (126513 => 126514)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-08-24 00:36:04 UTC (rev 126513)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-08-24 00:39:42 UTC (rev 126514)
@@ -1,3 +1,28 @@
+2012-08-23 Antonio Gomes <[email protected]>
+
+ [BlackBerry] Obsolete the in-region scroll codepath prior to BB10's
+ https://bugs.webkit.org/show_bug.cgi?id=94839
+ PR #197775
+
+ Reviewed by George Staikos.
+
+ This codepath is not needed anymore, so lets let it RIP.
+
+ The only code addition is due to some code I've moved from WebPagePrivate::scrollNodeRecursively
+ and WebPagePrivate::scrollBy to InRegionScrollerPrivate::setLayerScrollPosition.
+ Rest is code removal ...
+
+ * Api/InRegionScroller.cpp:
+ (BlackBerry::WebKit::InRegionScrollerPrivate::setLayerScrollPosition):
+ * Api/InRegionScroller_p.h:
+ (InRegionScrollerPrivate):
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::scrollBy):
+ (BlackBerry::WebKit::WebPage::scrollBy):
+ * Api/WebPage.h:
+ * Api/WebPage_p.h:
+ (WebPagePrivate):
+
2012-08-23 Adam Treat <[email protected]>
[BlackBerry] Replace the three different rendering mechanisms for clearing the render queue