Title: [159488] trunk/PerformanceTests
Revision
159488
Author
[email protected]
Date
2013-11-19 01:28:38 -0800 (Tue, 19 Nov 2013)

Log Message

[CSS Regions] Add performance test for selection
https://bugs.webkit.org/show_bug.cgi?id=119230

Reviewed by Ryosuke Niwa.

Add new performance test for selection in CSS Regions. It checks a
selection from the first region to the last one, passing through all the
regions.

Test is skipped for now while implementation of selection in CSS Regions
is still evolving.

* Layout/RegionsSelection.html: Added.
* Layout/resources/regions.js:
(.):
* Skipped:

Modified Paths

Added Paths

Diff

Modified: trunk/PerformanceTests/ChangeLog (159487 => 159488)


--- trunk/PerformanceTests/ChangeLog	2013-11-19 07:53:37 UTC (rev 159487)
+++ trunk/PerformanceTests/ChangeLog	2013-11-19 09:28:38 UTC (rev 159488)
@@ -1,3 +1,22 @@
+2013-11-19  Manuel Rego Casasnovas  <[email protected]>
+
+        [CSS Regions] Add performance test for selection
+        https://bugs.webkit.org/show_bug.cgi?id=119230
+
+        Reviewed by Ryosuke Niwa.
+
+        Add new performance test for selection in CSS Regions. It checks a
+        selection from the first region to the last one, passing through all the
+        regions.
+
+        Test is skipped for now while implementation of selection in CSS Regions
+        is still evolving.
+
+        * Layout/RegionsSelection.html: Added.
+        * Layout/resources/regions.js:
+        (.):
+        * Skipped:
+
 2013-11-18  Ryosuke Niwa  <[email protected]>
 
         Simplify and reformat the output of performance tests inside test runners

Added: trunk/PerformanceTests/Layout/RegionsSelection.html (0 => 159488)


--- trunk/PerformanceTests/Layout/RegionsSelection.html	                        (rev 0)
+++ trunk/PerformanceTests/Layout/RegionsSelection.html	2013-11-19 09:28:38 UTC (rev 159488)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <link rel="stylesheet" href="" TYPE="text/css"></link>
+        <script src=""
+        <script src=""
+        <style type="text/css">
+        #log {
+            position: fixed;
+        }
+        </style>
+    </head>
+    <body>
+        <pre id="log"></pre>
+        <script>
+            PerfTestRunner.measureTime(createRegionsSelectionTest(100));
+        </script>
+    </body>
+</html>

Modified: trunk/PerformanceTests/Layout/resources/regions.js (159487 => 159488)


--- trunk/PerformanceTests/Layout/resources/regions.js	2013-11-19 07:53:37 UTC (rev 159487)
+++ trunk/PerformanceTests/Layout/resources/regions.js	2013-11-19 09:28:38 UTC (rev 159488)
@@ -88,5 +88,49 @@
         };
     }
 
+    function mouseMoveToRegionCenter(region) {
+        var rect = region.getBoundingClientRect();
+        eventSender.mouseMoveTo(rect.left + (rect.width / 2), rect.top + (rect.height / 2));
+    }
+
+    function performSelection(regionCount) {
+        var regions = document.getElementsByClassName("region");
+
+        if (window.eventSender) {
+            mouseMoveToRegionCenter(regions[0]);
+            eventSender.mouseDown();
+
+            for (var i = 1; i < regionCount; i++)
+                mouseMoveToRegionCenter(regions[i]);
+
+            eventSender.mouseUp();
+        }
+    }
+
+    function createRegionsSelectionTest(regionCount) {
+        var article = createArticle(regionCount, 1);
+        article.className = "articleInFlow";
+        var regions = createRegions("600px", "auto", regionCount, "auto");
+        document.body.appendChild(article);
+        document.body.appendChild(regions);
+        return {
+            description: "Testing selection with " + regionCount + " regions. Select text from first region to last one passing through all the regions.",
+            run: function() {
+                performSelection(regionCount);
+            },
+            setup: function() {
+                window.getSelection().removeAllRanges();
+            },
+            done: function() {
+                document.body.removeChild(article);
+                document.body.removeChild(regions);
+                templateParagraph = null;
+                templateRegion = null;
+            }
+        };
+    }
+
     window.createRegionsTest = createRegionsTest;
+    window.createRegionsSelectionTest = createRegionsSelectionTest;
+
 })();

Modified: trunk/PerformanceTests/Skipped (159487 => 159488)


--- trunk/PerformanceTests/Skipped	2013-11-19 07:53:37 UTC (rev 159487)
+++ trunk/PerformanceTests/Skipped	2013-11-19 09:28:38 UTC (rev 159488)
@@ -80,6 +80,7 @@
 Layout/RegionsAutoMaxHeight.html
 Layout/RegionsFixed.html
 Layout/RegionsFixedShort.html
+Layout/RegionsSelection.html
 
 # https://bugs.webkit.org/show_bug.cgi?id=113811#c2
 Layout/LineLayoutJapanese.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to