Title: [133033] trunk
Revision
133033
Author
[email protected]
Date
2012-10-31 08:36:50 -0700 (Wed, 31 Oct 2012)

Log Message

Add support for text-based repaint testing
https://bugs.webkit.org/show_bug.cgi?id=100584

Reviewed by Simon Fraser.

Allows tracked repaint rects to be dumped as text.

.:

* Source/autotools/symbols.filter:
  Exports for:
    FrameView::setTracksRepaints(bool)
    Frame::trackedRepaintRectsAsText() const

Source/WebCore:

The following layout tests have been converted:
  fast/repaint/layer-full-repaint.html
  fast/repaint/overflow-flipped-writing-mode-table.html

* WebCore.exp.in:
  Exports for:
    FrameView::setTracksRepaints(bool)
    Frame::trackedRepaintRectsAsText() const
* page/Frame.cpp:
(WebCore::Frame::trackedRepaintRectsAsText):
  Returns a string containing information on all tracked repaint rects.
* page/FrameView.cpp:
(WebCore::FrameView::setTracksRepaints):
  Rather than calling m_trackedRepaintRects.clear() directly, I've
  called resetTrackedRepaints(). This will allow us to do more
  sophisticated resetting when we start tracking repaint rects for
  composited layers.
(WebCore::FrameView::trackedRepaintRectsAsText):
  Provides the string returned by Frame::trackedRepaintRectsAsText.
* testing/Internals.cpp:
(WebCore::Internals::repaintRectsAsText):
  Returns Frame::trackedRepaintRectsAsText.
(WebCore):
(WebCore::Internals::startTrackingRepaints):
  Calls FrameView::setTracksRepaints(true)
(WebCore::Internals::stopTrackingRepaints):
  Calls FrameView::setTracksRepaints(false)
* testing/Internals.h:
* testing/Internals.idl:
  Declarations for:
    repaintRectsAsText
    startTrackingRepaints
    stopTrackingRepaints

Source/WebKit2:

* mac/WebKit2.order:
* win/WebKit2.def:
* win/WebKit2CFLite.def:
  Exports for:
    FrameView::setTracksRepaints(bool)
    Frame::trackedRepaintRectsAsText() const

LayoutTests:

* fast/repaint/layer-full-repaint-expected.txt: Added.
* fast/repaint/layer-full-repaint.html:
* fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
* fast/repaint/overflow-flipped-writing-mode-table-expected.txt:
* fast/repaint/overflow-flipped-writing-mode-table.html:
* fast/repaint/resources/repaint.js:
* fast/repaint/resources/text-based-repaint.js: Added.
(runRepaintTest):
  The function calls internals.startTrackingRepaints() rather than display()
  before calling repaintTest(). It also generates a <pre> element and sets
  its innerHTML to internals.repaintRectsAsText().
* platform/chromium-mac/fast/repaint/layer-full-repaint-expected.png: Removed.
* platform/chromium-mac/fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
* platform/chromium-win/fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
* platform/chromium/fast/repaint/layer-full-repaint-expected.png: Removed.
* platform/chromium/fast/repaint/layer-full-repaint-expected.txt: Removed.
* platform/efl/fast/repaint/layer-full-repaint-expected.png: Removed.
* platform/efl/fast/repaint/layer-full-repaint-expected.txt: Removed.
* platform/gtk/fast/repaint/layer-full-repaint-expected.png: Removed.
* platform/gtk/fast/repaint/layer-full-repaint-expected.txt: Removed.
* platform/gtk/fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
* platform/mac/fast/repaint/layer-full-repaint-expected.png: Removed.
* platform/mac/fast/repaint/layer-full-repaint-expected.txt: Removed.
* platform/qt/fast/repaint/layer-full-repaint-expected.png: Removed.
* platform/qt/fast/repaint/layer-full-repaint-expected.txt: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/ChangeLog (133032 => 133033)


