Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Unified Diff: PerformanceTests/Events/EventsDispatchingInShadowTrees.html

Issue 108723007: Introduce TreeScopeEventContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename SharedEventContext to TreeScopeEventContext Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PerformanceTests/Events/EventsDispatchingInShadowTrees.html
diff --git a/PerformanceTests/Events/EventsDispatchingInShadowTrees.html b/PerformanceTests/Events/EventsDispatchingInShadowTrees.html
new file mode 100644
index 0000000000000000000000000000000000000000..01eaeb68617b49a3b76837298fc4210ca184ae96
--- /dev/null
+++ b/PerformanceTests/Events/EventsDispatchingInShadowTrees.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript" src="../resources/runner.js"></script>
+</head>
+<body>
+<div id="root"></div>
+<script>
+function createTreeOfTrees(root, depth, branch, eachTreeHeight)
+{
+ var node = root;
+ var i;
+ for (i = 0; i < eachTreeHeight; ++i) {
+ var child = document.createElement('div');
+ node.appendChild(child);
+ node = child;
+ }
+ if (depth == 1)
+ return;
+ for (i = 0; i < branch; ++i) {
+ var child = document.createElement('div');
+ node.appendChild(child);
+ var shadowRoot = child.webkitCreateShadowRoot();
+ createTreeOfTrees(shadowRoot, depth - 1, branch, eachTreeHeight);
+ }
+}
+
+function leftMostLeaf(root)
+{
+ var node = root;
+ while (node.firstChild)
+ node = node.firstChild
+ if (!node.shadowRoot)
+ return node;
+ return leftMostLeaf(node.shadowRoot)
+}
+
+function rightMostLeaf(root)
+{
+ var node = root;
+ while (node.lastChild)
+ node = node.lastChild
+ if (!node.shadowRoot)
+ return node;
+ return rightMostLeaf(node.shadowRoot)
+}
+
+var root = document.getElementById('root');
+createTreeOfTrees(root, 10, 2, 50);
+var leaf1 = leftMostLeaf(root);
+var leaf2 = rightMostLeaf(root);
+
+function run()
+{
+ leaf1.dispatchEvent(new MouseEvent('mousemove', {
+ relatedTarget: leaf2
+ }));
+}
+
+PerfTestRunner.measureRunsPerSecond({
+ description: "Measure mousemove events dispatching in shadow trees",
+ run: run
+});
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698