| <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, "_innerRebuildUpdate", 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> |