js/src/tests/js1_5/Regress/regress-246964.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 //-----------------------------------------------------------------------------
michael@0 7 var BUGNUMBER = 246964;
michael@0 8 // see also bug 248549, bug 253150, bug 259935
michael@0 9 var summary = 'undetectable document.all';
michael@0 10 var actual = '';
michael@0 11 var expect = '';
michael@0 12
michael@0 13 printBugNumber(BUGNUMBER);
michael@0 14 printStatus (summary);
michael@0 15
michael@0 16 if (typeof document == 'undefined')
michael@0 17 {
michael@0 18 expect = actual = 'Test requires browser: skipped';
michael@0 19 reportCompare(expect, actual, summary);
michael@0 20 }
michael@0 21 else
michael@0 22 {
michael@0 23 status = summary + ' ' + inSection(1) + ' if (document.all) ';
michael@0 24 expect = false;
michael@0 25 actual = false;
michael@0 26 if (document.all)
michael@0 27 {
michael@0 28 actual = true;
michael@0 29 }
michael@0 30 reportCompare(expect, actual, status);
michael@0 31
michael@0 32 status = summary + ' ' + inSection(2) + 'if (isIE) ';
michael@0 33 expect = false;
michael@0 34 actual = false;
michael@0 35 var isIE = document.all;
michael@0 36 if (isIE)
michael@0 37 {
michael@0 38 actual = true;
michael@0 39 }
michael@0 40 reportCompare(expect, actual, status);
michael@0 41
michael@0 42 status = summary + ' ' + inSection(3) + ' if (document.all != undefined) ';
michael@0 43 expect = false;
michael@0 44 actual = false;
michael@0 45 if (document.all != undefined)
michael@0 46 {
michael@0 47 actual = true;
michael@0 48 }
michael@0 49 reportCompare(expect, actual, status);
michael@0 50
michael@0 51
michael@0 52 status = summary + ' ' + inSection(4) + ' if (document.all !== undefined) ';
michael@0 53 expect = true;
michael@0 54 actual = false;
michael@0 55 if (document.all !== undefined)
michael@0 56 {
michael@0 57 actual = true;
michael@0 58 }
michael@0 59 reportCompare(expect, actual, status);
michael@0 60
michael@0 61 status = summary + ' ' + inSection(5) + ' if (document.all != null) ' ;
michael@0 62 expect = false;
michael@0 63 actual = false;
michael@0 64 if (document.all != null)
michael@0 65 {
michael@0 66 actual = true;
michael@0 67 }
michael@0 68 reportCompare(expect, actual, status);
michael@0 69
michael@0 70 status = summary + ' ' + inSection(6) + ' if (document.all !== null) ' ;
michael@0 71 expect = true;
michael@0 72 actual = false;
michael@0 73 if (document.all !== null)
michael@0 74 {
michael@0 75 actual = true;
michael@0 76 }
michael@0 77 reportCompare(expect, actual, status);
michael@0 78
michael@0 79 status = summary + ' ' + inSection(7) + ' if (document.all == null) ';
michael@0 80 expect = true;
michael@0 81 actual = false;
michael@0 82 if (document.all == null)
michael@0 83 {
michael@0 84 actual = true;
michael@0 85 }
michael@0 86 reportCompare(expect, actual, status);
michael@0 87
michael@0 88 status = summary + ' ' + inSection(8) + ' if (document.all === null) ';
michael@0 89 expect = false;
michael@0 90 actual = false;
michael@0 91 if (document.all === null)
michael@0 92 {
michael@0 93 actual = true;
michael@0 94 }
michael@0 95 reportCompare(expect, actual, status);
michael@0 96
michael@0 97 status = summary + ' ' + inSection(9) + ' if (document.all == undefined) ';
michael@0 98 expect = true;
michael@0 99 actual = false;
michael@0 100 if (document.all == undefined)
michael@0 101 {
michael@0 102 actual = true;
michael@0 103 }
michael@0 104 reportCompare(expect, actual, status);
michael@0 105
michael@0 106 status = summary + ' ' + inSection(10) + ' if (document.all === undefined) ';
michael@0 107 expect = false;
michael@0 108 actual = false;
michael@0 109 if (document.all === undefined)
michael@0 110 {
michael@0 111 actual = true;
michael@0 112 }
michael@0 113 reportCompare(expect, actual, status);
michael@0 114
michael@0 115 status = summary + ' ' + inSection(11) +
michael@0 116 ' if (typeof document.all == "undefined") ';
michael@0 117 expect = true;
michael@0 118 actual = false;
michael@0 119 if (typeof document.all == 'undefined')
michael@0 120 {
michael@0 121 actual = true;
michael@0 122 }
michael@0 123 reportCompare(expect, actual, status);
michael@0 124
michael@0 125 status = summary + ' ' + inSection(12) +
michael@0 126 ' if (typeof document.all != "undefined") ';
michael@0 127 expect = false;
michael@0 128 actual = false;
michael@0 129 if (typeof document.all != 'undefined')
michael@0 130 {
michael@0 131 actual = true;
michael@0 132 }
michael@0 133 reportCompare(expect, actual, status);
michael@0 134
michael@0 135 status = summary + ' ' + inSection(13) + ' if ("all" in document) ';
michael@0 136 expect = (document.compatMode == 'CSS1Compat') ? false : true;
michael@0 137 actual = false;
michael@0 138 if ('all' in document)
michael@0 139 {
michael@0 140 actual = true;
michael@0 141 }
michael@0 142 reportCompare(expect, actual, status);
michael@0 143
michael@0 144 status = summary + ' ' + inSection(14) + ' if (f.ie) ';
michael@0 145 var f = new foo();
michael@0 146
michael@0 147 expect = false;
michael@0 148 actual = false;
michael@0 149 if (f.ie)
michael@0 150 {
michael@0 151 actual = true;
michael@0 152 }
michael@0 153 reportCompare(expect, actual, status);
michael@0 154
michael@0 155 }
michael@0 156
michael@0 157 function foo()
michael@0 158 {
michael@0 159 this.ie = document.all;
michael@0 160 }

mercurial