--- trunk/ChangeLog	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/ChangeLog	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,3 +1,18 @@
+2012-10-31  Ian Vollick  <[email protected]>
+
+        Add support for text-based repaint testing
+        https://bugs.webkit.org/show_bug.cgi?id=100584
+
+        Reviewed by Simon Fraser.
+
+        Allows tracked repaint rects to be dumped as text.
+
+        * Source/autotools/symbols.filter:
+          Exports for:
+            FrameView::setTracksRepaints(bool)
+            Frame::trackedRepaintRectsAsText() const
+
+
 2012-10-30  Vivek Galatage  <[email protected]>
 
         Add files generated by Windows to ignore list for git repository

Modified: trunk/LayoutTests/ChangeLog (133032 => 133033)


--- trunk/LayoutTests/ChangeLog	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/ChangeLog	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,3 +1,38 @@
+2012-10-31  Ian Vollick  <[email protected]>
+
+        Add support for text-based repaint testing
+        https://bugs.webkit.org/show_bug.cgi?id=100584
+
+        Reviewed by Simon Fraser.
+
+        Allows tracked repaint rects to be dumped as text.
+
+        * fast/repaint/layer-full-repaint-expected.txt: Added.
+        * fast/repaint/layer-full-repaint.html:
+        * fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
+        * fast/repaint/overflow-flipped-writing-mode-table-expected.txt:
+        * fast/repaint/overflow-flipped-writing-mode-table.html:
+        * fast/repaint/resources/repaint.js:
+        * fast/repaint/resources/text-based-repaint.js: Added.
+        (runRepaintTest):
+          The function calls internals.startTrackingRepaints() rather than display()
+          before calling repaintTest(). It also generates a <pre> element and sets
+          its innerHTML to internals.repaintRectsAsText().
+        * platform/chromium-mac/fast/repaint/layer-full-repaint-expected.png: Removed.
+        * platform/chromium-mac/fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
+        * platform/chromium-win/fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
+        * platform/chromium/fast/repaint/layer-full-repaint-expected.png: Removed.
+        * platform/chromium/fast/repaint/layer-full-repaint-expected.txt: Removed.
+        * platform/efl/fast/repaint/layer-full-repaint-expected.png: Removed.
+        * platform/efl/fast/repaint/layer-full-repaint-expected.txt: Removed.
+        * platform/gtk/fast/repaint/layer-full-repaint-expected.png: Removed.
+        * platform/gtk/fast/repaint/layer-full-repaint-expected.txt: Removed.
+        * platform/gtk/fast/repaint/overflow-flipped-writing-mode-table-expected.png: Removed.
+        * platform/mac/fast/repaint/layer-full-repaint-expected.png: Removed.
+        * platform/mac/fast/repaint/layer-full-repaint-expected.txt: Removed.
+        * platform/qt/fast/repaint/layer-full-repaint-expected.png: Removed.
+        * platform/qt/fast/repaint/layer-full-repaint-expected.txt: Removed.
+
 2012-10-31  Stephen White  <[email protected]>
 
         New Chromium baselines for css3/filters/composited-reflected.html.

Added: trunk/LayoutTests/fast/repaint/layer-full-repaint-expected.txt (0 => 133033)


--- trunk/LayoutTests/fast/repaint/layer-full-repaint-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:36:50 UTC (rev 133033)
@@ -0,0 +1,4 @@
+(repaint rects
+  (rect 8 8 100 100)
+)
+

Modified: trunk/LayoutTests/fast/repaint/layer-full-repaint.html (133032 => 133033)


--- trunk/LayoutTests/fast/repaint/layer-full-repaint.html	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/fast/repaint/layer-full-repaint.html	2012-10-31 15:36:50 UTC (rev 133033)
@@ -15,7 +15,7 @@
             text-shadow: red 5px 5px 0;
         }
     </style>
