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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PerformanceTests/CSS/ClassInvalidation.html
diff --git a/PerformanceTests/CSS/ClassInvalidation.html b/PerformanceTests/CSS/ClassInvalidation.html
new file mode 100644
index 0000000000000000000000000000000000000000..4dcb3487bc8d94e41f5b601f97cd6d701d41fabb
--- /dev/null
+++ b/PerformanceTests/CSS/ClassInvalidation.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="../resources/runner.js"></script>
+<style>
+.a .b { background-color: green }
+</style>
+<div id="root"></div>
+<script>
+function appendDivChildren(root, childCount, levels) {
+ if (levels <= 0)
+ return;
+ for (var i = 0; i < childCount; i++) {
+ var div = document.createElement("div");
+ appendDivChildren(div, childCount, levels - 1)
+ root.appendChild(div);
+ }
+}
+
+var root = document.getElementById("root");
+appendDivChildren(root, 5, 5);
+root.firstChild.className = "b";
+document.body.offsetTop; // force style recalc.
+
+PerfTestRunner.measureRunsPerSecond({
+ description: "Measure the style recalc performance when changing a class affecting the style of a single descendant.",
+ run: function() {
+ root.className = "a";
+ root.offsetTop; // force recalc.
+ root.className = "";
+ root.offsetTop; // force recalc.
+ }});
+</script>
« 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