mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
bug 90053, fix for default namespace handling in NameTest. checkin for sicking@bigfoot.com, r=me,peterv, sr=jst
This commit is contained in:
parent
bef87ebf22
commit
c09d0f2ff5
@ -128,14 +128,16 @@ MBool AttributeExpr::matches(Node* node, Node* context, ContextState* cs) {
|
||||
Node* parent = cs->getParentNode(node);
|
||||
if (parent) XMLDOMUtils::getNameSpace(prefixForNode, (Element*)parent, nsForNode);
|
||||
String nsForTest;
|
||||
cs->getNameSpaceURIFromPrefix(this->prefix,nsForTest);
|
||||
if (prefix.length())
|
||||
cs->getNameSpaceURIFromPrefix(prefix, nsForTest);
|
||||
if (!nsForTest.isEqual(nsForNode)) return MB_FALSE;
|
||||
return localName.isEqual(this->name);
|
||||
}
|
||||
else {
|
||||
if (isNamespaceWild) return nodeName.isEqual(this->name);
|
||||
String nsForTest;
|
||||
cs->getNameSpaceURIFromPrefix(this->prefix, nsForTest);
|
||||
if (prefix.length())
|
||||
cs->getNameSpaceURIFromPrefix(prefix, nsForTest);
|
||||
if (nsForTest.length() > 0) return MB_FALSE;
|
||||
return nodeName.isEqual(this->name);
|
||||
}
|
||||
|
@ -111,7 +111,8 @@ MBool ElementExpr::matches(Node* node, Node* context, ContextState* cs) {
|
||||
//-- compare namespaces
|
||||
String nsURI;
|
||||
// use context to get namespace for testing against
|
||||
cs->getNameSpaceURIFromPrefix(this->prefix, nsURI);
|
||||
if (prefix.length())
|
||||
cs->getNameSpaceURIFromPrefix(prefix, nsURI);
|
||||
|
||||
String nsURI2;
|
||||
String prefix2;
|
||||
|
Loading…
x
Reference in New Issue
Block a user