mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
e25a776ebd
--HG-- extra : rebase_source : 0c81c1f605aaf73f01b47077be11345ee64955e1
63 lines
1.8 KiB
HTML
63 lines
1.8 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<!--
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=742448
|
|
-->
|
|
<head>
|
|
<title>Test for Bug 742448</title>
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
<script type="application/javascript" src="browserFrameHelpers.js"></script>
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
</head>
|
|
<body>
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=742448">Mozilla Bug 742448</a>
|
|
|
|
<!--
|
|
Test that <iframe mozbrowser>'s window.{top,parent,frameElement} methods are
|
|
not confused if we override window.top ourselves.
|
|
-->
|
|
|
|
<script type="application/javascript;version=1.7">
|
|
"use strict";
|
|
|
|
browserFrameHelpers.setEnabledPref(true);
|
|
browserFrameHelpers.addToWhitelist();
|
|
|
|
var iframe = document.createElement('iframe');
|
|
iframe.addEventListener('load', function() {
|
|
outerIframeLoaded();
|
|
});
|
|
iframe.mozbrowser = true;
|
|
iframe.src = 'data:text/html,Outer iframe';
|
|
document.body.appendChild(iframe);
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
function outerIframeLoaded() {
|
|
var innerIframe = iframe.contentDocument.createElement('iframe');
|
|
iframe.contentDocument.body.appendChild(innerIframe);
|
|
|
|
var iframeCw = iframe.contentWindow;
|
|
var innerCw = innerIframe.contentWindow;
|
|
|
|
// Override window.top in the parent iframe. This shouldn't confuse the
|
|
// inner one.
|
|
Object.defineProperty(iframe.contentWindow, 'top', {
|
|
get: function() { return 42; }
|
|
});
|
|
|
|
is(iframeCw.top, 42, 'iframe top');
|
|
is(iframeCw.parent, iframeCw, 'iframe parent');
|
|
is(iframeCw.frameElement, null, 'iframe frameElement');
|
|
|
|
is(innerCw.top, iframeCw, 'inner iframe top');
|
|
is(innerCw.parent, iframeCw, 'inner iframe parent');
|
|
is(innerCw.frameElement, innerIframe, 'inner iframe frameElement');
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|