Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / PerformanceTests / Mutation / inner-html.html
blob3fa45a3f3798a27d2cfc4875a1a71981a91493d7
1 <!DOCTYPE html>
2 <body>
3 <pre id="log"></pre>
4 <script src="../resources/runner.js"></script>
5 <div id="sandbox" style="display:none"></div>
6 <script>
7 var sandbox = document.getElementById('sandbox');
8 var observing = false;
9 for (var i = 0; i < 1000; ++i)
10 sandbox.appendChild(document.createElement('div'));
11 var html = sandbox.innerHTML;
13 var observer = new WebKitMutationObserver(listener);
14 var tickledSpan = document.createElement('span');
15 observer.observe(tickledSpan, {attributes: true});
17 function resetState() {
18 window.start = null;
19 window.numRuns = 25;
20 window.times = [];
23 function runAgain() {
24 tickledSpan.setAttribute('data-foo', numRuns);
27 function listener(mutations) {
28 if (start) {
29 var time = Date.now() - start;
30 times.push(time);
31 PerfTestRunner.log(time);
33 if (numRuns-- >= 0) {
34 runAgain();
35 start = Date.now();
36 for (var i = 0; i < 100; ++i)
37 sandbox.innerHTML = html;
38 } else {
39 PerfTestRunner.logStatistics(times);
40 if (!observing) {
41 observer.observe(sandbox, {childList: true});
42 observing = true;
43 resetState();
44 PerfTestRunner.log('\n------------\n');
45 PerfTestRunner.log('Running ' + numRuns + ' times with observation');
46 setTimeout(runAgain, 0);
51 resetState();
52 PerfTestRunner.log('Running ' + numRuns + ' times without observation');
53 window.addEventListener('load', runAgain);
54 </script>
55 </body>