Title: [138991] trunk
Revision
138991
Author
wangxian...@chromium.org
Date
2013-01-07 14:12:47 -0800 (Mon, 07 Jan 2013)

Log Message

Add window.internals.nonFastScrollableRects for testing scrollable areas in fast/slow paths
https://bugs.webkit.org/show_bug.cgi?id=105546

Reviewed by James Robinson.

.:

Export the new symbol.

* Source/autotools/symbols.filter:

Source/WebCore:

No new tests. Added test API for new tests of other bugs.

* WebCore.exp.in:
* page/Page.cpp:
(WebCore::Page::nonFastScrollableRects):
(WebCore):
* page/Page.h:
(WebCore):
(Page):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Change to public to allow Page::nonFastScrollableRects to access.
* page/scrolling/ScrollingCoordinator.h:
(ScrollingCoordinator):
* testing/Internals.cpp:
(WebCore::Internals::nonFastScrollableRects):
(WebCore):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit2:

Export the new symbol.

* win/WebKit2.def.in:

Modified Paths

Diff

Modified: trunk/ChangeLog (138990 => 138991)


--- trunk/ChangeLog	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/ChangeLog	2013-01-07 22:12:47 UTC (rev 138991)
@@ -1,3 +1,14 @@
+2013-01-07  Xianzhu Wang  <wangxian...@chromium.org>
+
+        Add window.internals.nonFastScrollableRects for testing scrollable areas in fast/slow paths
+        https://bugs.webkit.org/show_bug.cgi?id=105546
+
+        Reviewed by James Robinson.
+
+        Export the new symbol.
+
+        * Source/autotools/symbols.filter:
+
 2013-01-04  Adam Klein  <ad...@chromium.org>
 
         Remove ENABLE_MUTATION_OBSERVERS #define

Modified: trunk/Source/WebCore/ChangeLog (138990 => 138991)


--- trunk/Source/WebCore/ChangeLog	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/ChangeLog	2013-01-07 22:12:47 UTC (rev 138991)
@@ -1,3 +1,29 @@
+2013-01-07  Xianzhu Wang  <wangxian...@chromium.org>
+
+        Add window.internals.nonFastScrollableRects for testing scrollable areas in fast/slow paths
+        https://bugs.webkit.org/show_bug.cgi?id=105546
+
+        Reviewed by James Robinson.
+
+        No new tests. Added test API for new tests of other bugs.
+
+        * WebCore.exp.in:
+        * page/Page.cpp:
+        (WebCore::Page::nonFastScrollableRects):
+        (WebCore):
+        * page/Page.h:
+        (WebCore):
+        (Page):
+        * page/scrolling/ScrollingCoordinator.cpp:
+        (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Change to public to allow Page::nonFastScrollableRects to access.
+        * page/scrolling/ScrollingCoordinator.h:
+        (ScrollingCoordinator):
+        * testing/Internals.cpp:
+        (WebCore::Internals::nonFastScrollableRects):
+        (WebCore):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
 2013-01-07  Tom Sepez  <tse...@chromium.org>
 
         Document::initSecurityContext() gives parent security context to iframes with invalid URLs.

Modified: trunk/Source/WebCore/WebCore.exp.in (138990 => 138991)


--- trunk/Source/WebCore/WebCore.exp.in	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/WebCore.exp.in	2013-01-07 22:12:47 UTC (rev 138991)
@@ -761,6 +761,7 @@
 __ZN7WebCore4Page20unmarkAllTextMatchesEv
 __ZN7WebCore4Page21markAllMatchesForTextERKN3WTF6StringEjbj
 __ZN7WebCore4Page22allVisitedStateChangedEPNS_9PageGroupE
+__ZN7WebCore4Page22nonFastScrollableRectsEPKNS_5FrameE
 __ZN7WebCore4Page23clearUndoRedoOperationsEv
 __ZN7WebCore4Page24resumeScriptedAnimationsEv
 __ZN7WebCore4Page24scrollingStateTreeAsTextEv

Modified: trunk/Source/WebCore/page/Page.cpp (138990 => 138991)


--- trunk/Source/WebCore/page/Page.cpp	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/page/Page.cpp	2013-01-07 22:12:47 UTC (rev 138991)
@@ -25,6 +25,7 @@
 #include "BackForwardList.h"
 #include "Chrome.h"
 #include "ChromeClient.h"
+#include "ClientRectList.h"
 #include "ContextMenuClient.h"
 #include "ContextMenuController.h"
 #include "DOMWindow.h"
@@ -269,6 +270,21 @@
     return String();
 }
 
