https://bugs.webkit.org/show_bug.cgi?id=77643
Reviewed by Pavel Feldman.
Source/WebCore:
Test: inspector/styles/updates-during-dom-traversal.html
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylesSidebarPane.prototype._executeRebuildUpdate):
LayoutTests:
* inspector/styles/updates-during-dom-traversal-expected.txt: Added.
* inspector/styles/updates-during-dom-traversal.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106560
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-02 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [REGRESSION] Slow continuous DOM traversal with Up/Down keys
+ https://bugs.webkit.org/show_bug.cgi?id=77643
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/styles/updates-during-dom-traversal-expected.txt: Added.
+ * inspector/styles/updates-during-dom-traversal.html: Added.
+
2012-02-02 Tony Gentilcore <tonyg@chromium.org>
fast/speech/bubble-position.html fails on mac
--- /dev/null
+Tests that style updates are throttled during DOM traversal. Bug 77643.
+
+OK: updates throttled
+
--- /dev/null
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/elements-test.js"></script>
+<script>
+
+function test()
+{
+ var updateCount = 0;
+ var keydownCount = 5;
+ WebInspector.showPanel("elements");
+
+ InspectorTest.selectNodeAndWaitForStyles("inspected", selectCallback);
+ function selectCallback()
+ {
+ InspectorTest.addSniffer(WebInspector.StylesSidebarPane.prototype, "_rebuildUpdate", sniffUpdate, true);
+ var element = WebInspector.panels.elements.treeOutline.element;
+ for (var i = 0; i < keydownCount; ++i)
+ element.dispatchEvent(InspectorTest.createKeyEvent("Up"));
+
+ InspectorTest.runAfterPendingDispatches(completeCallback);
+ }
+
+ function completeCallback()
+ {
+ if (updateCount >= keydownCount)
+ InspectorTest.addResult("ERROR: got " + updateCount + " updates for " + keydownCount + " consecutive keydowns");
+ else
+ InspectorTest.addResult("OK: updates throttled");
+ InspectorTest.completeTest();
+ }
+
+ function sniffUpdate()
+ {
+ ++updateCount;
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that style updates are throttled during DOM traversal. <a href="https://bugs.webkit.org/show_bug.cgi?id=77643">Bug 77643</a>.
+</p>
+
+<div></div>
+<div></div>
+<div></div>
+<div></div>
+<div></div>
+<div id="inspected"></div>
+
+</body>
+</html>
+2012-02-02 Alexander Pavlov <apavlov@chromium.org>
+
+ Web Inspector: [REGRESSION] Slow continuous DOM traversal with Up/Down keys
+ https://bugs.webkit.org/show_bug.cgi?id=77643
+
+ Reviewed by Pavel Feldman.
+
+ Test: inspector/styles/updates-during-dom-traversal.html
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.prototype._executeRebuildUpdate):
+
2012-02-02 Claudio Saavedra <csaavedra@igalia.com> and Martin Robinson <mrobinson@igalia.com>
[GTK] WebKitWebView won't work in a GtkOffscreenWindow
function stylesCallback(matchedResult)
{
- if (matchedResult) {
+ if (matchedResult && this.node === node) {
resultStyles.matchedCSSRules = matchedResult.matchedCSSRules;
resultStyles.pseudoElements = matchedResult.pseudoElements;
resultStyles.inherited = matchedResult.inherited;