5 function dispatchActivateEvent(target
) {
6 // Create a DOMActivate event and dispatch it
7 var event
= document
.createEvent('UIEvents');
8 event
.initUIEvent('DOMActivate', true, true, window
, 1)
9 target
.dispatchEvent(event
);
13 if (window
.testRunner
)
14 testRunner
.dumpAsText();
16 var button
= document
.getElementById('button');
17 var input
= document
.getElementById('input');
19 onsubmitCalled
= false;
21 dispatchActivateEvent(button
);
22 dispatchActivateEvent(input
);
25 document
.getElementById('result').innerHTML
= 'SUCCESS'
29 <body onload=
"runTest()">
30 <form onsubmit=
"onsubmitCalled = true; return false">
31 <button id=
"button" disabled
>Disabled button
</button>
32 <input id=
"input" type=
"submit" disabled
>
34 This tests that disabled form elements don't call submit when they receive a DOMActivate event. If this test is successful, the text
"SUCCESS" should be shown below.
35 <div id=
"result">FAILURE
</div>