diff options
author | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 00:58:12 +0000 |
---|---|---|
committer | cevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-16 00:58:12 +0000 |
commit | fe62fc852bd3c1c162ee1f41992096f59387dc31 (patch) | |
tree | e43e1aebf70bfc1f6e108eefe9221e434f061fb1 /third_party | |
parent | 81cdfcd5d551d8d581952a27ae968803ad856a39 (diff) | |
download | chromium_src-fe62fc852bd3c1c162ee1f41992096f59387dc31.zip chromium_src-fe62fc852bd3c1c162ee1f41992096f59387dc31.tar.gz chromium_src-fe62fc852bd3c1c162ee1f41992096f59387dc31.tar.bz2 |
Pull in XPath fix from upstream.
BUG=58731
TEST=NONE
Review URL: http://codereview.chromium.org/3839002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62828 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/libxml/README.chromium | 3 | ||||
-rw-r--r-- | third_party/libxml/src/xpath.c | 20 |
2 files changed, 19 insertions, 4 deletions
diff --git a/third_party/libxml/README.chromium b/third_party/libxml/README.chromium index b9fec1d..ba57fe8 100644 --- a/third_party/libxml/README.chromium +++ b/third_party/libxml/README.chromium @@ -8,6 +8,9 @@ See the files in that directory for discussion of their effects. Current version: 2.7.7. +Modifications: +- Import XPath fix http://git.gnome.org/browse/libxml2/commit/?id=91d19754d46acd4a639a8b9e31f50f31c78f8c9c + To import a new snapshot of libxml: - Visit http://xmlsoft.org/downloads.html and download the latest source diff --git a/third_party/libxml/src/xpath.c b/third_party/libxml/src/xpath.c index 8482c40..08c5bdf 100644 --- a/third_party/libxml/src/xpath.c +++ b/third_party/libxml/src/xpath.c @@ -8106,8 +8106,16 @@ xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { xmlNodePtr xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); - if (cur != NULL && cur->children != NULL) - return cur->children ; + 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)) + return(NULL); + if (cur->children != NULL) + return cur->children ; + } if (cur == NULL) cur = ctxt->context->node; if (cur == NULL) return(NULL) ; /* ERROR */ if (cur->next != NULL) return(cur->next) ; @@ -8162,6 +8170,9 @@ 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) cur = ctxt->context->node; if (cur == NULL) @@ -8203,12 +8214,13 @@ 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) - cur = (xmlNodePtr)((xmlNsPtr)cur)->next; ctxt->ancestor = cur->parent; } if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) |