[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 11:12:58 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 964e16d1d700db5719e78172fd0cf844f2c2d9fb
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jul 15 04:05:14 2010 +0000
2010-07-14 George Yakovlev <georgey at chromium.org>
Reviewed by Darin Fisher.
Allow Chromium access to Select control choices
https://bugs.webkit.org/show_bug.cgi?id=41384
* WebKit.gyp:
* public/WebOptionElement.h: Added.
(WebKit::WebOptionElement::WebOptionElement):
(WebKit::WebOptionElement::operator=):
(WebKit::WebOptionElement::assign):
* public/WebSelectElement.h:
* src/WebOptionElement.cpp: Added.
(WebKit::WebOptionElement::setValue):
(WebKit::WebOptionElement::value):
(WebKit::WebOptionElement::index):
(WebKit::WebOptionElement::text):
(WebKit::WebOptionElement::defaultSelected):
(WebKit::WebOptionElement::setDefaultSelected):
(WebKit::WebOptionElement::label):
(WebKit::WebOptionElement::disabled):
(WebKit::WebOptionElement::WebOptionElement):
(WebKit::WebOptionElement::operator=):
(WebKit::WebOptionElement::operator PassRefPtr<HTMLOptionElement>):
* src/WebSelectElement.cpp:
(WebKit::WebSelectElement::listItems):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 954d056..81807c2 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,31 @@
+2010-07-14 George Yakovlev <georgey at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Allow Chromium access to Select control choices
+ https://bugs.webkit.org/show_bug.cgi?id=41384
+
+ * WebKit.gyp:
+ * public/WebOptionElement.h: Added.
+ (WebKit::WebOptionElement::WebOptionElement):
+ (WebKit::WebOptionElement::operator=):
+ (WebKit::WebOptionElement::assign):
+ * public/WebSelectElement.h:
+ * src/WebOptionElement.cpp: Added.
+ (WebKit::WebOptionElement::setValue):
+ (WebKit::WebOptionElement::value):
+ (WebKit::WebOptionElement::index):
+ (WebKit::WebOptionElement::text):
+ (WebKit::WebOptionElement::defaultSelected):
+ (WebKit::WebOptionElement::setDefaultSelected):
+ (WebKit::WebOptionElement::label):
+ (WebKit::WebOptionElement::disabled):
+ (WebKit::WebOptionElement::WebOptionElement):
+ (WebKit::WebOptionElement::operator=):
+ (WebKit::WebOptionElement::operator PassRefPtr<HTMLOptionElement>):
+ * src/WebSelectElement.cpp:
+ (WebKit::WebSelectElement::listItems):
+
2010-07-14 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r63389.
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 7198f37..366c6d1 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -198,6 +198,7 @@
'public/WebNotification.h',
'public/WebNotificationPresenter.h',
'public/WebNotificationPermissionCallback.h',
+ 'public/WebOptionElement.h',
'public/WebPageSerializer.h',
'public/WebPageSerializerClient.h',
'public/WebPasswordAutocompleteListener.h',
@@ -421,6 +422,7 @@
'src/WebNodeCollection.cpp',
'src/WebNodeList.cpp',
'src/WebNotification.cpp',
+ 'src/WebOptionElement.cpp',
'src/WebPageSerializer.cpp',
'src/WebPageSerializerImpl.cpp',
'src/WebPageSerializerImpl.h',
diff --git a/WebKit/chromium/public/WebOptionElement.h b/WebKit/chromium/public/WebOptionElement.h
new file mode 100644
index 0000000..1689a57
--- /dev/null
+++ b/WebKit/chromium/public/WebOptionElement.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebOptionElement_h
+#define WebOptionElement_h
+
+#include "WebFormControlElement.h"
+#include "WebVector.h"
+
+#if WEBKIT_IMPLEMENTATION
+namespace WebCore { class HTMLOptionElement; }
+#endif
+
+namespace WebKit {
+
+// Provides readonly access to some properties of a DOM option element node.
+class WebOptionElement : public WebFormControlElement {
+public:
+ WebOptionElement() : WebFormControlElement() { }
+ WebOptionElement(const WebOptionElement& e) : WebFormControlElement(e) { }
+
+ WebOptionElement& operator=(const WebOptionElement& e)
+ {
+ WebFormControlElement::assign(e);
+ return *this;
+ }
+ WEBKIT_API void assign(const WebOptionElement& e) { WebFormControlElement::assign(e); }
+
+ WEBKIT_API void setValue(const WebString&);
+ WEBKIT_API WebString value() const;
+
+ WEBKIT_API int index() const;
+ WEBKIT_API WebString text() const;
+ WEBKIT_API bool defaultSelected() const;
+ WEBKIT_API void setDefaultSelected(bool);
+ WEBKIT_API WebString label() const;
+ WEBKIT_API bool isEnabled() const;
+
+#if WEBKIT_IMPLEMENTATION
+ WebOptionElement(const WTF::PassRefPtr<WebCore::HTMLOptionElement>&);
+ WebOptionElement& operator=(const WTF::PassRefPtr<WebCore::HTMLOptionElement>&);
+ operator WTF::PassRefPtr<WebCore::HTMLOptionElement>() const;
+#endif
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebSelectElement.h b/WebKit/chromium/public/WebSelectElement.h
index 7bd755b..3e7f5e2 100644
--- a/WebKit/chromium/public/WebSelectElement.h
+++ b/WebKit/chromium/public/WebSelectElement.h
@@ -32,6 +32,8 @@
#define WebSelectElement_h
#include "WebFormControlElement.h"
+#include "WebOptionElement.h"
+#include "WebVector.h"
#if WEBKIT_IMPLEMENTATION
namespace WebCore { class HTMLSelectElement; }
@@ -45,11 +47,16 @@ public:
WebSelectElement() : WebFormControlElement() { }
WebSelectElement(const WebSelectElement& e) : WebFormControlElement(e) { }
- WebSelectElement& operator=(const WebSelectElement& e) { WebFormControlElement::assign(e); return *this; }
+ WebSelectElement& operator=(const WebSelectElement& e)
+ {
+ WebFormControlElement::assign(e);
+ return *this;
+ }
WEBKIT_API void assign(const WebSelectElement& e) { WebFormControlElement::assign(e); }
WEBKIT_API void setValue(const WebString&);
WEBKIT_API WebString value();
+ WEBKIT_API WebVector<WebElement> listItems();
#if WEBKIT_IMPLEMENTATION
WebSelectElement(const WTF::PassRefPtr<WebCore::HTMLSelectElement>&);
diff --git a/WebKit/chromium/src/WebOptionElement.cpp b/WebKit/chromium/src/WebOptionElement.cpp
new file mode 100644
index 0000000..49bff3b
--- /dev/null
+++ b/WebKit/chromium/src/WebOptionElement.cpp
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebOptionElement.h"
+
+#include "HTMLNames.h"
+#include "HTMLOptionElement.h"
+#include "HTMLSelectElement.h"
+#include "WebString.h"
+#include <wtf/PassRefPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void WebOptionElement::setValue(const WebString& newValue)
+{
+ return unwrap<HTMLOptionElement>()->setValue(newValue);
+}
+
+WebString WebOptionElement::value() const
+{
+ return constUnwrap<HTMLOptionElement>()->value();
+}
+
+int WebOptionElement::index() const
+{
+ return constUnwrap<HTMLOptionElement>()->index();
+}
+
+WebString WebOptionElement::text() const
+{
+ return constUnwrap<HTMLOptionElement>()->text();
+}
+
+bool WebOptionElement::defaultSelected() const
+{
+ return constUnwrap<HTMLOptionElement>()->defaultSelected();
+}
+
+void WebOptionElement::setDefaultSelected(bool newSelected)
+{
+ return unwrap<HTMLOptionElement>()->setDefaultSelected(newSelected);
+}
+
+WebString WebOptionElement::label() const
+{
+ return constUnwrap<HTMLOptionElement>()->label();
+}
+
+bool WebOptionElement::isEnabled() const
+{
+ return !(constUnwrap<HTMLOptionElement>()->disabled());
+}
+
+WebOptionElement::WebOptionElement(const PassRefPtr<HTMLOptionElement>& elem)
+ : WebFormControlElement(elem)
+{
+}
+
+WebOptionElement& WebOptionElement::operator=(const PassRefPtr<HTMLOptionElement>& elem)
+{
+ m_private = elem;
+ return *this;
+}
+
+WebOptionElement::operator PassRefPtr<HTMLOptionElement>() const
+{
+ return static_cast<HTMLOptionElement*>(m_private.get());
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/WebSelectElement.cpp b/WebKit/chromium/src/WebSelectElement.cpp
index 6516cc3..79a4d85 100644
--- a/WebKit/chromium/src/WebSelectElement.cpp
+++ b/WebKit/chromium/src/WebSelectElement.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "WebSelectElement.h"
+#include "HTMLNames.h"
+#include "HTMLOptionElement.h"
#include "HTMLSelectElement.h"
#include "WebString.h"
#include <wtf/PassRefPtr.h>
@@ -49,6 +51,16 @@ WebString WebSelectElement::value()
return unwrap<HTMLSelectElement>()->value();
}
+WebVector<WebElement> WebSelectElement::listItems()
+{
+ const Vector<Element*>& sourceItems = unwrap<HTMLSelectElement>()->listItems();
+ WebVector<WebElement> items(sourceItems.size());
+ for (size_t i = 0; i < sourceItems.size(); ++i)
+ items[i] = WebElement(static_cast<HTMLElement*>(sourceItems[i]));
+
+ return items;
+}
+
WebSelectElement::WebSelectElement(const PassRefPtr<HTMLSelectElement>& elem)
: WebFormControlElement(elem)
{
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list