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