<!DOCTYPE html>
<html>
<style>
    #bad {
        position: fixed;
        top: 0px;
        left: 0px;
        background-color: red;
        width: 100%;
        height: 100%;
    }

    #fixed-container {
        position: fixed;
        top: 0px;
        left: 0px;
        z-index: 0;
    }

    #fullscreenme {
        height: 400px;
        width: 400px;
        border: 0px;
    }
</style>
</head>
<script src="full-screen-test.js"></script>
<script>
    function doTest() {
        if (window.testRunner) {
            testRunner.dumpAsText(true);
            testRunner.waitUntilDone();
        }
        document.body.offsetTop;
        var fullscreen = document.getElementById('fullscreenme');

        var fullscreenChangeEvent = function(event) {
            if (window.testRunner)
                testRunner.notifyDone();
        };

        document.addEventListener('webkitfullscreenchange', fullscreenChangeEvent);
        document.addEventListener('keydown', function () {
            fullscreen.webkitRequestFullScreen();

        });
        if (window.eventSender)
            eventSender.keyDown('a');
    }
    if ("webkitRequestFullScreen" in Element.prototype)
        window.addEventListener("load", doTest, false);
</script>
<body>
    <!-- when full screening the iframe, bad should not be visible -->
    <div id="fixed-container">
        <iframe id="fullscreenme" src="resources/green.html"></iframe>
    </div>
    <div id="bad"></div>
</body>
</html>
