From e6f3eb14654323b66e908e8fb055ea5c8a1e1ef0 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 15 Jul 2003 07:01:16 +0000 Subject: [PATCH] Fix bug 212277. r=caillon, sr=darin --- content/html/content/src/nsGenericHTMLElement.cpp | 8 ++------ netwerk/base/src/nsSimpleURI.cpp | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 7b17b618d3ee..0c1ae7a56097 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -3069,8 +3069,8 @@ nsGenericHTMLElement::AttrToURI(nsIAtom* aAttrName, nsAString& aAbsoluteURI) { nsAutoString attrValue; nsresult rv = GetAttr(kNameSpaceID_None, aAttrName, attrValue); - if (rv == NS_CONTENT_ATTR_NOT_THERE) { - aAbsoluteURI.Truncate(); + if (rv != NS_CONTENT_ATTR_HAS_VALUE) { + SetDOMStringToNull(aAbsoluteURI); return NS_OK; } @@ -3087,10 +3087,6 @@ nsGenericHTMLElement::AttrToURI(nsIAtom* aAttrName, nsAString& aAbsoluteURI) attrValue, doc, baseURI); if (NS_FAILED(rv)) { - if (rv != NS_ERROR_MALFORMED_URI) { - return rv; - } - // Just use the attr value as the result... aAbsoluteURI = attrValue; return NS_OK; diff --git a/netwerk/base/src/nsSimpleURI.cpp b/netwerk/base/src/nsSimpleURI.cpp index 1f4d106f1900..519fdab45be9 100644 --- a/netwerk/base/src/nsSimpleURI.cpp +++ b/netwerk/base/src/nsSimpleURI.cpp @@ -50,6 +50,7 @@ #include "nsIObjectInputStream.h" #include "nsIObjectOutputStream.h" #include "nsEscape.h" +#include "nsNetError.h" static NS_DEFINE_CID(kThisSimpleURIImplementationCID, NS_THIS_SIMPLEURI_IMPLEMENTATION_CID); @@ -158,7 +159,7 @@ nsSimpleURI::SetSpec(const nsACString &aSpec) PRInt32 pos = spec.FindChar(':'); if (pos == -1) - return NS_ERROR_FAILURE; + return NS_ERROR_MALFORMED_URI; mScheme.Truncate(); mPath.Truncate();