Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / pending-stylesheet-repaint.html
blob1123a6591c93c6f20426e21991edc7f972236705
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test case</title>
5 </head>
7 <body>
8 <div style="background: green; width: 32px; height: 32px; position: absolute"></div>
10 <script>
11 window.addEventListener(
12 'DOMContentLoaded',
13 function() {
14 // Must dynamically fetch another stylesheet
15 var el = document.createElement('link');
16 el.href = 'data:text/css,';
17 el.type = 'text/css';
18 el.rel = 'stylesheet';
19 document.getElementsByTagName('head')[0].appendChild(el);
21 // Based on jQuery pre-1.6.2 code, which creates a temporary <body>
22 // element to do tests on:
23 // https://github.com/jquery/jquery/blob/304dd618b7aa17158446bedd80af330375d8d4d4/src/support.js#L138
24 // The behavior was changed for jQuery 1.6.2 with this commit:
25 // https://github.com/jquery/jquery/commit/ceba855c010c792aad8fc15edc06b86285f71142/
26 var anotherBody = document.createElement('body');
28 document.documentElement.insertBefore(
29 anotherBody, document.documentElement.firstChild);
31 // Triggering a style recalc here is necessary.
32 anotherBody.offsetHeight;
34 anotherBody.parentNode.removeChild(anotherBody);
36 false);
37 </script>
38 </body>
39 </html>