Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
[WebKit-https.git] / ManualTests / viewport-width-test-after-history-navigation.html
1 <html>
2 <head>
3     <meta name="viewport" content="width=700">
4     <script>
5         var originalViewportWidth;
6
7         function checkViewportWidthAfterHistoryNavigation() {
8             if (originalViewportWidth == window.innerWidth)
9                 document.body.innerHTML = "<div style='color:green'>PASS, viewport width is OK after history navigation.</div>";
10             else
11                 document.body.innerHTML = "<div style='color:red'>FAIL, viewport width is different after history navigation.</div>";
12         }
13
14         function navigateAwayAndBack() {
15             // Force layout before getting viewport width.
16             document.body.offsetTop;
17             originalViewportWidth = window.innerWidth;
18
19             // Assigning to window.location does not create a history entry, so instead link click is simulated.
20             var evt = document.createEvent("MouseEvents");
21             evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
22             document.getElementById('anchor').dispatchEvent(evt);
23             // Initiate timer to do final verification as we have navigated back to the cached version of this page.
24             // This test makes use of the behavior where timers are restored on a cached page.
25             setTimeout('checkViewportWidthAfterHistoryNavigation()', 1000);
26
27         }
28     </script>
29 </head>
30 <body onload='setTimeout("navigateAwayAndBack()", 0 );'>
31     <a id='anchor' href='data:text/html,
32         <html>
33             <head>
34                 <meta name="viewport" content="width=600">
35             </head>
36             <body onload="document.body.offsetTop; history.back();"></body>
37         </html>'>
38     </a>
39 </body>
40 </html>