Diff
Modified: trunk/LayoutTests/ChangeLog (88336 => 88337)
--- trunk/LayoutTests/ChangeLog 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/ChangeLog 2011-06-08 11:31:54 UTC (rev 88337)
@@ -1,3 +1,26 @@
+2011-06-08 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-add-invalid-property.html:
+ * inspector/styles/styles-cancel-editing.html:
+ * inspector/styles/styles-commit-editing.html:
+ * inspector/styles/styles-computed-trace.html:
+ * inspector/styles/styles-disable-inherited.html:
+ * inspector/styles/styles-disable-then-change.html:
+ * inspector/styles/styles-disable-then-delete.html:
+ * inspector/styles/styles-disable-then-enable.html:
+ * inspector/styles/styles-iframe.html:
+ * inspector/styles/styles-update-from-js-expected.txt:
+ * inspector/styles/styles-update-from-js.html:
+ * inspector/styles/styles-url-linkify.html:
+
2011-06-08 Hironori Bono <hb...@chromium.org>
Reviewed by Brent Fulgham.
Modified: trunk/LayoutTests/http/tests/inspector/inspect-iframe-from-different-domain.html (88336 => 88337)
--- trunk/LayoutTests/http/tests/inspector/inspect-iframe-from-different-domain.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/http/tests/inspector/inspect-iframe-from-different-domain.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -16,13 +16,16 @@
function test()
{
- InspectorTest.selectNodeWithId("iframe-body", step1);
+ InspectorTest.selectNodeWithId("iframe-body");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1, true);
- function step1()
+ function step1(node)
{
- var treeItem = InspectorTest.getElementStylePropertyTreeItem("background");
- InspectorTest.dumpStyleTreeItem(treeItem, "");
- InspectorTest.completeTest();
+ if (node && node.getAttribute("id") === "iframe-body") {
+ var treeItem = InspectorTest.getElementStylePropertyTreeItem("background");
+ InspectorTest.dumpStyleTreeItem(treeItem, "");
+ InspectorTest.completeTest();
+ }
}
}
Modified: trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html (88336 => 88337)
--- trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/elements/elements-delete-inline-style.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -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 (88336 => 88337)
--- trunk/LayoutTests/inspector/elements/elements-panel-styles.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/elements/elements-panel-styles.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -8,12 +8,15 @@
function test()
{
- InspectorTest.selectNodeWithId("foo", step1);
+ InspectorTest.selectNodeWithId("foo");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1, true);
- function step1()
+ function step1(node)
{
- InspectorTest.dumpSelectedElementStyles(false, false);
- InspectorTest.completeTest();
+ if (node && node.getAttribute("id") === "foo") {
+ InspectorTest.dumpSelectedElementStyles(false, false);
+ InspectorTest.completeTest();
+ }
}
}
Modified: trunk/LayoutTests/inspector/styles/styles-add-invalid-property.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-add-invalid-property.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-add-invalid-property.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -7,7 +7,8 @@
function test()
{
WebInspector.showPanel("elements");
- InspectorTest.selectNodeWithId("inspected", step0);
+ InspectorTest.selectNodeWithId("inspected");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step0);
var treeElement;
var section;
@@ -45,12 +46,14 @@
function step3()
{
- InspectorTest.selectNodeWithId("other", step4);
+ InspectorTest.selectNodeWithId("other");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
}
function step4()
{
- InspectorTest.selectNodeWithId("inspected", step5);
+ InspectorTest.selectNodeWithId("inspected");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step5);
}
function step5()
Modified: trunk/LayoutTests/inspector/styles/styles-cancel-editing.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-cancel-editing.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-cancel-editing.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -7,7 +7,8 @@
function test()
{
WebInspector.showPanel("elements");
- InspectorTest.selectNodeWithId("inspected", step1);
+ InspectorTest.selectNodeWithId("inspected");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
var treeElement;
var section;
@@ -33,12 +34,14 @@
function step2()
{
- InspectorTest.selectNodeWithId("other", step3);
+ InspectorTest.selectNodeWithId("other");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
}
function step3()
{
- InspectorTest.selectNodeWithId("inspected", step4);
+ InspectorTest.selectNodeWithId("inspected");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
}
function step4()
Modified: trunk/LayoutTests/inspector/styles/styles-commit-editing.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-commit-editing.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-commit-editing.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -7,7 +7,8 @@
function test()
{
WebInspector.showPanel("elements");
- InspectorTest.selectNodeWithId("inspected", step1);
+ InspectorTest.selectNodeWithId("inspected");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
var treeElement;
var section;
@@ -34,12 +35,14 @@
function step2()
{
- InspectorTest.selectNodeWithId("other", step3);
+ InspectorTest.selectNodeWithId("other");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
}
function step3()
{
- InspectorTest.selectNodeWithId("inspected", step4);
+ InspectorTest.selectNodeWithId("inspected");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
}
function step4()
Modified: trunk/LayoutTests/inspector/styles/styles-computed-trace.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-computed-trace.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-computed-trace.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -37,14 +37,16 @@
function test()
{
- InspectorTest.selectNodeWithId("id1", step1);
+ InspectorTest.selectNodeWithId("id1");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
function step1()
{
InspectorTest.addResult("==== Computed style for ID1 ====");
InspectorTest.dumpSelectedElementStyles(false, true);
- InspectorTest.selectNodeWithId("id2", step2);
+ InspectorTest.selectNodeWithId("id2");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
}
function step2()
Modified: trunk/LayoutTests/inspector/styles/styles-disable-inherited.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-disable-inherited.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-disable-inherited.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -7,7 +7,8 @@
function test()
{
- InspectorTest.selectNodeWithId("nested", step1);
+ InspectorTest.selectNodeWithId("nested");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
function step1()
{
@@ -15,14 +16,16 @@
InspectorTest.addResult("Before disable");
InspectorTest.dumpSelectedElementStyles(true);
- InspectorTest.selectNodeWithId("container", step2);
+ InspectorTest.selectNodeWithId("container");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step2);
}
function step2()
{
var treeItem = InspectorTest.getElementStylePropertyTreeItem("font-weight");
treeItem.toggleEnabled({ target: { checked: false } });
- InspectorTest.selectNodeWithId("nested", step3);
+ InspectorTest.selectNodeWithId("nested");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step3);
}
function step3()
Modified: trunk/LayoutTests/inspector/styles/styles-disable-then-change.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-disable-then-change.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-disable-then-change.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -6,7 +6,8 @@
function test()
{
- InspectorTest.selectNodeWithId("container", step1);
+ InspectorTest.selectNodeWithId("container");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
function step1()
{
Modified: trunk/LayoutTests/inspector/styles/styles-disable-then-delete.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-disable-then-delete.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-disable-then-delete.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -6,7 +6,8 @@
function test()
{
- InspectorTest.selectNodeWithId("container", step1);
+ InspectorTest.selectNodeWithId("container");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
function step1()
{
@@ -34,15 +35,17 @@
function step3()
{
- InspectorTest.selectNodeWithId("other", step4);
+ InspectorTest.selectNodeWithId("other");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step4);
}
function step4()
{
- InspectorTest.selectNodeWithId("container", step5);
+ InspectorTest.selectNodeWithId("container");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step5);
}
- function step5(node)
+ function step5()
{
InspectorTest.addResult("After delete");
InspectorTest.dumpSelectedElementStyles(true, true);
Modified: trunk/LayoutTests/inspector/styles/styles-disable-then-enable.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-disable-then-enable.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-disable-then-enable.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -6,7 +6,8 @@
function test()
{
- InspectorTest.selectNodeWithId("container", step1);
+ InspectorTest.selectNodeWithId("container");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
function step1()
{
Modified: trunk/LayoutTests/inspector/styles/styles-iframe.html (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-iframe.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-iframe.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -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 (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-update-from-js-expected.txt 2011-06-08 11:31:54 UTC (rev 88337)
@@ -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 (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-update-from-js.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-update-from-js.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -22,54 +22,37 @@
function test()
{
- InspectorTest.runTestSuite([
+ var sniffCount = 0;
- function testInit(next)
- {
- InspectorTest.selectNodeWithId("container", next);
- },
+ InspectorTest.selectNodeWithId("container");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", selectCallback);
- 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 selectCallback()
+ {
+ InspectorTest.evaluateInPage("modifyStyleAttribute()");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", snifferCallback, true);
+ }
- 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 (88336 => 88337)
--- trunk/LayoutTests/inspector/styles/styles-url-linkify.html 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/LayoutTests/inspector/styles/styles-url-linkify.html 2011-06-08 11:31:54 UTC (rev 88337)
@@ -46,13 +46,16 @@
InspectorTest.addResult(output.join("/"));
}
- InspectorTest.selectNodeWithId("local", step1);
+ InspectorTest.selectNodeWithId("local");
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", step1);
function step1()
{
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 (88336 => 88337)
--- trunk/Source/WebCore/ChangeLog 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/Source/WebCore/ChangeLog 2011-06-08 11:31:54 UTC (rev 88337)
@@ -1,3 +1,16 @@
+2011-06-08 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 immediately.
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype.update.reloadAllStyles):
+ (WebInspector.StylesSidebarPane.prototype.update):
+
2011-06-08 Andreas Kling <andreas.kl...@nokia.com>
Reviewed by Laszlo Gombos.
Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (88336 => 88337)
--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js 2011-06-08 10:52:40 UTC (rev 88336)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js 2011-06-08 11:31:54 UTC (rev 88337)
@@ -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)