+PassRefPtr<ClientRectList> Page::nonFastScrollableRects(const Frame* frame)
+{
+    if (Document* document = m_mainFrame->document())
+        document->updateLayout();
+
+    Vector<IntRect> rects;
+    if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
+        rects = scrollingCoordinator->computeNonFastScrollableRegion(frame, IntPoint()).rects();
+
+    Vector<FloatQuad> quads(rects.size());
+    for (size_t i = 0; i < rects.size(); ++i)
+        quads[i] = FloatRect(rects[i]);
+    return ClientRectList::create(quads);
+}
+
 struct ViewModeInfo {
     const char* name;
     Page::ViewMode type;

Modified: trunk/Source/WebCore/page/Page.h (138990 => 138991)


--- trunk/Source/WebCore/page/Page.h	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/page/Page.h	2013-01-07 22:12:47 UTC (rev 138991)
@@ -57,6 +57,7 @@
     class BackForwardList;
     class Chrome;
     class ChromeClient;
+    class ClientRectList;
 #if ENABLE(CONTEXT_MENUS)
     class ContextMenuClient;
     class ContextMenuController;
@@ -200,6 +201,7 @@
 
         String scrollingStateTreeAsText();
         String mainThreadScrollingReasonsAsText();
+        PassRefPtr<ClientRectList> nonFastScrollableRects(const Frame*);
 
         Settings* settings() const { return m_settings.get(); }
         ProgressTracker* progress() const { return m_progress.get(); }

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp (138990 => 138991)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp	2013-01-07 22:12:47 UTC (rev 138991)
@@ -136,7 +136,7 @@
 #endif
 }
 
-Region ScrollingCoordinator::computeNonFastScrollableRegion(Frame* frame, const IntPoint& frameLocation)
+Region ScrollingCoordinator::computeNonFastScrollableRegion(const Frame* frame, const IntPoint& frameLocation) const
 {
     Region nonFastScrollableRegion;
     FrameView* frameView = frame->view();

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (138990 => 138991)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2013-01-07 22:12:47 UTC (rev 138991)
@@ -160,10 +160,11 @@
     static String mainThreadScrollingReasonsAsText(MainThreadScrollingReasons);
     String mainThreadScrollingReasonsAsText() const;
 
+    Region computeNonFastScrollableRegion(const Frame*, const IntPoint& frameLocation) const;
+
 protected:
     explicit ScrollingCoordinator(Page*);
 
-    Region computeNonFastScrollableRegion(Frame*, const IntPoint& frameLocation);
     unsigned computeCurrentWheelEventHandlerCount();
     GraphicsLayer* scrollLayerForFrameView(FrameView*);
 

Modified: trunk/Source/WebCore/testing/Internals.cpp (138990 => 138991)


--- trunk/Source/WebCore/testing/Internals.cpp	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/testing/Internals.cpp	2013-01-07 22:12:47 UTC (rev 138991)
@@ -1558,6 +1558,20 @@
     return page->mainThreadScrollingReasonsAsText();
 }
 
