Title: [114108] trunk/Source/WebKit/chromium
Revision
114108
Author
[email protected]
Date
2012-04-13 04:09:29 -0700 (Fri, 13 Apr 2012)

Log Message

[chromium] Add WebKit API to access <datalist> options
https://bugs.webkit.org/show_bug.cgi?id=83762

Introduce WebInputElement::dataListOptions so we can implement a UI for datalist.

Reviewed by Kent Tamura.

* public/WebInputElement.h:
(WebKit):
(WebInputElement):
* src/WebInputElement.cpp:
(WebKit::WebInputElement::dataListOptions): Added. Returns a WebNodeCollection containing WebOptionElements.

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (114107 => 114108)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-13 10:39:29 UTC (rev 114107)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-13 11:09:29 UTC (rev 114108)
@@ -1,3 +1,18 @@
+2012-04-13  Keishi Hattori  <[email protected]>
+
+        [chromium] Add WebKit API to access <datalist> options
+        https://bugs.webkit.org/show_bug.cgi?id=83762
+
+        Introduce WebInputElement::dataListOptions so we can implement a UI for datalist.
+
+        Reviewed by Kent Tamura.
+
+        * public/WebInputElement.h:
+        (WebKit):
+        (WebInputElement):
+        * src/WebInputElement.cpp:
+        (WebKit::WebInputElement::dataListOptions): Added. Returns a WebNodeCollection containing WebOptionElements.
+
 2012-04-13  Kent Tamura  <[email protected]>
 
         Add a runtime flag for <input type=date>

Modified: trunk/Source/WebKit/chromium/public/WebInputElement.h (114107 => 114108)


--- trunk/Source/WebKit/chromium/public/WebInputElement.h	2012-04-13 10:39:29 UTC (rev 114107)
+++ trunk/Source/WebKit/chromium/public/WebInputElement.h	2012-04-13 11:09:29 UTC (rev 114108)
@@ -39,6 +39,8 @@
 
 namespace WebKit {
 
+    class WebNodeCollection;
+
     // Provides readonly access to some properties of a DOM input element node.
     class WebInputElement : public WebFormControlElement {
     public:
@@ -84,6 +86,8 @@
         WEBKIT_EXPORT bool isValidValue(const WebString&) const;
         WEBKIT_EXPORT bool isChecked() const;
 
+        WEBKIT_EXPORT WebNodeCollection dataListOptions() const;
+
         WEBKIT_EXPORT bool isSpeechInputEnabled() const;
         WEBKIT_EXPORT SpeechInputState getSpeechInputState() const;
         WEBKIT_EXPORT void startSpeechInput();

Modified: trunk/Source/WebKit/chromium/public/WebNodeCollection.h (114107 => 114108)


--- trunk/Source/WebKit/chromium/public/WebNodeCollection.h	2012-04-13 10:39:29 UTC (rev 114107)
+++ trunk/Source/WebKit/chromium/public/WebNodeCollection.h	2012-04-13 11:09:29 UTC (rev 114108)
@@ -54,6 +54,8 @@
         return *this;
     }
 
+    bool isNull() const { return !m_private; }
+
     WEBKIT_EXPORT void reset();
     WEBKIT_EXPORT void assign(const WebNodeCollection&);
 

Modified: trunk/Source/WebKit/chromium/src/WebInputElement.cpp (114107 => 114108)


--- trunk/Source/WebKit/chromium/src/WebInputElement.cpp	2012-04-13 10:39:29 UTC (rev 114107)
+++ trunk/Source/WebKit/chromium/src/WebInputElement.cpp	2012-04-13 11:09:29 UTC (rev 114108)
@@ -31,9 +31,11 @@
 #include "config.h"
 #include "WebInputElement.h"
 
+#include "HTMLDataListElement.h"
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "TextControlInnerElements.h"
+#include "WebNodeCollection.h"
 #include "platform/WebString.h"
 #include <wtf/PassRefPtr.h>
 
@@ -151,6 +153,16 @@
     return constUnwrap<HTMLInputElement>()->checked();
 }
 
+WebNodeCollection WebInputElement::dataListOptions() const
+{
+#if ENABLE(DATALIST)
+    HTMLDataListElement* dataList = static_cast<HTMLDataListElement*>(constUnwrap<HTMLInputElement>()->list());
+    if (dataList)
+        return WebNodeCollection(dataList->options());
+#endif
+    return WebNodeCollection();
+}
+
 bool WebInputElement::isSpeechInputEnabled() const
 {
 #if ENABLE(INPUT_SPEECH)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to