Title: [87683] trunk
Revision
87683
Author
apav...@chromium.org
Date
2011-05-30 06:48:09 -0700 (Mon, 30 May 2011)

Log Message

2011-05-27  Alexander Pavlov  <apav...@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: node selection is slow in the Elements panel.
        https://bugs.webkit.org/show_bug.cgi?id=60813

        * http/tests/inspector/inspect-iframe-from-different-domain.html:
        * inspector/elements/elements-delete-inline-style.html:
        * inspector/elements/elements-panel-styles.html:
        * inspector/styles/styles-iframe.html:
        * inspector/styles/styles-update-from-js.html:
        * inspector/styles/styles-update-from-js-expected.txt:
        * inspector/styles/styles-url-linkify.html:
2011-05-25  Alexander Pavlov  <apav...@chromium.org>

        Reviewed by Yury Semikhatsky.

        Web Inspector: node selection is slow in the Elements panel.
        https://bugs.webkit.org/show_bug.cgi?id=60813

        Schedule full style updates rather than request all node styles from the backend up front.

        * inspector/front-end/StylesSidebarPane.js:
        (WebInspector.StylesSidebarPane.prototype.update.reloadAllStyles):
        (WebInspector.StylesSidebarPane.prototype.update):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (87682 => 87683)


--- trunk/LayoutTests/ChangeLog	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/ChangeLog	2011-05-30 13:48:09 UTC (rev 87683)
@@ -1,3 +1,18 @@
+2011-05-27  Alexander Pavlov  <apav...@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: node selection is slow in the Elements panel.
+        https://bugs.webkit.org/show_bug.cgi?id=60813
+
+        * http/tests/inspector/inspect-iframe-from-different-domain.html:
+        * inspector/elements/elements-delete-inline-style.html:
+        * inspector/elements/elements-panel-styles.html:
+        * inspector/styles/styles-iframe.html:
+        * inspector/styles/styles-update-from-js.html:
+        * inspector/styles/styles-update-from-js-expected.txt:
+        * inspector/styles/styles-url-linkify.html:
+
 2011-05-30  Mikhail Naganov  <mnaga...@chromium.org>
 
         Unreviewed.

Modified: trunk/LayoutTests/http/tests/inspector/inspect-iframe-from-different-domain.html (87682 => 87683)