-    <script src="" type="text/_javascript_"></script>
+    <script src="" type="text/_javascript_"></script>
     <script>
         function repaintTest()
         {

Deleted: trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.txt (133032 => 133033)


--- trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.txt	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table-expected.txt	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,13 +1,6 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
-      RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
-        RenderTable {DIV} at (0,0) size 100x25
-          RenderTableSection (anonymous) at (0,0) size 100x25
-            RenderTableRow (anonymous) at (0,0) size 100x25
-              RenderTableCell (anonymous) at (0,0) size 100x25 [r=0 c=0 rs=1 cs=1]
-                RenderBlock {DIV} at (0,0) size 100x25
-                  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
-      RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#FF0000]
+(repaint rects
+  (rect 8 8 100 50)
+  (rect 8 8 100 50)
+  (rect 8 8 100 50)
+)
+

Modified: trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table.html (133032 => 133033)


--- trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table.html	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/fast/repaint/overflow-flipped-writing-mode-table.html	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,4 +1,4 @@
-<script src=""
+<script src=""
 <script>
     _onload_ = runRepaintTest;
 

Modified: trunk/LayoutTests/fast/repaint/resources/repaint.js (133032 => 133033)


--- trunk/LayoutTests/fast/repaint/resources/repaint.js	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/fast/repaint/resources/repaint.js	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,3 +1,4 @@
+// Note: pixel based repaint tests are now deprecated. Please use text-based-repaint.js in new repaint tests.
 function runRepaintTest()
 {
     if (window.testRunner) {

Added: trunk/LayoutTests/fast/repaint/resources/text-based-repaint.js (0 => 133033)


--- trunk/LayoutTests/fast/repaint/resources/text-based-repaint.js	                        (rev 0)
+++ trunk/LayoutTests/fast/repaint/resources/text-based-repaint.js	2012-10-31 15:36:50 UTC (rev 133033)
@@ -0,0 +1,28 @@
+function runRepaintTest()
+{
+    if (window.testRunner && window.internals) {
+        window.testRunner.dumpAsText(false);
+
+        if (document.body)
+            document.body.offsetTop;
+        else if (document.documentElement)
+            document.documentElement.offsetTop;
+
+        window.internals.startTrackingRepaints(document);
+
+        repaintTest();
+
+        // force a style recalc.
+        var dummy = document.body.offsetTop;
+
+        var repaintRects = window.internals.repaintRectsAsText(document);
+
+        window.internals.stopTrackingRepaints(document);
+
+        var pre = document.createElement('pre');
+        document.body.appendChild(pre);
+        pre.innerHTML = repaintRects;
+    } else {
+        setTimeout(repaintTest, 100);
+    }
+}

Deleted: trunk/LayoutTests/platform/chromium/fast/repaint/layer-full-repaint-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium/fast/repaint/layer-full-repaint-expected.txt (133032 => 133033)


--- trunk/LayoutTests/platform/chromium/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/platform/chromium/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,7 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x116
-  RenderBlock {HTML} at (0,0) size 800x116
-    RenderBody {BODY} at (8,8) size 784x100
-layer at (8,8) size 100x100
-  RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Deleted: trunk/LayoutTests/platform/chromium-mac/fast/repaint/layer-full-repaint-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-mac/fast/repaint/overflow-flipped-writing-mode-table-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/chromium-win/fast/repaint/overflow-flipped-writing-mode-table-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/efl/fast/repaint/layer-full-repaint-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/efl/fast/repaint/layer-full-repaint-expected.txt (133032 => 133033)


--- trunk/LayoutTests/platform/efl/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/platform/efl/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,7 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x116
-  RenderBlock {HTML} at (0,0) size 800x116
-    RenderBody {BODY} at (8,8) size 784x100
-layer at (8,8) size 100x100
-  RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Deleted: trunk/LayoutTests/platform/gtk/fast/repaint/layer-full-repaint-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/gtk/fast/repaint/layer-full-repaint-expected.txt (133032 => 133033)


--- trunk/LayoutTests/platform/gtk/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/platform/gtk/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,7 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x116
-  RenderBlock {HTML} at (0,0) size 800x116
-    RenderBody {BODY} at (8,8) size 784x100
-layer at (8,8) size 100x100
-  RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Deleted: trunk/LayoutTests/platform/gtk/fast/repaint/overflow-flipped-writing-mode-table-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/mac/fast/repaint/layer-full-repaint-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/mac/fast/repaint/layer-full-repaint-expected.txt (133032 => 133033)


--- trunk/LayoutTests/platform/mac/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/platform/mac/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,7 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x116
-  RenderBlock {HTML} at (0,0) size 800x116
-    RenderBody {BODY} at (8,8) size 784x100
-layer at (8,8) size 100x100
-  RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Deleted: trunk/LayoutTests/platform/qt/fast/repaint/layer-full-repaint-expected.png


(Binary files differ)

Deleted: trunk/LayoutTests/platform/qt/fast/repaint/layer-full-repaint-expected.txt (133032 => 133033)


--- trunk/LayoutTests/platform/qt/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/LayoutTests/platform/qt/fast/repaint/layer-full-repaint-expected.txt	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,7 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x116
-  RenderBlock {HTML} at (0,0) size 800x116
-    RenderBody {BODY} at (8,8) size 784x100
-layer at (8,8) size 100x100
-  RenderBlock (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000]

Modified: trunk/Source/WebCore/ChangeLog (133032 => 133033)


--- trunk/Source/WebCore/ChangeLog	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/ChangeLog	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,3 +1,46 @@
+2012-10-31  Ian Vollick  <[email protected]>
+
+        Add support for text-based repaint testing
+        https://bugs.webkit.org/show_bug.cgi?id=100584
+
+        Reviewed by Simon Fraser.
+
+        Allows tracked repaint rects to be dumped as text.
+
+        The following layout tests have been converted:
+          fast/repaint/layer-full-repaint.html
+          fast/repaint/overflow-flipped-writing-mode-table.html
+
+        * WebCore.exp.in:
+          Exports for:
+            FrameView::setTracksRepaints(bool)
+            Frame::trackedRepaintRectsAsText() const
+        * page/Frame.cpp:
+        (WebCore::Frame::trackedRepaintRectsAsText):
+          Returns a string containing information on all tracked repaint rects.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setTracksRepaints):
+          Rather than calling m_trackedRepaintRects.clear() directly, I've
+          called resetTrackedRepaints(). This will allow us to do more
+          sophisticated resetting when we start tracking repaint rects for
+          composited layers.
+        (WebCore::FrameView::trackedRepaintRectsAsText):
+          Provides the string returned by Frame::trackedRepaintRectsAsText.
+        * testing/Internals.cpp:
+        (WebCore::Internals::repaintRectsAsText):
+          Returns Frame::trackedRepaintRectsAsText.
+        (WebCore):
+        (WebCore::Internals::startTrackingRepaints):
+          Calls FrameView::setTracksRepaints(true)
+        (WebCore::Internals::stopTrackingRepaints):
+          Calls FrameView::setTracksRepaints(false)
+        * testing/Internals.h:
+        * testing/Internals.idl:
+          Declarations for:
+            repaintRectsAsText
+            startTrackingRepaints
+            stopTrackingRepaints
+
 2012-10-31  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: page crash when pausing in dedicated worker

Modified: trunk/Source/WebCore/WebCore.exp.in (133032 => 133033)


--- trunk/Source/WebCore/WebCore.exp.in	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-10-31 15:36:50 UTC (rev 133033)
@@ -270,6 +270,8 @@
 __ZN7WebCore14FrameSelectionC1EPNS_5FrameE
 __ZN7WebCore14LoaderStrategy21resourceLoadSchedulerEv
 __ZN7WebCore14PluginDocument10pluginNodeEv
+__ZNK7WebCore5Frame25trackedRepaintRectsAsTextEv
+__ZN7WebCore9FrameView17setTracksRepaintsEb
 __ZN7WebCore14PluginDocument12pluginWidgetEv
 __ZN7WebCore14ResourceBuffer12createNSDataEv
 __ZN7WebCore14ResourceBufferD1Ev
@@ -1018,7 +1020,6 @@
 __ZN7WebCore9FrameView17addScrollableAreaEPNS_14ScrollableAreaE
 __ZN7WebCore9FrameView17paintControlTintsEv
 __ZN7WebCore9FrameView17setScrollPositionERKNS_8IntPointE
-__ZN7WebCore9FrameView17setTracksRepaintsEb
 __ZN7WebCore9FrameView18updateControlTintsEv
 __ZN7WebCore9FrameView19scrollElementToRectEPNS_7ElementERKNS_7IntRectE
 __ZN7WebCore9FrameView20enterCompositingModeEv

Modified: trunk/Source/WebCore/page/Frame.cpp (133032 => 133033)


--- trunk/Source/WebCore/page/Frame.cpp	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/page/Frame.cpp	2012-10-31 15:36:50 UTC (rev 133033)
@@ -893,6 +893,13 @@
 #endif
 }
 
+String Frame::trackedRepaintRectsAsText() const
+{
+    if (!m_view)
+        return String();
+    return m_view->trackedRepaintRectsAsText();
+}
+
 void Frame::setPageZoomFactor(float factor)
 {
     setPageAndTextZoomFactors(factor, m_textZoomFactor);

Modified: trunk/Source/WebCore/page/Frame.h (133032 => 133033)


--- trunk/Source/WebCore/page/Frame.h	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/page/Frame.h	2012-10-31 15:36:50 UTC (rev 133033)
@@ -134,6 +134,7 @@
         void injectUserScripts(UserScriptInjectionTime);
         
         String layerTreeAsText(LayerTreeFlags = 0) const;
+        String trackedRepaintRectsAsText() const;
 
         static Frame* frameForWidget(const Widget*);
 

Modified: trunk/Source/WebCore/page/FrameView.cpp (133032 => 133033)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-10-31 15:36:50 UTC (rev 133033)
@@ -67,6 +67,7 @@
 #include "Settings.h"
 #include "StyleResolver.h"
 #include "TextResourceDecoder.h"
+#include "TextStream.h"
 
 #include <wtf/CurrentTime.h>
 #include <wtf/TemporaryChange.h>
@@ -3640,10 +3641,22 @@
     if (trackRepaints == m_isTrackingRepaints)
         return;
     
-    m_trackedRepaintRects.clear();
+    resetTrackedRepaints();
     m_isTrackingRepaints = trackRepaints;
 }
 
+String FrameView::trackedRepaintRectsAsText() const
+{
+    TextStream ts;
+    if (!m_trackedRepaintRects.isEmpty()) {
+        ts << "(repaint rects\n";
+        for (size_t i = 0; i < m_trackedRepaintRects.size(); ++i)
+            ts << "  (rect " << m_trackedRepaintRects[i].x() << " " << m_trackedRepaintRects[i].y() << " " << m_trackedRepaintRects[i].width() << " " << m_trackedRepaintRects[i].height() << ")\n";
+        ts << ")\n";
+    }
+    return ts.release();
+}
+
 void FrameView::addScrollableArea(ScrollableArea* scrollableArea)
 {
     if (!m_scrollableAreas)

Modified: trunk/Source/WebCore/page/FrameView.h (133032 => 133033)


--- trunk/Source/WebCore/page/FrameView.h	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/page/FrameView.h	2012-10-31 15:36:50 UTC (rev 133033)
@@ -340,6 +340,7 @@
     bool isTrackingRepaints() const { return m_isTrackingRepaints; }
     void resetTrackedRepaints() { m_trackedRepaintRects.clear(); }
     const Vector<IntRect>& trackedRepaintRects() const { return m_trackedRepaintRects; }
+    String trackedRepaintRectsAsText() const;
 
     typedef HashSet<ScrollableArea*> ScrollableAreaSet;
     void addScrollableArea(ScrollableArea*);

Modified: trunk/Source/WebCore/testing/Internals.cpp (133032 => 133033)


--- trunk/Source/WebCore/testing/Internals.cpp	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/testing/Internals.cpp	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1263,6 +1263,16 @@
     return document->frame()->layerTreeAsText(layerTreeFlags);
 }
 
+String Internals::repaintRectsAsText(Document* document, ExceptionCode& ec) const
+{
+    if (!document || !document->frame()) {
+        ec = INVALID_ACCESS_ERR;
+        return String();
+    }
+
+    return document->frame()->trackedRepaintRectsAsText();
+}
+
 void Internals::garbageCollectDocumentResources(Document* document, ExceptionCode& ec) const
 {
     if (!document) {
@@ -1392,4 +1402,26 @@
     return stringList.release();
 }
 
+void Internals::startTrackingRepaints(Document* document, ExceptionCode& ec)
+{
+    if (!document || !document->view()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    FrameView* frameView = document->view();
+    frameView->setTracksRepaints(true);
 }
+
+void Internals::stopTrackingRepaints(Document* document, ExceptionCode& ec)
+{
+    if (!document || !document->view()) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    FrameView* frameView = document->view();
+    frameView->setTracksRepaints(false);
+}
+
+}

Modified: trunk/Source/WebCore/testing/Internals.h (133032 => 133033)


--- trunk/Source/WebCore/testing/Internals.h	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/testing/Internals.h	2012-10-31 15:36:50 UTC (rev 133033)
@@ -195,6 +195,7 @@
     };
     String layerTreeAsText(Document*, unsigned flags, ExceptionCode&) const;
     String layerTreeAsText(Document*, ExceptionCode&) const;
+    String repaintRectsAsText(Document*, ExceptionCode&) const;
 
     void garbageCollectDocumentResources(Document*, ExceptionCode&) const;
 
@@ -233,6 +234,9 @@
 
     PassRefPtr<DOMStringList> getReferencedFilePaths() const;
 
+    void startTrackingRepaints(Document*, ExceptionCode&);
+    void stopTrackingRepaints(Document*, ExceptionCode&);
+
 private:
     explicit Internals(Document*);
     Document* contextDocument() const;

Modified: trunk/Source/WebCore/testing/Internals.idl (133032 => 133033)


--- trunk/Source/WebCore/testing/Internals.idl	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebCore/testing/Internals.idl	2012-10-31 15:36:50 UTC (rev 133033)
@@ -156,6 +156,8 @@
     const unsigned short LAYER_TREE_INCLUDES_TILE_CACHES = 2;
     DOMString layerTreeAsText(in Document document, in [Optional] unsigned short flags) raises (DOMException);
 
+    DOMString repaintRectsAsText(in Document document) raises (DOMException);
+
     void garbageCollectDocumentResources(in Document document) raises (DOMException);
 
     void allowRoundingHacks();
@@ -197,4 +199,9 @@
     MallocStatistics mallocStatistics();
 
     DOMString[] getReferencedFilePaths();
+
+    // These functions both reset the tracked repaint rects. They are inteded to be used in the following order:
+    //  startTrackingRepaints, repaintRectsAsText, stopTrackingRepaints.
+    void startTrackingRepaints(in Document document) raises (DOMException);
+    void stopTrackingRepaints(in Document document) raises (DOMException);
 };

