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

Side by Side Diff: PerformanceTests/CSS/ClassInvalidation.html

Issue 313963006: Missing return after class invalidation short-cut. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use existing "root" element instead of creating a new one. Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/runner.js"></script>
3 <style>
4 .a .b { background-color: green }
5 </style>
6 <div id="root"></div>
7 <script>
8 function appendDivChildren(root, childCount, levels) {
9 if (levels <= 0)
10 return;
11 for (var i = 0; i < childCount; i++) {
12 var div = document.createElement("div");
13 appendDivChildren(div, childCount, levels - 1)
14 root.appendChild(div);
15 }
16 }
17
18 var root = document.getElementById("root");
19 appendDivChildren(root, 5, 5);
20 root.firstChild.className = "b";
21 document.body.offsetTop; // force style recalc.
22
23 PerfTestRunner.measureRunsPerSecond({
24 description: "Measure the style recalc performance when changing a class aff ecting the style of a single descendant.",
25 run: function() {
26 root.className = "a";
27 root.offsetTop; // force recalc.
28 root.className = "";
29 root.offsetTop; // force recalc.
30 }});
31 </script>
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698