--- trunk/LayoutTests/http/tests/inspector/inspect-iframe-from-different-domain.html	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/http/tests/inspector/inspect-iframe-from-different-domain.html	2011-05-30 13:48:09 UTC (rev 87683)
@@ -16,7 +16,8 @@
 
 function test()
 {
-    InspectorTest.selectNodeWithId("iframe-body", step1);
+    InspectorTest.selectNodeWithId("iframe-body");
+    InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
 
     function step1()
     {

Modified: trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html (87682 => 87683)


--- trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html	2011-05-30 13:48:09 UTC (rev 87683)
@@ -7,14 +7,15 @@
 function test()
 {
     WebInspector.showPanel("elements");
-    InspectorTest.selectNodeWithId("inspected", step1);
+    InspectorTest.selectNodeWithId("inspected");
+    InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
 
     function step1(node)
     {
         InspectorTest.addResult("Before style property removal:");
         InspectorTest.dumpSelectedElementStyles(true);
         node.removeAttribute("style");
-        InspectorTest.runAfterPendingDispatches(step2);
+        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     }
 
     function step2()

Modified: trunk/LayoutTests/inspector/elements/elements-panel-styles.html (87682 => 87683)


--- trunk/LayoutTests/inspector/elements/elements-panel-styles.html	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/inspector/elements/elements-panel-styles.html	2011-05-30 13:48:09 UTC (rev 87683)
@@ -8,7 +8,8 @@
 
 function test()
 {
-    InspectorTest.selectNodeWithId("foo", step1);
+    InspectorTest.selectNodeWithId("foo");
+    InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
 
     function step1()
     {

Modified: trunk/LayoutTests/inspector/styles/styles-iframe.html (87682 => 87683)


--- trunk/LayoutTests/inspector/styles/styles-iframe.html	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/inspector/styles/styles-iframe.html	2011-05-30 13:48:09 UTC (rev 87683)
@@ -30,7 +30,8 @@
     {
         InspectorTest.addResult("Main frame style:");
         InspectorTest.dumpSelectedElementStyles(true, false, true);
-        InspectorTest.selectNodeWithId("iframeBody", step2);
+        InspectorTest.selectNodeWithId("iframeBody");
+        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
     }
 
     function step2()

Modified: trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt (87682 => 87683)


--- trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt	2011-05-30 13:48:09 UTC (rev 87683)
@@ -1,9 +1,6 @@
 Tests that changes to an inline style from _javascript_ are reflected in the Styles pane and Elements tree.
 
-
-Running: testInit
-
-Running: testSetStyleAttribute
+Modified "style" attribute
 <div id="container" style="color: #daC0DE; border: 1px solid black;"></div>
 [expanded] element.style { ()
 color: #DAC0DE;
@@ -22,15 +19,13 @@
     border-left-color: black;
 
 
-
-Running: testSetStyleCSSText
+Modified cssText
 <div id="container" style="color: rgb(192, 255, 238); "></div>
 [expanded] element.style { ()
 color: #C0FFEE;
 
 
-
-Running: testSetViaParsedAttributes
+Modified parsed attributes
 <div id="container" style="color: rgb(192, 255, 238); border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: green; border-right-color: green; border-bottom-color: green; border-left-color: green; border-top-width: 3px; border-right-width: 3px; border-bottom-width: 3px; border-left-width: 3px; "></div>
 [expanded] element.style { ()
 color: #C0FFEE;

Modified: trunk/LayoutTests/inspector/styles/styles-update-from-js.html (87682 => 87683)


--- trunk/LayoutTests/inspector/styles/styles-update-from-js.html	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/inspector/styles/styles-update-from-js.html	2011-05-30 13:48:09 UTC (rev 87683)
@@ -22,54 +22,36 @@
 
 function test()
 {
-    InspectorTest.runTestSuite([
+    var sniffCount = 0;
 
-        function testInit(next)
-        {
-            InspectorTest.selectNodeWithId("container", next);
-        },
+    InspectorTest.selectNodeWithId("container", installSniffer);
 
-        function testSetStyleAttribute(next)
-        {
-            var updateCount = 0;
-            function callback()
-            {
-                // Expect two updates while setting attribute.
-                if (++updateCount === 2) {
-                    dumpAttributeAndStyles();
-                    next();
-                }
-            }
-            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true);
-            InspectorTest.evaluateInPage("modifyStyleAttribute()");
-        },
+    function installSniffer()
+    {
+        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", snifferCallback, true);
+        InspectorTest.evaluateInPage("modifyStyleAttribute()");
+    }
 
-        function testSetStyleCSSText(next)
-        {
-            var updateCount = 0;
-            function callback()
-            {
-                // Expect two updates while setting css text.
-                if (++updateCount === 2) {
-                    dumpAttributeAndStyles();
-                    next();
-                }
-            }
-            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback, true);
-            InspectorTest.evaluateInPage("modifyCSSText()", callback);
-        },
-
-        function testSetViaParsedAttributes(next)
-        {
-            function callback()
-            {
+    function snifferCallback()
+    {
+        switch (++sniffCount) {
+            case 1:
+                InspectorTest.addResult("Modified \"style\" attribute");
                 dumpAttributeAndStyles();
-                next();
-            }
-            InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", callback);
-            InspectorTest.evaluateInPage("modifyParsedAttributes()");
+                InspectorTest.evaluateInPage("modifyCSSText()");
+                break;
+            case 2:
+                InspectorTest.addResult("Modified cssText");
+                dumpAttributeAndStyles();
+                InspectorTest.evaluateInPage("modifyParsedAttributes()");
+                break;
+            case 3:
+                InspectorTest.addResult("Modified parsed attributes");
+                dumpAttributeAndStyles();
+                InspectorTest.completeTest();
+                break;
         }
-    ]);
+    }
 
     function dumpAttributeAndStyles()
     {

Modified: trunk/LayoutTests/inspector/styles/styles-url-linkify.html (87682 => 87683)


--- trunk/LayoutTests/inspector/styles/styles-url-linkify.html	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/LayoutTests/inspector/styles/styles-url-linkify.html	2011-05-30 13:48:09 UTC (rev 87683)
@@ -52,7 +52,9 @@
     {
         InspectorTest.addResult("Link for a URI from CSS document:");
         dumpHref();
-        InspectorTest.selectNodeWithId("iframed", step2);
+        InspectorTest.selectNodeWithId("iframed");
+        InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
+
     }
 
     function step2()

Modified: trunk/Source/WebCore/ChangeLog (87682 => 87683)


--- trunk/Source/WebCore/ChangeLog	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/Source/WebCore/ChangeLog	2011-05-30 13:48:09 UTC (rev 87683)
@@ -1,3 +1,16 @@
+2011-05-25  Alexander Pavlov  <apav...@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: node selection is slow in the Elements panel.
+        https://bugs.webkit.org/show_bug.cgi?id=60813
+
+        Schedule full style updates rather than request all node styles from the backend up front.
+
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype.update.reloadAllStyles):
+        (WebInspector.StylesSidebarPane.prototype.update):
+
 2011-05-30  Andrey Kosyakov  <ca...@chromium.org>
 
         Reviewed by Pavel Feldman.

Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (87682 => 87683)


--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-05-30 10:36:55 UTC (rev 87682)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-05-30 13:48:09 UTC (rev 87683)
@@ -235,10 +235,21 @@
                 this._refreshUpdate(node, computedStyle, editedSection);
         }
 
+        function reloadAllStyles()
+        {
+            delete this._reloadAllStylesTimer;
+            WebInspector.cssModel.getStylesAsync(this._allStylesNodeId, stylesCallback.bind(this))
+        }
+
         if (refresh)
             WebInspector.cssModel.getComputedStyleAsync(node.id, computedStyleCallback.bind(this));
-        else
-            WebInspector.cssModel.getStylesAsync(node.id, stylesCallback.bind(this));
+        else {
+            // Always refresh the node to request styles for.
+            this._allStylesNodeId = node.id;
+            if ("_reloadAllStylesTimer" in this)
+                return;
+            this._reloadAllStylesTimer = setTimeout(reloadAllStyles.bind(this), 0);
+        }
     },
 
     _refreshUpdate: function(node, computedStyle, editedSection)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to