OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script> | 4 <script> |
5 | 5 |
6 window.iframeLoaded = function() { | 6 window.iframeLoaded = function() { |
7 document.location.hash = '#ready'; | 7 document.location.hash = '#ready'; |
8 | 8 |
9 var iframe = document.getElementsByTagName('iframe')[0]; | 9 var iframe = document.getElementsByTagName('iframe')[0]; |
10 var oldScreen = iframe.contentWindow.screen; | 10 var oldScreen = iframe.contentWindow.screen; |
| 11 var oldOrient = oldScreen.orientation; |
11 | 12 |
12 iframe.remove(); | 13 iframe.remove(); |
13 | 14 |
14 oldScreen.orientation.unlock(); | 15 // The screen.orientation object will not be exposed once the |
| 16 // screen has become detached, but probe for it regardless to |
| 17 // verify that such post-detach use doesn't crash. |
| 18 oldOrient = oldScreen.orientation || oldOrient; |
| 19 |
| 20 oldOrient.unlock(); |
15 document.location.hash = '#done'; | 21 document.location.hash = '#done'; |
16 } | 22 } |
17 | 23 |
18 </script> | 24 </script> |
19 <iframe src='detached-iframe.html'></iframe> | 25 <iframe src='detached-iframe.html'></iframe> |
20 </body> | 26 </body> |
21 </html> | 27 </html> |
OLD | NEW |