+PassRefPtr<ClientRectList> Internals::nonFastScrollableRects(Document* document, ExceptionCode& ec) const
+{
+    if (!document || !document->frame()) {
+        ec = INVALID_ACCESS_ERR;
+        return 0;
+    }
+
+    Page* page = document->page();
+    if (!page)
+        return 0;
+
+    return page->nonFastScrollableRects(document->frame());
+}
+
 void Internals::garbageCollectDocumentResources(Document* document, ExceptionCode& ec) const
 {
     if (!document) {

Modified: trunk/Source/WebCore/testing/Internals.h (138990 => 138991)


--- trunk/Source/WebCore/testing/Internals.h	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/testing/Internals.h	2013-01-07 22:12:47 UTC (rev 138991)
@@ -215,8 +215,8 @@
     String layerTreeAsText(Document*, ExceptionCode&) const;
     String repaintRectsAsText(Document*, ExceptionCode&) const;
     String scrollingStateTreeAsText(Document*, ExceptionCode&) const;
-
     String mainThreadScrollingReasons(Document*, ExceptionCode&) const;
+    PassRefPtr<ClientRectList> nonFastScrollableRects(Document*, ExceptionCode&) const;
 
     void garbageCollectDocumentResources(Document*, ExceptionCode&) const;
 

Modified: trunk/Source/WebCore/testing/Internals.idl (138990 => 138991)


--- trunk/Source/WebCore/testing/Internals.idl	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebCore/testing/Internals.idl	2013-01-07 22:12:47 UTC (rev 138991)
@@ -174,6 +174,7 @@
 
     DOMString scrollingStateTreeAsText(in Document document) raises (DOMException);
     DOMString mainThreadScrollingReasons(in Document document) raises (DOMException);
+    ClientRectList nonFastScrollableRects(in Document document) raises (DOMException);
 
     DOMString repaintRectsAsText(in Document document) raises (DOMException);
 

Modified: trunk/Source/WebKit/win/WebKit.vcproj/WebKit.def.in (138990 => 138991)


--- trunk/Source/WebKit/win/WebKit.vcproj/WebKit.def.in	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebKit/win/WebKit.vcproj/WebKit.def.in	2013-01-07 22:12:47 UTC (rev 138991)
@@ -1566,3 +1566,4 @@
         ?pseudoElement@Element@WebCore@@QBEPAVPseudoElement@2@W4PseudoId@2@@Z
         ?pauseTransitionAtTime@AnimationController@WebCore@@QAE_NPAVRenderObject@2@ABVString@WTF@@N@Z
         ?addFromLiteralData@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBDI@Z
+        ?nonFastScrollableRects@Page@WebCore@@QAE?AV?$PassRefPtr@VClientRectList@WebCore@@@WTF@@PBVFrame@2@@Z

Modified: trunk/Source/WebKit2/ChangeLog (138990 => 138991)


--- trunk/Source/WebKit2/ChangeLog	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/WebKit2/ChangeLog	2013-01-07 22:12:47 UTC (rev 138991)
@@ -1,3 +1,14 @@
+2013-01-07  Xianzhu Wang  <wangxian...@chromium.org>
+
+        Add window.internals.nonFastScrollableRects for testing scrollable areas in fast/slow paths
+        https://bugs.webkit.org/show_bug.cgi?id=105546
+
+        Reviewed by James Robinson.
+
+        Export the new symbol.
+
+        * win/WebKit2.def.in:
+
 2013-01-07  Mike West  <mk...@chromium.org>
 
         Make the IFRAME_SEAMLESS flag runtime-enabled.

Modified: trunk/Source/autotools/symbols.filter (138990 => 138991)


--- trunk/Source/autotools/symbols.filter	2013-01-07 22:10:40 UTC (rev 138990)
+++ trunk/Source/autotools/symbols.filter	2013-01-07 22:12:47 UTC (rev 138991)
@@ -30,6 +30,7 @@
 _ZN7WebCore4Page13setPaginationERKNS_10PaginationE;
 _ZN7WebCore4Page18setPageScaleFactorEfRKNS_8IntPointE;
 _ZN7WebCore4Page20setDeviceScaleFactorEf;
+_ZN7WebCore4Page22nonFastScrollableRectsEPKNS_5FrameE;
 _ZN7WebCore4Page24scrollingStateTreeAsTextEv;
 _ZN7WebCore4Page32mainThreadScrollingReasonsAsTextEv;
 _ZN7WebCore4Page16setCanStartMediaEb;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to