summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/obsolete/requirements-for-implementations/other-elements-attributes-and-apis/document-all.html
blob: 37a92bb09f41fe2cbcccc842967e56ede3abce26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<title>document.all</title>
<link rel="author" title="Corey Farwell" href="mailto:coreyf@rwell.org">
<link rel="help" href="https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function () {
  assert_false(Boolean(document.all));

  assert_true(document.all == undefined);
  assert_true(document.all == null);
  assert_false(document.all != undefined);
  assert_false(document.all != null);

  assert_true(document.all !== undefined);
  assert_true(document.all !== null);
  assert_false(document.all === undefined);
  assert_false(document.all === null);

  assert_equals(typeof document.all, "undefined");

  if (document.all) { assert_true(false); }

  if (!document.all) {}
  else { assert_true(false); }
}, "'unusual behaviors' of document.all")

test(function() {
  var all = document.all;

  assert_false(Boolean(all));

  assert_true(all == undefined);
  assert_true(all == null);
  assert_false(all != undefined);
  assert_false(all != null);

  assert_true(all !== undefined);
  assert_true(all !== null);
  assert_false(all === undefined);
  assert_false(all === null);

  assert_equals(typeof all, "undefined");

  if (all) { assert_true(false); }

  if (!all) {}
  else { assert_true(false); }
}, "'unusual behaviors' of document.all with assignment")
</script>