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

Side by Side Diff: third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-invisible-collapsed-borders.html

Issue 1550833002: PerformanceTests/Layout/large-table-background-change* to Paint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-visible-collapsed-borders.html » ('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 <pre id="log"></pre>
4 <script>
5 // We discard the first iteration to avoid a cold outlier.
6 var iterations = 11;
7 var results = [];
8 var previousFrameTime = -1;
9 var now = function(){
10 return window.performance ? performance.now() : Date.now();
11 };
12
13 function createTable(rows, columns) {
14 var table = document.createElement("TABLE");
15 // Collapsing border is not necessary to see the slowness
16 // but it makes the painting phase ~2x slower.
17 table.style.borderCollapse = "collapse";
18 for (var i = 0; i < rows; ++i) {
19 var tr = document.createElement("TR");
20 for (var j = 0; j < columns; ++j) {
21 var td = document.createElement("TD");
22 tr.appendChild(td);
23 }
24 table.appendChild(tr);
25 }
26 return table;
27 }
28
29
30 var table = createTable(300, 320);
31 document.body.appendChild(table);
32
33 ix=30;
34 iy=30;
35
36 function toggleBackgroundColor()
37 {
38 var thisFrameTime = now();
39 if (previousFrameTime != -1)
40 results.push(thisFrameTime - previousFrameTime);
41 previousFrameTime = thisFrameTime;
42
43 if (iterations == 0) {
44 PerfTestRunner.logStatistics(results, 'ms', "Time:");
45 if (window.testRunner)
46 testRunner.notifyDone();
47 } else {
48 iterations--;
49 window.requestAnimationFrame(toggleBackgroundColor);
50 }
51
52 table.childNodes[iy].childNodes[ix].style.backgroundColor = 'teal';
53 ix++;
54 iy++;
55 }
56
57 if (window.testRunner)
58 testRunner.waitUntilDone();
59
60 // Start the test after two frame to ensure we have set-up, laid out and painted the table.
61 window.requestAnimationFrame(function() { window.requestAnimationFrame(toggleBac kgroundColor) });
62 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/PerformanceTests/Layout/large-table-background-change-with-visible-collapsed-borders.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698