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

Unified Diff: third_party/WebKit/PerformanceTests/Paint/transform-changes.html

Issue 2564773003: Increase load of blink_perf.paint to reduce flakiness (Closed)
Patch Set: Fix a typo Created 4 years 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 | « third_party/WebKit/PerformanceTests/Paint/paint-offset-changes.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/PerformanceTests/Paint/transform-changes.html
diff --git a/third_party/WebKit/PerformanceTests/Paint/transform-changes.html b/third_party/WebKit/PerformanceTests/Paint/transform-changes.html
index fbbe214995e72b17697958c02678452896139cfa..dcd5b281546de81d760a70b2e2ce15a8a84259f3 100644
--- a/third_party/WebKit/PerformanceTests/Paint/transform-changes.html
+++ b/third_party/WebKit/PerformanceTests/Paint/transform-changes.html
@@ -14,31 +14,43 @@
// This test measures the lifecycle update performance of changing transforms
// in large trees.
-function buildTree(parent, depth, arity, createElementCallback) {
+function buildTree(parent, depth, arity, tagNameCallback, createElementCallback) {
for (var child = 0; child < arity; child++) {
- var element = document.createElement('span');
+ var element = document.createElement(tagNameCallback(depth));
parent.appendChild(element);
createElementCallback(element, depth);
if (depth > 1)
- buildTree(element, depth - 1, arity, createElementCallback);
+ buildTree(element, depth - 1, arity, tagNameCallback, createElementCallback);
}
}
-// Build a tall tree (depth=10) that is skinny (arity=2). A middle layer of
+// Build a tall tree that is skinny. A middle layer of
// the tree should have the changeTransform class.
-buildTree(document.body, 11, 2, function(element, depth) {
- element.style.borderColor = 'red';
- if (depth == 5)
- element.setAttribute('class', 'changeTransform');
-});
+buildTree(document.body, 13, 2,
+ function(depth) {
+ // Use divs at upper levels to avoid too much layout time.
+ return depth > 11 ? 'div' : 'span';
+ },
+ function(element, depth) {
+ element.style.borderColor = 'red';
+ if (depth == 5)
+ element.setAttribute('class', 'changeTransform');
+ }
+);
-// Build a short tree (depth=6) that is fat (arity=4). A middle layer of
+// Build a short tree that is fat. A middle layer of
// the tree should have the changeTransform class.
-buildTree(document.body, 6, 4, function(element, depth) {
- element.style.borderColor = 'orange';
- if (depth == 3)
- element.setAttribute('class', 'changeTransform');
-});
+buildTree(document.body, 6, 6,
+ function(depth) {
+ // Use divs at upper levels to avoid too much layout time.
+ return depth > 5 ? 'div' : 'span';
+ },
+ function(element, depth) {
+ element.style.borderColor = 'orange';
+ if (depth == 3)
+ element.setAttribute('class', 'changeTransform');
+ }
+);
var runCount = 0;
var elementsToChange = document.getElementsByClassName('changeTransform');
« no previous file with comments | « third_party/WebKit/PerformanceTests/Paint/paint-offset-changes.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698