[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
ap at apple.com
ap at apple.com
Wed Apr 7 23:17:48 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit e7a24f5082e1fbb753ddafdaff16e21deda3a96c
Author: ap at apple.com <ap at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 2 01:00:11 2009 +0000
Reviewed by Dan Bernstein.
https://bugs.webkit.org/show_bug.cgi?id=30992
Node.isDefaultNamespace doesn't convert empty strings to null
Test: fast/dom/Node/default-namespace-empty-argument.html
* dom/Node.cpp: (WebCore::Node::isDefaultNamespace): Per DOM 3 Core, treat empty input
as null.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 47ce1b2..3a18d1c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2009-11-01 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30992
+ Node.isDefaultNamespace doesn't convert empty strings to null
+
+ * fast/dom/Node/default-namespace-empty-argument-expected.txt: Added.
+ * fast/dom/Node/default-namespace-empty-argument.html: Added.
+
2009-11-01 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/dom/Node/default-namespace-empty-argument-expected.txt b/LayoutTests/fast/dom/Node/default-namespace-empty-argument-expected.txt
new file mode 100644
index 0000000..ef7b411
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/default-namespace-empty-argument-expected.txt
@@ -0,0 +1,5 @@
+Test for a bug 30992: Node.isDefaultNamespace doesn't convert empty strings to null.
+
+Should say PASS:
+
+PASS
diff --git a/LayoutTests/fast/dom/Node/default-namespace-empty-argument.html b/LayoutTests/fast/dom/Node/default-namespace-empty-argument.html
new file mode 100644
index 0000000..da915c1
--- /dev/null
+++ b/LayoutTests/fast/dom/Node/default-namespace-empty-argument.html
@@ -0,0 +1,8 @@
+<p>Test for a <href="https://bugs.webkit.org/show_bug.cgi?id=30992">bug 30992</a>: Node.isDefaultNamespace doesn't convert empty strings to null.</p>
+<p>Should say PASS:</p>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+document.write((document.implementation.createDocument(null, 'root', null).isDefaultNamespace('')) ? "PASS" : "FAIL");
+</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 579476b..6626d75 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-11-01 Alexey Proskuryakov <ap at apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30992
+ Node.isDefaultNamespace doesn't convert empty strings to null
+
+ Test: fast/dom/Node/default-namespace-empty-argument.html
+
+ * dom/Node.cpp: (WebCore::Node::isDefaultNamespace): Per DOM 3 Core, treat empty input
+ as null.
+
2009-11-01 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Darin Adler.
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 612bf18..df60884 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -1763,23 +1763,22 @@ bool Node::isEqualNode(Node *other) const
return true;
}
-bool Node::isDefaultNamespace(const AtomicString &namespaceURI) const
+bool Node::isDefaultNamespace(const AtomicString& namespaceURIMaybeEmpty) const
{
- // Implemented according to
- // http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html#isDefaultNamespaceAlgo
-
+ const AtomicString& namespaceURI = namespaceURIMaybeEmpty.isEmpty() ? nullAtom : namespaceURIMaybeEmpty;
+
switch (nodeType()) {
case ELEMENT_NODE: {
- const Element *elem = static_cast<const Element *>(this);
+ const Element* elem = static_cast<const Element*>(this);
if (elem->prefix().isNull())
return elem->namespaceURI() == namespaceURI;
if (elem->hasAttributes()) {
- NamedNodeMap *attrs = elem->attributes();
+ NamedNodeMap* attrs = elem->attributes();
for (unsigned i = 0; i < attrs->length(); i++) {
- Attribute *attr = attrs->attributeItem(i);
+ Attribute* attr = attrs->attributeItem(i);
if (attr->localName() == "xmlns")
return attr->value() == namespaceURI;
@@ -1801,7 +1800,7 @@ bool Node::isDefaultNamespace(const AtomicString &namespaceURI) const
case DOCUMENT_FRAGMENT_NODE:
return false;
case ATTRIBUTE_NODE: {
- const Attr *attr = static_cast<const Attr *>(this);
+ const Attr* attr = static_cast<const Attr*>(this);
if (attr->ownerElement())
return attr->ownerElement()->isDefaultNamespace(namespaceURI);
return false;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list