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

content / test / data / screen_orientation / screen_orientation_use_after_detach.html [blame]

<!DOCTYPE html>
<html>
<body>
<script>

window.iframeLoaded = function() {
  document.location.hash = '#ready';

  var iframe = document.getElementsByTagName('iframe')[0];
  var oldScreen = iframe.contentWindow.screen;
  var oldOrient = oldScreen.orientation;

  iframe.remove();

  // The screen.orientation object will not be exposed once the
  // screen has become detached, but probe for it regardless to
  // verify that such post-detach use doesn't crash.
  oldOrient = oldScreen.orientation || oldOrient;

  oldOrient.unlock();
  document.location.hash = '#done';
}

</script>
<iframe src='detached-iframe.html'></iframe>
</body>
</html>