Modified: trunk/Source/WebKit2/ChangeLog (133032 => 133033)


--- trunk/Source/WebKit2/ChangeLog	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-31 15:36:50 UTC (rev 133033)
@@ -1,3 +1,19 @@
+2012-10-31  Ian Vollick  <[email protected]>
+
+        Add support for text-based repaint testing
+        https://bugs.webkit.org/show_bug.cgi?id=100584
+
+        Reviewed by Simon Fraser.
+
+        Allows tracked repaint rects to be dumped as text.
+
+        * mac/WebKit2.order:
+        * win/WebKit2.def:
+        * win/WebKit2CFLite.def:
+          Exports for:
+            FrameView::setTracksRepaints(bool)
+            Frame::trackedRepaintRectsAsText() const
+
 2012-10-31  Sudarsana Nagineni  <[email protected]>
 
         [EFL] Skip EWK2UnitTestBase.ewk_context_vibration_client_callbacks_set API test

Modified: trunk/Source/WebKit2/mac/WebKit2.order (133032 => 133033)


--- trunk/Source/WebKit2/mac/WebKit2.order	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebKit2/mac/WebKit2.order	2012-10-31 15:36:50 UTC (rev 133033)
@@ -3384,3 +3384,5 @@
 _WKAppKitDrawDecoyWindow_isKeyWindow
 __ZN6WebKit7WebPage36suspendActiveDOMObjectsAndAnimationsEv
 __ZN6WebKit7WebPage35resumeActiveDOMObjectsAndAnimationsEv
