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

Side by Side Diff: PerformanceTests/Layout/resources/body_relayout.js

Issue 203463008: Revert "Get rid of unnecessary layouts on body elements with quirky children" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
OLDNEW
(Empty)
1 (function() {
2 function createElement(tag, parent, className, id) {
3 var el = document.createElement(tag);
4 el.className = className;
5 if (id)
6 el.id = id;
7 parent.appendChild(el);
8 return el;
9 }
10
11 function createSet(width, height, nested) {
12 var container = createElement("div", document.body, "container");
13 for (var y = 0; y < height; ++y) {
14 createElement("div", container, "float", "float" + x + "_" + y);
15 for (var x = 0; x < width; ++x)
16 createElement("div", container, "normal", "normal" + x + "_" + y );
17
18 var nestedContainer = container;
19 for ( ; nested > 0; --nested)
20 nestedContainer = createElement("div", nestedContainer, "normal" , "normal" + x + "_" + nested);
21 }
22 return container;
23 }
24
25 function createTestFunction(width, height, nested, runs) {
26 var container = createSet(width, height, nested);
27 nested = nested || 0;
28 runs = runs || 10;
29 return function() {
30 for (var i = 0; i < runs; ++i) {
31 // Force a layout.
32 var body = document.getElementById("body")
33 body.style['height'] = 800 + i + "px";
34 document.body.offsetTop;
35 }
36 PerfTestRunner.resetRandomSeed();
37 }
38 }
39
40 window.createBodyRelayoutTestFunction = createTestFunction;
41 })();
OLDNEW
« no previous file with comments | « PerformanceTests/Layout/resources/body_relayout.css ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698