4 https://bugzilla.mozilla.org/show_bug.cgi?id=936056
8 <title>Test for Bug
936056</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
11 <script type=
"application/javascript">
13 /** Test for Bug
936056 **/
14 SimpleTest.waitForExplicitFinish();
15 window.onload = function() {
16 var desc = Object.getOwnPropertyDescriptor(frames[
0],
"document");
17 if (!desc || !desc.get) {
18 todo(false,
"This test does nothing so far, but will once Window is on WebIDL bindings");
23 ok(get,
"Couldn't find document getter");
24 Object.defineProperty(frames[
0],
"foo", { get, configurable: true });
26 var barewordFunc = frames[
0].eval(
"(function (count) { var doc; for (var i = 0; i < count; ++i) doc = foo; return doc.documentElement; })");
27 var qualifiedFunc = frames[
0].eval(
"(function (count) { var doc; for (var i = 0; i < count; ++i) doc = window.document; return doc.documentElement; })");
28 document.querySelector(
"iframe").onload = function() {
30 is(barewordFunc(
1).innerText,
"OLD",
"Bareword should see own inner 1");
31 is(qualifiedFunc(
1).innerText,
"NEW",
32 "Qualified should see current inner 1");
34 is(barewordFunc(
100).innerText,
"OLD",
"Bareword should see own inner 2");
35 is(qualifiedFunc(
100).innerText,
"NEW",
36 "Qualified should see current inner 2");
38 is(barewordFunc(
10000).innerText,
"OLD",
"Bareword should see own inner 3");
39 is(qualifiedFunc(
10000).innerText,
"NEW",
40 "Qualified should see current inner 2");
43 frames[
0].location =
"file_barewordGetsWindow_frame2.html";
52 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=936056">Mozilla Bug
936056</a>
54 <div id=
"content" style=
"display: none">
55 <iframe src=
"file_barewordGetsWindow_frame1.html"></iframe>