Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / click-method-on-html-element.html
blobb7d556838eadb2485e2f8d863db9a465ceeffa81
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <p>The support of click() method on HTMLElement.</p>
7 <div id="console"></div>
8 <script>
9 var success;
10 function clickHandler(event) {
11 success = true;
14 function runTests(tagName) {
15 success = false;
16 var element = document.createElement(tagName);
17 element.addEventListener('click', clickHandler, false);
19 element.click();
20 if (success)
21 debug("Pass: Click event handler called for: " + tagName);
22 else
23 debug("Pass: Click event handler wasn't called for: " + tagName);
26 var tagNames = ["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdo","bgsound","big","blockquote",
27 "body","br","button","canvas","caption","center","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","dir","div","dl","dt",
28 "em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html",
29 "i","iframe","img","input","ins","isindex","kbd","keygen","label","layer","legend","li","link","listing","main","map","mark","marquee","menu","meta","meter","nav",
30 "nobr","noembed","noframes","nolayer","noscript","object","ol","optgroup","option","output","p","param","plaintext","pre","progress","q","rp","rt","ruby","s",
31 "samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead",
32 "title","tr","track","tt","u","ul","var","video","wbr","xmp"];
34 for (var i =0 ; i < tagNames.length; i++)
35 runTests(tagNames[i]);
37 </script>
38 </body>
39 </html>