1 <p>This test checks for a particular problem in WebKit internals where adding the same function
2 first as a non-HTML and then as an HTML event listener could leave the "is HTML" flag set wrong.</p>
4 <p>If the test succeeds, you should see the word SUCCESS below. Otherwise, you'll see the word FAILURE or nothing at all.</p>
8 <a href="javascript:void(document.getElementById('result').innerHTML = 'FAILURE')" id="anchor">test anchor - script clicks this automatically</a>
12 if (window.testRunner)
13 testRunner.dumpAsText();
15 function listener(event)
17 document.getElementById('result').innerHTML = 'SUCCESS';
21 var anchor = document.getElementById("anchor");
23 anchor.addEventListener("click", listener, false);
24 anchor.onclick = listener;
26 var clickEvent = document.createEvent("MouseEvents");
27 clickEvent.initMouseEvent("click", true, true, null, 1, 1, 1, 1, 1, false, false, false, false, 0, document);
28 anchor.dispatchEvent(clickEvent);