summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/PerformanceTests/CSS/StyleSheetInsert-bootstrap.html
blob: 1b0987cf9d4482b741fc7e53894c828b690f20f8 (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>
<html>
<head>
<script src="../resources/runner.js"></script>
</head>
<body>
<iframe></iframe>
</body>
<script>
function loadText(path) {
    var xhr = new XMLHttpRequest();
    xhr.open("GET", path, false);
    xhr.send(null);
    return xhr.responseText;
}
var styleText = loadText("resources/bootstrap.min.css");

PerfTestRunner.measureRunsPerSecond({
    description: "Measures performance of inserting a style elemenet ocntaining bootstrap's CSS into an iframe.",
    run:function() {
        var testDoc = document.getElementsByTagName("iframe")[0].contentDocument;
        testDoc.documentElement.innerHTML = "";
        var style = testDoc.createElement("style");
        style.textContent = styleText;
        testDoc.documentElement.appendChild(style);
    }
});
</script>
</html>