diff options
author | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 22:06:33 +0000 |
---|---|---|
committer | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 22:06:33 +0000 |
commit | a44b00c88bc5ea35b5b150217c5fd6e4ce168e58 (patch) | |
tree | 091e6baa934b5d40886c94e7b17c778f51e15102 /third_party/libxml | |
parent | eef2c2ed6ea089b49c0f6468154d5a4d524abaeb (diff) | |
download | chromium_src-a44b00c88bc5ea35b5b150217c5fd6e4ce168e58.zip chromium_src-a44b00c88bc5ea35b5b150217c5fd6e4ce168e58.tar.gz chromium_src-a44b00c88bc5ea35b5b150217c5fd6e4ce168e58.tar.bz2 |
Apply behaviour change fix from upstream for previous XPath change.
BUG=58731
TEST=NONE
Review URL: http://codereview.chromium.org/4027006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63572 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libxml')
-rw-r--r-- | third_party/libxml/README.chromium | 1 | ||||
-rw-r--r-- | third_party/libxml/src/xpath.c | 33 |
2 files changed, 18 insertions, 16 deletions
diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium index ba57fe8..832678a 100644 --- a/third_party/libxml/README.chromium +++ b/third_party/libxml/README.chromium @@ -10,6 +10,7 @@ Current version: 2.7.7. Modifications: - Import XPath fix http://git.gnome.org/browse/libxml2/commit/?id=91d19754d46acd4a639a8b9e31f50f31c78f8c9c +- Import follow-on for above commit: http://git.gnome.org/browse/libxml2/commit/?id=ea90b894146030c214a7df6d8375310174f134b9 To import a new snapshot of libxml: diff --git a/third_party/libxml/src/xpath.c b/third_party/libxml/src/xpath.c index 08c5bdf..5d3474e 100644 --- a/third_party/libxml/src/xpath.c +++ b/third_party/libxml/src/xpath.c @@ -8106,17 +8106,17 @@ xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { xmlNodePtr xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); - if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) || - (ctxt->context->node->type == XML_NAMESPACE_DECL)) - return(NULL); - if (cur != NULL) { - if ((cur->type == XML_ATTRIBUTE_NODE) || - (cur->type == XML_NAMESPACE_DECL)) + if ((cur != NULL) && (cur->type != XML_ATTRIBUTE_NODE) && + (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL)) + return(cur->children); + + if (cur == NULL) { + cur = ctxt->context->node; + if (cur->type == XML_NAMESPACE_DECL) return(NULL); - if (cur->children != NULL) - return cur->children ; + if (cur->type == XML_ATTRIBUTE_NODE) + cur = cur->parent; } - if (cur == NULL) cur = ctxt->context->node; if (cur == NULL) return(NULL) ; /* ERROR */ if (cur->next != NULL) return(cur->next) ; do { @@ -8170,11 +8170,13 @@ xmlNodePtr xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); - if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) || - (ctxt->context->node->type == XML_NAMESPACE_DECL)) - return(NULL); - if (cur == NULL) + if (cur == NULL) { cur = ctxt->context->node; + if (cur->type == XML_NAMESPACE_DECL) + return(NULL); + if (cur->type == XML_ATTRIBUTE_NODE) + return(cur->parent); + } if (cur == NULL) return (NULL); if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) @@ -8214,13 +8216,12 @@ xmlXPathNextPrecedingInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); - if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) || - (ctxt->context->node->type == XML_NAMESPACE_DECL)) - return(NULL); if (cur == NULL) { cur = ctxt->context->node; if (cur == NULL) return (NULL); + if (cur->type == XML_NAMESPACE_DECL) + return (NULL); ctxt->ancestor = cur->parent; } if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) |