summaryrefslogtreecommitdiffstats
path: root/dom/html/test/forms/test_form_attribute-3.html
blob: a8d4fabef5484180bbbecefabc03c9999a903393 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=588683
-->
<head>
  <title>Test for form attributes 3</title>
  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.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=588683">Mozilla Bug 588683</a>
<p id="display"></p>
<div id="content">
  <form id='f'>
    <input name='e1'>
  </form>
  <form id='f2'>
    <input name='e2'>
    <input id='i3' form='f'
     onfocus="var catched=false;
              try { e1; } catch(e) { catched=true; }
              ok(!catched, 'e1 should be in the scope of i3');
              catched = false;
              try { e2; } catch(e) { catched=true; }
              ok(catched, 'e2 should not be in the scope of i3');
              document.getElementById('i4').focus();"
    >
    <input id='i4' form='f2'
     onfocus="var catched=false;
              try { e2; } catch(e) { catched=true; }
              ok(!catched, 'e2 should be in the scope of i4');
              document.getElementById('i5').focus();"
    >
    <input id='i5'
     onfocus="var catched=false;
              try { e2; } catch(e) { catched=true; }
              ok(!catched, 'e2 should be in the scope of i5');
              document.getElementById('i6').focus();"
    >
  </form>
  <input id='i6' form='f'
   onfocus="var catched=false;
            try { e1; } catch(e) { catched=true; }
            ok(!catched, 'e1 should be in the scope of i6');
            document.getElementById('i7').focus();"
  >
  <input id='i7' form='f2'
   onfocus="var catched=false;
            try { e2; } catch(e) { catched=true; }
            ok(!catched, 'e2 should be in the scope of i7');
            this.blur();
            SimpleTest.finish();"
  >
</div>
<pre id="test">
<script type="application/javascript">

/** Test for form attributes 3 **/

SimpleTest.waitForExplicitFinish();

document.getElementById('i3').focus();

</script>
</pre>
</body>
</html>