diff options
| author | Steve Block <steveblock@google.com> | 2009-12-17 09:55:06 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2009-12-17 09:55:06 -0800 |
| commit | b880d713c04257ca40abfef97c300afdead423b8 (patch) | |
| tree | 6982576c228bcd1a7efe98afed544d840751094c /WebCore/xml/XPathStep.cpp | |
| parent | e2e7a5c57b53f01e63a0245b4420d54b454cb373 (diff) | |
| parent | 643ca7872b450ea4efacab6188849e5aac2ba161 (diff) | |
| download | external_webkit-b880d713c04257ca40abfef97c300afdead423b8.zip external_webkit-b880d713c04257ca40abfef97c300afdead423b8.tar.gz external_webkit-b880d713c04257ca40abfef97c300afdead423b8.tar.bz2 | |
am 643ca787: Merge webkit.org at r51976 : Initial merge by git.
Merge commit '643ca7872b450ea4efacab6188849e5aac2ba161' into eclair-mr2-plus-aosp
* commit '643ca7872b450ea4efacab6188849e5aac2ba161':
Merge webkit.org at r51976 : Initial merge by git.
Diffstat (limited to 'WebCore/xml/XPathStep.cpp')
| -rw-r--r-- | WebCore/xml/XPathStep.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/WebCore/xml/XPathStep.cpp b/WebCore/xml/XPathStep.cpp index 411b616..e5f2048 100644 --- a/WebCore/xml/XPathStep.cpp +++ b/WebCore/xml/XPathStep.cpp @@ -193,9 +193,13 @@ static inline bool nodeMatchesBasicTest(Node* node, Step::Axis axis, const Step: if (name == starAtom) return namespaceURI.isEmpty() || namespaceURI == node->namespaceURI(); - if (node->isHTMLElement() && node->document()->isHTMLDocument()) { - // Paths without namespaces should match HTML elements in HTML documents despite those having an XHTML namespace. Names are compared case-insensitively. - return equalIgnoringCase(static_cast<Element*>(node)->localName(), name) && (namespaceURI.isNull() || namespaceURI == node->namespaceURI()); + if (node->document()->isHTMLDocument()) { + if (node->isHTMLElement()) { + // Paths without namespaces should match HTML elements in HTML documents despite those having an XHTML namespace. Names are compared case-insensitively. + return equalIgnoringCase(static_cast<Element*>(node)->localName(), name) && (namespaceURI.isNull() || namespaceURI == node->namespaceURI()); + } + // An expression without any prefix shouldn't match no-namespace nodes (because HTML5 says so). + return static_cast<Element*>(node)->hasLocalName(name) && namespaceURI == node->namespaceURI() && !namespaceURI.isNull(); } return static_cast<Element*>(node)->hasLocalName(name) && namespaceURI == node->namespaceURI(); } |