+__ZNK7WebCore5Frame25trackedRepaintRectsAsTextEv
+__ZN7WebCore9FrameView17setTracksRepaintsEb

Modified: trunk/Source/WebKit2/win/WebKit2.def (133032 => 133033)


--- trunk/Source/WebKit2/win/WebKit2.def	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebKit2/win/WebKit2.def	2012-10-31 15:36:50 UTC (rev 133033)
@@ -313,4 +313,6 @@
         ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVDOMWindow@1@@Z
         ?windowObjectCleared@InspectorFrontendClientLocal@WebCore@@UAEXXZ
         ?layerTreeAsText@Frame@WebCore@@QBE?AVString@WTF@@I@Z
+        ?trackedRepaintRectsAsText@Frame@WebCore@@QBE?AVString@WTF@@XZ
+        ?setTracksRepaints@FrameView@WebCore@@QAEX_N@Z
 

Modified: trunk/Source/WebKit2/win/WebKit2CFLite.def (133032 => 133033)


--- trunk/Source/WebKit2/win/WebKit2CFLite.def	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/WebKit2/win/WebKit2CFLite.def	2012-10-31 15:36:50 UTC (rev 133033)
@@ -299,3 +299,5 @@
         ?setProperty@Settings@InspectorFrontendClientLocal@WebCore@@UAEXABVString@WTF@@0@Z
         ?toJS@WebCore@@YA?AVJSValue@JSC@@PAVExecState@3@PAVJSDOMGlobalObject@1@PAVDOMWindow@1@@Z
         ?windowObjectCleared@InspectorFrontendClientLocal@WebCore@@UAEXXZ
+        ?trackedRepaintRectsAsText@Frame@WebCore@@QBE?AVString@WTF@@XZ
+        ?setTracksRepaints@FrameView@WebCore@@QAEX_N@Z

Modified: trunk/Source/autotools/symbols.filter (133032 => 133033)


--- trunk/Source/autotools/symbols.filter	2012-10-31 15:27:26 UTC (rev 133032)
+++ trunk/Source/autotools/symbols.filter	2012-10-31 15:36:50 UTC (rev 133033)
@@ -206,6 +206,8 @@
 _ZNK7WebCore9DOMWindow8documentEv;
 _ZTVN7WebCore28InspectorFrontendClientLocal8SettingsE;
 _ZNK7WebCore5Frame15layerTreeAsTextEj;
+_ZN7WebCore9FrameView17setTracksRepaintsEb;
+_ZNK7WebCore5Frame25trackedRepaintRectsAsTextEv;
 
 local:
 _Z*;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to