blob: 60f30cebd2d95c4fefbd2ee84cf6d0076a2aea1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<!DOCTYPE html>
<style>
.x { color: blue; }
.x .y { background-color: green; }
</style>
<script src="util.js"></script>
<script>
function find_leftmost(e) {
while (e.firstChild) {
e = e.firstChild;
}
return e;
}
window.onload = function() {
document.head.appendChild(build_rule("div", 1, "{ color: blue; }", 100));
let root = document.createElement("div");
root.className = "root";
root.appendChild(build_dom(50000, "div"));
let leftmost = find_leftmost(root);
leftmost.className = "y";
document.body.appendChild(root);
flush_style(root);
perf_start();
document.body.className = "x";
flush_style(root);
perf_finish();
};
</script>
<body></body>
|