[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
eric at webkit.org
eric at webkit.org
Wed Jan 6 00:20:38 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 2e6ef4969f1e5ee6ce38ebc4b91f0d6e85bb04c3
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jan 5 01:12:20 2010 +0000
2010-01-04 Jay Campan <jcampan at google.com>
Reviewed by Darin Fisher
Adding more DOM API methods. They are needed for the upcoming
translate feature.
* public/WebElement.h:
* public/WebNode.h:
* src/WebElement.cpp:
(WebKit::WebElement::tagName):
(WebKit::WebElement::setAttribute):
* src/WebNode.cpp:
(WebKit::WebNode::setNodeValue):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52774 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 04be19c..c034f98 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-04 Jay Campan <jcampan at google.com>
+
+ Reviewed by Darin Fisher
+
+ Adding more DOM API methods. They are needed for the upcoming
+ translate feature.
+
+ * public/WebElement.h:
+ * public/WebNode.h:
+ * src/WebElement.cpp:
+ (WebKit::WebElement::tagName):
+ (WebKit::WebElement::setAttribute):
+ * src/WebNode.cpp:
+ (WebKit::WebNode::setNodeValue):
+
2010-01-03 Adam Barth <abarth at webkit.org>
Reviewed by Eric Seidel.
diff --git a/WebKit/chromium/public/WebElement.h b/WebKit/chromium/public/WebElement.h
index ac55593..c22c06d 100644
--- a/WebKit/chromium/public/WebElement.h
+++ b/WebKit/chromium/public/WebElement.h
@@ -39,7 +39,7 @@ namespace WTF { template <typename T> class PassRefPtr; }
#endif
namespace WebKit {
- // Provides readonly access to some properties of a DOM element node.
+ // Provides access to some properties of a DOM element node.
class WebElement : public WebNode {
public:
WebElement() : WebNode() { }
@@ -48,9 +48,11 @@ namespace WebKit {
WebElement& operator=(const WebElement& e) { WebNode::assign(e); return *this; }
void assign(const WebElement& e) { WebNode::assign(e); }
+ WEBKIT_API WebString tagName() const;
WEBKIT_API bool hasTagName(const WebString&) const;
WEBKIT_API bool hasAttribute(const WebString&) const;
WEBKIT_API WebString getAttribute(const WebString&) const;
+ WEBKIT_API bool setAttribute(const WebString& name, const WebString& value);
#if WEBKIT_IMPLEMENTATION
WebElement(const WTF::PassRefPtr<WebCore::Element>&);
diff --git a/WebKit/chromium/public/WebNode.h b/WebKit/chromium/public/WebNode.h
index dfbb0aa..b2555f1 100644
--- a/WebKit/chromium/public/WebNode.h
+++ b/WebKit/chromium/public/WebNode.h
@@ -44,7 +44,7 @@ class WebDocument;
class WebFrame;
class WebNodeList;
-// Provides readonly access to some properties of a DOM node.
+// Provides access to some properties of a DOM node.
class WebNode {
public:
virtual ~WebNode() { reset(); }
@@ -87,6 +87,7 @@ public:
WEBKIT_API WebNode parentNode() const;
WEBKIT_API WebString nodeName() const;
WEBKIT_API WebString nodeValue() const;
+ WEBKIT_API bool setNodeValue(const WebString&);
// Deprecated. Use document().frame() instead.
WEBKIT_API WebFrame* frame() const;
WEBKIT_API WebDocument document() const;
diff --git a/WebKit/chromium/src/WebElement.cpp b/WebKit/chromium/src/WebElement.cpp
index 56980fe..646f12a 100644
--- a/WebKit/chromium/src/WebElement.cpp
+++ b/WebKit/chromium/src/WebElement.cpp
@@ -54,6 +54,11 @@ WebElement::operator WTF::PassRefPtr<Element>() const
return PassRefPtr<Element>(static_cast<Element*>(m_private));
}
+WebString WebElement::tagName() const
+{
+ return constUnwrap<Element>()->tagName();
+}
+
bool WebElement::hasTagName(const WebString& tagName) const
{
return equalIgnoringCase(constUnwrap<Element>()->tagName(),
@@ -70,5 +75,12 @@ WebString WebElement::getAttribute(const WebString& attrName) const
return constUnwrap<Element>()->getAttribute(attrName);
}
+bool WebElement::setAttribute(const WebString& attrName, const WebString& attrValue)
+{
+ ExceptionCode exceptionCode = 0;
+ unwrap<Element>()->setAttribute(attrName, attrValue, exceptionCode);
+ return !exceptionCode;
+}
+
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebNode.cpp b/WebKit/chromium/src/WebNode.cpp
index 5dcd0c9..702823d 100644
--- a/WebKit/chromium/src/WebNode.cpp
+++ b/WebKit/chromium/src/WebNode.cpp
@@ -87,6 +87,13 @@ WebString WebNode::nodeValue() const
return m_private->nodeValue();
}
+bool WebNode::setNodeValue(const WebString& value)
+{
+ ExceptionCode exceptionCode = 0;
+ m_private->setNodeValue(value, exceptionCode);
+ return !exceptionCode;
+}
+
WebNode::WebNode(const PassRefPtr<Node>& node)
: m_private(static_cast<WebNodePrivate*>(node.releaseRef()))
{
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list