[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r10312: Add a few more tests, minor
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r10312: Add a few more tests, minor corrections to XMLNode interface implementation |
Date: |
Thu, 20 Nov 2008 18:50:40 +0100 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 10312
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2008-11-20 18:50:40 +0100
message:
Add a few more tests, minor corrections to XMLNode interface implementation
and fix a silly typo in getNamespaceURI.
Add more characters to URL::escape.
modified:
libbase/URL.cpp
libcore/asobj/XMLNode_as.cpp
testsuite/actionscript.all/XMLNode.as
=== modified file 'libbase/URL.cpp'
--- a/libbase/URL.cpp 2008-11-18 17:50:10 +0000
+++ b/libbase/URL.cpp 2008-11-20 17:50:40 +0000
@@ -419,7 +419,7 @@
void
URL::encode(std::string& input)
{
- const std::string escapees = " \"#$%&+,/:;<=>address@hidden|}~_";
+ const std::string escapees = " \"#$%&+,/:;<=>address@hidden|}~_.!-(')";
const std::string hexdigits = "0123456789ABCDEF";
for (unsigned int i=0;i<input.length(); i++)
=== modified file 'libcore/asobj/XMLNode_as.cpp'
--- a/libcore/asobj/XMLNode_as.cpp 2008-11-19 08:41:47 +0000
+++ b/libcore/asobj/XMLNode_as.cpp 2008-11-20 17:50:40 +0000
@@ -528,6 +528,12 @@
// Read-only property
+ if (ptr->nodeName().empty()) {
+ as_value null;
+ null.set_null();
+ return null;
+ }
+
// Search recursively for a namespace. Return an empty string
// if none found.
XMLNode_as* node = ptr.get();
@@ -536,7 +542,7 @@
}
if (!node) return as_value("");
- return as_value(ptr->getNamespaceURI());
+ return as_value(node->getNamespaceURI());
}
@@ -550,6 +556,12 @@
// Read-only property
+ if (ptr->nodeName().empty()) {
+ as_value null;
+ null.set_null();
+ return null;
+ }
+
const std::string& nodeName = ptr->nodeName();
if (nodeName.empty()) return as_value("");
@@ -572,6 +584,12 @@
// Read-only property
+ if (ptr->nodeName().empty()) {
+ as_value null;
+ null.set_null();
+ return null;
+ }
+
const std::string& nodeName = ptr->nodeName();
if (nodeName.empty()) return as_value("");
=== modified file 'testsuite/actionscript.all/XMLNode.as'
--- a/testsuite/actionscript.all/XMLNode.as 2008-11-19 11:43:27 +0000
+++ b/testsuite/actionscript.all/XMLNode.as 2008-11-20 17:50:40 +0000
@@ -225,7 +225,7 @@
// Check namespace functions.
// Standard namespace
-x = new XML('<tag xmlns="standard" att="u"></tag>');
+x = new XML('<tag xmlns="standard" att="u">text</tag>');
ns = x.firstChild;
check_equals(ns.nodeName, "tag");
check_equals(ns.attributes["att"], "u");
@@ -239,6 +239,12 @@
check_equals(ns.namespaceURI, "standard");
xcheck_equals(ns.getNamespaceForPrefix(""), "standard2");
+ns = ns.firstChild;
+check_equals(ns.nodeName, null);
+check_equals(ns.nodeValue, "text");
+check_equals(ns.namespaceURI, null);
+check_equals(ns.prefix, null);
+
x = new XML('<tag xmlns:t="standard"></tag>');
ns = x.firstChild;
check_equals(ns.namespaceURI, "");
@@ -268,7 +274,7 @@
n = n.firstChild;
check_equals(n.nodeName, "tag3");
-xcheck_equals(n.namespaceURI, "nss");
+check_equals(n.namespaceURI, "nss");
check_equals(n.getNamespaceForPrefix(), undefined);
xcheck_equals(n.getNamespaceForPrefix("r"), "nsr");
xcheck_equals(n.getPrefixForNamespace("nsr"), "r");
@@ -351,4 +357,4 @@
check_equals(ns.localName, "tag");
check_equals(ns.prefix, "");
-check_totals(165);
+check_totals(169);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r10312: Add a few more tests, minor corrections to XMLNode interface implementation,
Benjamin Wolsey <=