Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1502)

Unified Diff: Source/core/xml/XPathStep.cpp

Issue 1254243002: Remove Node.localName and Node.namespaceURI (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix layout test failure Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/xml/XPathFunctions.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/XPathStep.cpp
diff --git a/Source/core/xml/XPathStep.cpp b/Source/core/xml/XPathStep.cpp
index 386c1f466d18c7b99ce678aacc183ff21ab499e2..22983a7fe9ff5b4e95947282e93b2b5de181d63b 100644
--- a/Source/core/xml/XPathStep.cpp
+++ b/Source/core/xml/XPathStep.cpp
@@ -186,17 +186,17 @@ static inline bool nodeMatchesBasicTest(Node* node, Step::Axis axis, const Step:
const AtomicString& namespaceURI = nodeTest.namespaceURI();
if (axis == Step::AttributeAxis) {
- ASSERT(node->isAttributeNode());
+ Attr* attr = toAttr(node);
// In XPath land, namespace nodes are not accessible on the
// attribute axis.
- if (node->namespaceURI() == XMLNSNames::xmlnsNamespaceURI)
+ if (attr->namespaceURI() == XMLNSNames::xmlnsNamespaceURI)
return false;
if (name == starAtom)
- return namespaceURI.isEmpty() || node->namespaceURI() == namespaceURI;
+ return namespaceURI.isEmpty() || attr->namespaceURI() == namespaceURI;
- return node->localName() == name && node->namespaceURI() == namespaceURI;
+ return attr->localName() == name && attr->namespaceURI() == namespaceURI;
}
// Node test on the namespace axis is not implemented yet, the caller
@@ -372,12 +372,12 @@ void Step::nodesInAxis(EvaluationContext& evaluationContext, Node* context, Node
// Avoid lazily creating attribute nodes for attributes that we do not
// need anyway.
if (nodeTest().kind() == NodeTest::NameTest && nodeTest().data() != starAtom) {
- RefPtrWillBeRawPtr<Node> n = contextElement->getAttributeNodeNS(nodeTest().namespaceURI(), nodeTest().data());
+ RefPtrWillBeRawPtr<Attr> attr = contextElement->getAttributeNodeNS(nodeTest().namespaceURI(), nodeTest().data());
// In XPath land, namespace nodes are not accessible on the attribute axis.
- if (n && n->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) {
+ if (attr && attr->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) {
// Still need to check merged predicates.
- if (nodeMatches(evaluationContext, n.get(), AttributeAxis, nodeTest()))
- nodes.append(n.release());
+ if (nodeMatches(evaluationContext, attr.get(), AttributeAxis, nodeTest()))
+ nodes.append(attr.release());
}
return;
}
« no previous file with comments | « Source/core/xml/XPathFunctions.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698