HTML 5: Support click() method on HTMLElement.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Feb 2012 18:51:53 +0000 (18:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 Feb 2012 18:51:53 +0000 (18:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=27880

Patch by Arko Saha <arko@motorola.com> on 2012-02-11
Reviewed by Timothy Hatcher.

Source/WebCore:

Test: fast/dom/click-method-on-html-element.html

* bindings/objc/PublicDOMInterfaces.h: Added click() method in DOMHTMLElement
with availability macro AVAILABLE_AFTER_WEBKIT_VERSION_5_1.
* html/HTMLButtonElement.idl: Moved click() method under LANGUAGE_OBJECTIVE_C.
* html/HTMLElement.idl: Added click() IDL method.
* html/HTMLInputElement.idl: Moved click() method under LANGUAGE_OBJECTIVE_C.

LayoutTests:

* fast/dom/click-method-on-html-element-expected.txt: Added.
* fast/dom/click-method-on-html-element.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107483 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dom/click-method-on-html-element-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/click-method-on-html-element.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/bindings/objc/PublicDOMInterfaces.h
Source/WebCore/html/HTMLButtonElement.idl
Source/WebCore/html/HTMLElement.idl
Source/WebCore/html/HTMLInputElement.idl

index a5eb5e28eee719bc70bb1fe84e5ff8cdf9f0a420..82e7b9a853d6cd40d960cd0f97898c6f2a8a4114 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-11   Arko Saha  <arko@motorola.com>
+
+        HTML 5: Support click() method on HTMLElement.
+        https://bugs.webkit.org/show_bug.cgi?id=27880
+
+        Reviewed by Timothy Hatcher.
+
+        * fast/dom/click-method-on-html-element-expected.txt: Added.
+        * fast/dom/click-method-on-html-element.html: Added.
+
 2012-02-11  Andreas Kling  <awesomekling@apple.com>
 
         Node.isEqualNode() compares attributes twice.
diff --git a/LayoutTests/fast/dom/click-method-on-html-element-expected.txt b/LayoutTests/fast/dom/click-method-on-html-element-expected.txt
new file mode 100644 (file)
index 0000000..3b25ca5
--- /dev/null
@@ -0,0 +1,134 @@
+The support of click() method on HTMLElement.
+
+Pass: Click event handler called for: a
+Pass: Click event handler called for: abbr
+Pass: Click event handler called for: acronym
+Pass: Click event handler called for: address
+Pass: Click event handler called for: applet
+Pass: Click event handler called for: area
+Pass: Click event handler called for: article
+Pass: Click event handler called for: aside
+Pass: Click event handler called for: audio
+Pass: Click event handler called for: b
+Pass: Click event handler called for: base
+Pass: Click event handler called for: basefont
+Pass: Click event handler called for: bdo
+Pass: Click event handler called for: bgsound
+Pass: Click event handler called for: big
+Pass: Click event handler called for: blockquote
+Pass: Click event handler called for: body
+Pass: Click event handler called for: br
+Pass: Click event handler called for: button
+Pass: Click event handler called for: canvas
+Pass: Click event handler called for: caption
+Pass: Click event handler called for: center
+Pass: Click event handler called for: cite
+Pass: Click event handler called for: code
+Pass: Click event handler called for: col
+Pass: Click event handler called for: colgroup
+Pass: Click event handler called for: command
+Pass: Click event handler called for: datalist
+Pass: Click event handler called for: dd
+Pass: Click event handler called for: del
+Pass: Click event handler called for: details
+Pass: Click event handler called for: dfn
+Pass: Click event handler called for: dir
+Pass: Click event handler called for: div
+Pass: Click event handler called for: dl
+Pass: Click event handler called for: dt
+Pass: Click event handler called for: em
+Pass: Click event handler called for: embed
+Pass: Click event handler called for: fieldset
+Pass: Click event handler called for: figcaption
+Pass: Click event handler called for: figure
+Pass: Click event handler called for: font
+Pass: Click event handler called for: footer
+Pass: Click event handler called for: form
+Pass: Click event handler called for: frame
+Pass: Click event handler called for: frameset
+Pass: Click event handler called for: h1
+Pass: Click event handler called for: h2
+Pass: Click event handler called for: h3
+Pass: Click event handler called for: h4
+Pass: Click event handler called for: h5
+Pass: Click event handler called for: h6
+Pass: Click event handler called for: head
+Pass: Click event handler called for: header
+Pass: Click event handler called for: hgroup
+Pass: Click event handler called for: hr
+Pass: Click event handler called for: html
+Pass: Click event handler called for: i
+Pass: Click event handler called for: iframe
+Pass: Click event handler called for: img
+Pass: Click event handler called for: input
+Pass: Click event handler called for: ins
+Pass: Click event handler called for: isindex
+Pass: Click event handler called for: kbd
+Pass: Click event handler called for: keygen
+Pass: Click event handler called for: label
+Pass: Click event handler called for: layer
+Pass: Click event handler called for: legend
+Pass: Click event handler called for: li
+Pass: Click event handler called for: link
+Pass: Click event handler called for: listing
+Pass: Click event handler called for: map
+Pass: Click event handler called for: mark
+Pass: Click event handler called for: marquee
+Pass: Click event handler called for: menu
+Pass: Click event handler called for: meta
+Pass: Click event handler called for: meter
+Pass: Click event handler called for: nav
+Pass: Click event handler called for: nobr
+Pass: Click event handler called for: noembed
+Pass: Click event handler called for: noframes
+Pass: Click event handler called for: nolayer
+Pass: Click event handler called for: noscript
+Pass: Click event handler called for: object
+Pass: Click event handler called for: ol
+Pass: Click event handler called for: optgroup
+Pass: Click event handler called for: option
+Pass: Click event handler called for: output
+Pass: Click event handler called for: p
+Pass: Click event handler called for: param
+Pass: Click event handler called for: plaintext
+Pass: Click event handler called for: pre
+Pass: Click event handler called for: progress
+Pass: Click event handler called for: q
+Pass: Click event handler called for: rp
+Pass: Click event handler called for: rt
+Pass: Click event handler called for: ruby
+Pass: Click event handler called for: s
+Pass: Click event handler called for: samp
+Pass: Click event handler called for: script
+Pass: Click event handler called for: section
+Pass: Click event handler called for: select
+Pass: Click event handler called for: small
+Pass: Click event handler called for: source
+Pass: Click event handler called for: span
+Pass: Click event handler called for: strike
+Pass: Click event handler called for: strong
+Pass: Click event handler called for: style
+Pass: Click event handler called for: sub
+Pass: Click event handler called for: summary
+Pass: Click event handler called for: sup
+Pass: Click event handler called for: table
+Pass: Click event handler called for: tbody
+Pass: Click event handler called for: td
+Pass: Click event handler called for: textarea
+Pass: Click event handler called for: tfoot
+Pass: Click event handler called for: th
+Pass: Click event handler called for: thead
+Pass: Click event handler called for: title
+Pass: Click event handler called for: tr
+Pass: Click event handler called for: track
+Pass: Click event handler called for: tt
+Pass: Click event handler called for: u
+Pass: Click event handler called for: ul
+Pass: Click event handler called for: var
+Pass: Click event handler called for: video
+Pass: Click event handler called for: wbr
+Pass: Click event handler called for: xmp
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/click-method-on-html-element.html b/LayoutTests/fast/dom/click-method-on-html-element.html
new file mode 100644 (file)
index 0000000..0f282aa
--- /dev/null
@@ -0,0 +1,40 @@
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p>The support of click() method on HTMLElement.</p>
+<div id="console"></div>
+<script>
+var success;
+function clickHandler(event) {
+    success = true;
+}
+
+function runTests(tagName) {
+    success = false;
+    var element = document.createElement(tagName);
+    element.addEventListener('click', clickHandler, false);
+
+    element.click();
+    if (success)
+        debug("Pass: Click event handler called for: " + tagName);
+    else
+        debug("Pass: Click event handler wasn't called for: " + tagName);
+}
+
+var tagNames = ["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdo","bgsound","big","blockquote",
+    "body","br","button","canvas","caption","center","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","dir","div","dl","dt",
+    "em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html",
+    "i","iframe","img","input","ins","isindex","kbd","keygen","label","layer","legend","li","link","listing","map","mark","marquee","menu","meta","meter","nav",
+    "nobr","noembed","noframes","nolayer","noscript","object","ol","optgroup","option","output","p","param","plaintext","pre","progress","q","rp","rt","ruby","s",
+    "samp","script","section","select","small","source","span","strike","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead",
+    "title","tr","track","tt","u","ul","var","video","wbr","xmp"];
+
+for (var i =0 ; i < tagNames.length; i++)
+    runTests(tagNames[i]);
+
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
index e09b79a1e6079e5decba0d99534ab92a6a58d50a..6e75b1f3ce0d190a7ec2327d177e5409444c4100 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-11   Arko Saha  <arko@motorola.com>
+
+        HTML 5: Support click() method on HTMLElement.
+        https://bugs.webkit.org/show_bug.cgi?id=27880
+
+        Reviewed by Timothy Hatcher.
+
+        Test: fast/dom/click-method-on-html-element.html
+
+        * bindings/objc/PublicDOMInterfaces.h: Added click() method in DOMHTMLElement
+        with availability macro AVAILABLE_AFTER_WEBKIT_VERSION_5_1.
+        * html/HTMLButtonElement.idl: Moved click() method under LANGUAGE_OBJECTIVE_C.
+        * html/HTMLElement.idl: Added click() IDL method.
+        * html/HTMLInputElement.idl: Moved click() method under LANGUAGE_OBJECTIVE_C.
+
 2012-02-11  Martin Robinson  <mrobinson@igalia.com>
 
         [GStreamer] html5test.com says that gstreamer ports do not support WebM for audio
index b12279bab72c09817df4017e0b183a5ebe9247a4..1239971beaf3a4016970b65b56b2ab5f70905b2e 100644 (file)
 @property(readonly) BOOL isContentEditable;
 @property(readonly, copy) NSString *titleDisplayString AVAILABLE_WEBKIT_VERSION_3_0_AND_LATER;
 @property int tabIndex;
+- (void)click AVAILABLE_AFTER_WEBKIT_VERSION_5_1;
 @end
 
 @interface DOMHTMLEmbedElement : DOMHTMLElement WEBKIT_VERSION_1_3
index 9c2b222de79fcff642ade8b80581c72f38913b2c..b9eafb0d5e66b0941b18256eb3de07b1fa6ec539 100644 (file)
@@ -44,7 +44,9 @@ module html {
         boolean checkValidity();
         void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
 
+#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
         void click();
+#endif
 
         readonly attribute NodeList labels;
     };
index 072b291e79e584113a5b7da5f935c1c67cd26348..4d266b72fe2bce0b22f377bce1164657dbd99560 100644 (file)
@@ -88,6 +88,8 @@ module html {
 #if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
         readonly attribute DOMString titleDisplayString;
 #endif
+
+        void click();
     };
 
 }
index 1f3b60e502d897f542251de034fca112455e2db0..84beb8ac512fdc4db88d8df82f9ad3feb67628d9 100644 (file)
@@ -75,7 +75,10 @@ module html {
         boolean checkValidity();
         void setCustomValidity(in [TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error);
         void select();
+
+#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
         void click();
+#endif
 
 #if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
         void setValueForUser(in [TreatNullAs=NullString] DOMString value);