From 907891133c11650ebaac37aae80ad6c7e00505d5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 10 Oct 2008 13:44:43 -0400 Subject: [PATCH] But 427779. Make the XML parser not bail out on invalid URI in . r+sr=sicking --- content/xml/document/src/nsXMLContentSink.cpp | 10 +++------- content/xml/document/src/nsXMLContentSink.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 7c8c945b251..5a8e315aaa3 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -631,7 +631,7 @@ nsXMLContentSink::CloseElement(nsIContent* aContent) } if (nodeInfo->Equals(nsGkAtoms::base, kNameSpaceID_XHTML) && - !mHasProcessedBase) { + !mHasProcessedBase) { // The first base wins rv = ProcessBASETag(aContent); mHasProcessedBase = PR_TRUE; @@ -783,13 +783,11 @@ nsXMLContentSink::ProcessStyleLink(nsIContent* aElement, return rv; } -nsresult +void nsXMLContentSink::ProcessBASETag(nsIContent* aContent) { NS_ASSERTION(aContent, "missing base-element"); - nsresult rv = NS_OK; - if (mDocument) { nsAutoString value; @@ -799,7 +797,7 @@ nsXMLContentSink::ProcessBASETag(nsIContent* aContent) if (aContent->GetAttr(kNameSpaceID_None, nsGkAtoms::href, value)) { nsCOMPtr baseURI; - rv = NS_NewURI(getter_AddRefs(baseURI), value); + nsresult rv = NS_NewURI(getter_AddRefs(baseURI), value); if (NS_SUCCEEDED(rv)) { rv = mDocument->SetBaseURI(baseURI); // The document checks if it is legal to set this base if (NS_SUCCEEDED(rv)) { @@ -808,8 +806,6 @@ nsXMLContentSink::ProcessBASETag(nsIContent* aContent) } } } - - return rv; } diff --git a/content/xml/document/src/nsXMLContentSink.h b/content/xml/document/src/nsXMLContentSink.h index 7e36bdefe6c..e1446de19cf 100644 --- a/content/xml/document/src/nsXMLContentSink.h +++ b/content/xml/document/src/nsXMLContentSink.h @@ -152,7 +152,7 @@ protected: void PopContent(); PRBool HaveNotifiedForCurrentContent() const; - nsresult ProcessBASETag(nsIContent* aContent); + void ProcessBASETag(nsIContent* aContent); nsresult FlushTags();