Diff
Modified: trunk/Source/WebCore/ChangeLog (107000 => 107001)
--- trunk/Source/WebCore/ChangeLog 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/ChangeLog 2012-02-07 23:47:59 UTC (rev 107001)
@@ -1,3 +1,42 @@
+2012-02-07 Anders Carlsson <ander...@apple.com>
+
+ Scrolling tree should keep track of region we can't do fast scrolling for
+ https://bugs.webkit.org/show_bug.cgi?id=78050
+
+ Reviewed by Dan Bernstein.
+
+ We currently won't do fast scrolling for subframes and other types of scrollable areas.
+ Because of this, we'll have the scrolling tree keep a region of the page for which we can't
+ do fast scrolling. This region will be updated after layout.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::scrollableAreaBoundingBox):
+ Return the bounding box.
+
+ * page/scrolling/ScrollingCoordinator.cpp:
+ (WebCore::ScrollingCoordinator::frameViewLayoutUpdated):
+ Go through all the scrollable areas in this frame view and compute the region which we can't do
+ fast scrolling for.
+
+ * page/scrolling/ScrollingTree.cpp:
+ (WebCore::ScrollingTree::commitNewTreeState):
+ Update the non-fast-scrollable region.
+
+ * page/scrolling/ScrollingTreeState.cpp:
+ (WebCore::ScrollingTreeState::setNonFastScrollableRegion):
+ Set the non-fast-scrollable region if it's changed.
+
+ * platform/ScrollableArea.h:
+ Add scrollableAreaBoundingBox member function.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::scrollableAreaBoundingBox):
+ Return the bounding box.
+
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::scrollableAreaBoundingBox):
+ Return the bounding box.
+
2012-02-07 Levi Weintraub <le...@chromium.org>
unicode-bidi:plaintext is supposed to be effective on display:inline elements too
Modified: trunk/Source/WebCore/page/FrameView.cpp (107000 => 107001)
--- trunk/Source/WebCore/page/FrameView.cpp 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/page/FrameView.cpp 2012-02-07 23:47:59 UTC (rev 107001)
@@ -2549,6 +2549,12 @@
return 0;
}
+IntRect FrameView::scrollableAreaBoundingBox() const
+{
+ // FIXME: This isn't correct for transformed frames. We probably need to ask the renderer instead.
+ return frameRect();
+}
+
bool FrameView::shouldSuspendScrollAnimations() const
{
return m_frame->loader()->state() != FrameStateComplete;
Modified: trunk/Source/WebCore/page/FrameView.h (107000 => 107001)
--- trunk/Source/WebCore/page/FrameView.h 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/page/FrameView.h 2012-02-07 23:47:59 UTC (rev 107001)
@@ -371,6 +371,7 @@
virtual void setVisibleScrollerThumbRect(const IntRect&);
virtual bool isOnActivePage() const;
virtual ScrollableArea* enclosingScrollableArea() const;
+ virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
#if USE(ACCELERATED_COMPOSITING)
virtual GraphicsLayer* layerForHorizontalScrollbar() const OVERRIDE;
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (107000 => 107001)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp 2012-02-07 23:47:59 UTC (rev 107001)
@@ -34,6 +34,7 @@
#include "IntRect.h"
#include "Page.h"
#include "PlatformWheelEvent.h"
+#include "Region.h"
#include "ScrollAnimator.h"
#include "ScrollingThread.h"
#include "ScrollingTree.h"
@@ -98,6 +99,22 @@
if (!coordinatesScrollingForFrameView(frameView))
return;
+ // Compute the region of the page that we can't do fast scrolling for. This currently includes
+ // all scrollable areas, such as subframes, overflow divs and list boxes.
+ Region nonScrollableRegion;
+ if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) {
+ for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) {
+ ScrollableArea* scrollableArea = *it;
+
+ // Check if this area can be scrolled at all.
+ if ((!scrollableArea->horizontalScrollbar() || !scrollableArea->horizontalScrollbar()->enabled())
+ && (!scrollableArea->verticalScrollbar() || !scrollableArea->verticalScrollbar()->enabled()))
+ continue;
+
+ nonScrollableRegion.unite(scrollableArea->scrollableAreaBoundingBox());
+ }
+ }
+
m_scrollingTreeState->setViewportRect(IntRect(IntPoint(), frameView->visibleContentRect().size()));
m_scrollingTreeState->setContentsSize(frameView->contentsSize());
scheduleTreeStateCommit();
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp (107000 => 107001)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp 2012-02-07 23:47:59 UTC (rev 107001)
@@ -89,10 +89,13 @@
{
ASSERT(ScrollingThread::isCurrentThread());
- if (scrollingTreeState->changedProperties() & ScrollingTreeState::WheelEventHandlerCount) {
+ if (scrollingTreeState->changedProperties() & (ScrollingTreeState::WheelEventHandlerCount | ScrollingTreeState::NonFastScrollableRegion)) {
MutexLocker lock(m_mutex);
- m_hasWheelEventHandlers = scrollingTreeState->wheelEventHandlerCount();
+ if (scrollingTreeState->changedProperties() & ScrollingTreeState::WheelEventHandlerCount)
+ m_hasWheelEventHandlers = scrollingTreeState->wheelEventHandlerCount();
+ if (scrollingTreeState->changedProperties() & ScrollingTreeState::NonFastScrollableRegion)
+ m_nonFastScrollableRegion = scrollingTreeState->nonFastScrollableRegion();
}
m_rootNode->update(scrollingTreeState.get());
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTree.h (107000 => 107001)
--- trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTree.h 2012-02-07 23:47:59 UTC (rev 107001)
@@ -28,6 +28,7 @@
#if ENABLE(THREADED_SCROLLING)
+#include "Region.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -71,6 +72,7 @@
OwnPtr<ScrollingTreeNode> m_rootNode;
Mutex m_mutex;
+ Region m_nonFastScrollableRegion;
bool m_hasWheelEventHandlers;
};
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeState.cpp (107000 => 107001)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeState.cpp 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeState.cpp 2012-02-07 23:47:59 UTC (rev 107001)
@@ -63,6 +63,15 @@
m_changedProperties |= ContentsSize;
}
+void ScrollingTreeState::setNonFastScrollableRegion(const Region& nonFastScrollableRegion)
+{
+ if (m_nonFastScrollableRegion == nonFastScrollableRegion)
+ return;
+
+ m_nonFastScrollableRegion = nonFastScrollableRegion;
+ m_changedProperties |= NonFastScrollableRegion;
+}
+
void ScrollingTreeState::setWheelEventHandlerCount(unsigned wheelEventHandlerCount)
{
if (m_wheelEventHandlerCount == wheelEventHandlerCount)
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeState.h (107000 => 107001)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeState.h 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeState.h 2012-02-07 23:47:59 UTC (rev 107001)
@@ -30,6 +30,7 @@
#include "GraphicsLayer.h"
#include "IntRect.h"
+#include "Region.h"
#include <wtf/PassOwnPtr.h>
#if PLATFORM(MAC)
@@ -50,8 +51,9 @@
enum ChangedProperty {
ViewportRect = 1 << 0,
ContentsSize = 1 << 1,
- WheelEventHandlerCount = 1 << 2,
- ScrollLayer = 1 << 3,
+ NonFastScrollableRegion = 1 << 2,
+ WheelEventHandlerCount = 1 << 3,
+ ScrollLayer = 1 << 4,
};
bool hasChangedProperties() const { return m_changedProperties; }
@@ -63,6 +65,9 @@
const IntSize& contentsSize() const { return m_contentsSize; }
void setContentsSize(const IntSize&);
+ const Region& nonFastScrollableRegion() const { return m_nonFastScrollableRegion; }
+ void setNonFastScrollableRegion(const Region&);
+
unsigned wheelEventHandlerCount() const { return m_wheelEventHandlerCount; }
void setWheelEventHandlerCount(unsigned);
@@ -80,6 +85,8 @@
IntRect m_viewportRect;
IntSize m_contentsSize;
+ Region m_nonFastScrollableRegion;
+
unsigned m_wheelEventHandlerCount;
#if PLATFORM(MAC)
Modified: trunk/Source/WebCore/platform/ScrollableArea.h (107000 => 107001)
--- trunk/Source/WebCore/platform/ScrollableArea.h 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/platform/ScrollableArea.h 2012-02-07 23:47:59 UTC (rev 107001)
@@ -155,6 +155,9 @@
// Note that this only returns scrollable areas that can actually be scrolled.
virtual ScrollableArea* enclosingScrollableArea() const = 0;
+ // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view.
+ virtual IntRect scrollableAreaBoundingBox() const { ASSERT_NOT_REACHED(); }
+
bool isPinnedInBothDirections(const IntSize&) const;
bool isPinnedHorizontallyInDirection(int horizontalScrollDelta) const;
bool isPinnedVerticallyInDirection(int verticalScrollDelta) const;
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (107000 => 107001)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2012-02-07 23:47:59 UTC (rev 107001)
@@ -886,6 +886,11 @@
return 0;
}
+IntRect RenderLayer::scrollableAreaBoundingBox() const
+{
+ return renderer()->absoluteBoundingBoxRect();
+}
+
RenderLayer* RenderLayer::enclosingTransformedAncestor() const
{
RenderLayer* curr = parent();
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (107000 => 107001)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2012-02-07 23:47:59 UTC (rev 107001)
@@ -664,6 +664,7 @@
virtual IntPoint currentMousePosition() const;
virtual bool shouldSuspendScrollAnimations() const;
virtual bool isOnActivePage() const;
+ virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
// Rectangle encompassing the scroll corner and resizer rect.
IntRect scrollCornerAndResizerRect() const;
Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (107000 => 107001)
--- trunk/Source/WebCore/rendering/RenderListBox.cpp 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp 2012-02-07 23:47:59 UTC (rev 107001)
@@ -821,6 +821,11 @@
return 0;
}
+IntRect RenderListBox::scrollableAreaBoundingBox() const
+{
+ return absoluteBoundingBoxRect();
+}
+
PassRefPtr<Scrollbar> RenderListBox::createScrollbar()
{
RefPtr<Scrollbar> widget;
Modified: trunk/Source/WebCore/rendering/RenderListBox.h (107000 => 107001)
--- trunk/Source/WebCore/rendering/RenderListBox.h 2012-02-07 23:46:40 UTC (rev 107000)
+++ trunk/Source/WebCore/rendering/RenderListBox.h 2012-02-07 23:47:59 UTC (rev 107001)
@@ -120,6 +120,7 @@
virtual bool isOnActivePage() const;
virtual ScrollableArea* enclosingScrollableArea() const;
+ virtual IntRect scrollableAreaBoundingBox() const OVERRIDE;
// NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
void scrollTo(int newOffset);