Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / submit-reset-nested-bubble.html
blobd2a251412eadb23084d37c1ff36c6392016a4294
1 <html>
2 <head>
3 <script>
4 function window_listener(evt)
6 var str = phaseString(evt.eventPhase);
7 log("window " + evt.type + " " + str);
10 function reg_listener(evt) {
11 var str = phaseString(evt.eventPhase);
12 log(evt.currentTarget.id + " " + evt.type + " " + str);
13 return false;
16 function phaseString(phase)
18 var str;
19 if (phase == 1)
20 str = "capture";
21 else if (phase == 2)
22 str = "target";
23 else if (phase == 3)
24 str = "bubble";
25 return str;
28 function test()
30 if (window.testRunner)
31 testRunner.dumpAsText();
33 window.addEventListener("submit", window_listener, true);
34 document.getElementById('outer_form').addEventListener("submit", reg_listener, true);
35 document.getElementById('inner_form').addEventListener("submit", reg_listener, true);
36 document.getElementById('div').addEventListener("submit", reg_listener, true);
38 window.addEventListener("submit", window_listener, false);
39 document.getElementById('outer_form').addEventListener("submit", reg_listener, false);
40 document.getElementById('inner_form').addEventListener("submit", reg_listener, false);
41 document.getElementById('div').addEventListener("submit", reg_listener, false);
43 window.addEventListener("reset", window_listener, true);
44 document.getElementById('outer_form').addEventListener("reset", reg_listener, true);
45 document.getElementById('inner_form').addEventListener("reset", reg_listener, true);
46 document.getElementById('div').addEventListener("reset", reg_listener, true);
48 window.addEventListener("reset", window_listener, false);
49 document.getElementById('outer_form').addEventListener("reset", reg_listener, false);
50 document.getElementById('inner_form').addEventListener("reset", reg_listener, false);
51 document.getElementById('div').addEventListener("reset", reg_listener, false);
53 document.getElementById('bt_reset').click();
56 function log(msg)
58 var res = document.getElementById('res');
59 res.innerHTML = res.innerHTML + msg + "<br>";
62 </script>
63 </head>
64 <body onload="test()">
65 This tests that we stop propagation when bubbling a submit or reset event to more than one form. This matches Firefox behavior<br>
66 This can only occur when misnested tags cause forms to be nested.<br>
67 <br>
68 You can manually test the submit event, but this automated test will only test the reset event.
69 <br><br>
70 <form id="outer_form">
71 <div id="div">
72 <table>
73 </form>
74 </table>
75 <form id="inner_form">
76 <input type=submit id="bt_submit" value="Submit"></input>
77 <input type=reset id="bt_reset" value="Reset"></input>
78 </form>
79 </div>
80 <div id="res"></div>
81 </body>
82 </html>