Bug 1005578 - Change nsIURI object from nsStandardURL to nsJSURI when calling url.href. r=bz, a=sledru
authorValentin Gosu <valentin.gosu@gmail.com>
Tue, 06 May 2014 17:14:04 -0400
changeset 192216 0c8b19312abf
parent 192215 56d4c53323c0
child 192217 ebad9b622f2e
push id3526
push userryanvm@gmail.com
push date2014-05-07 15:03 +0000
Treeherderresults
reviewersbz, sledru
bugs1005578
milestone30.0
Bug 1005578 - Change nsIURI object from nsStandardURL to nsJSURI when calling url.href. r=bz, a=sledru
dom/base/URL.cpp
--- a/dom/base/URL.cpp
+++ b/dom/base/URL.cpp
@@ -226,17 +226,17 @@ URL::SetHref(const nsAString& aHref, Err
   nsCOMPtr<nsIURI> uri;
   rv = ioService->NewURI(href, nullptr, nullptr, getter_AddRefs(uri));
   if (NS_FAILED(rv)) {
     nsAutoString label(aHref);
     aRv.ThrowTypeError(MSG_INVALID_URL, &label);
     return;
   }
 
-  aRv = mURI->SetSpec(href);
+  mURI = uri;
   UpdateURLSearchParams();
 }
 
 void
 URL::GetOrigin(nsString& aOrigin) const
 {
   nsContentUtils::GetUTFNonNullOrigin(mURI, aOrigin);
 }