Backed out changeset e3023975fdec (bug 1321719) for bustage. r=backout a=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 29 Dec 2016 10:39:12 +0100
changeset 349875 80e89a0b39c5c21de97eb9f1ad1c60fcdc618992
parent 349874 b662b0fdd2365ff926db5db7b59d8bb56d1ff36f
child 349876 bf6b75460a2544ee06f6331cb6ed0a0da32cddf1
push id10491
push userarchaeopteryx@coole-files.de
push dateThu, 29 Dec 2016 09:39:29 +0000
treeherdermozilla-aurora@80e89a0b39c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, backout
bugs1321719
milestone52.0a2
backs oute3023975fdec14510f7c7e6117f05f967add3fbf
Backed out changeset e3023975fdec (bug 1321719) for bustage. r=backout a=backout
dom/base/Location.cpp
dom/url/tests/mochitest.ini
dom/url/tests/test_bloburl_location.html
--- a/dom/base/Location.cpp
+++ b/dom/base/Location.cpp
@@ -576,17 +576,17 @@ Location::GetPathname(nsAString& aPathna
 {
   aPathname.Truncate();
 
   nsCOMPtr<nsIURI> uri;
   nsresult result = NS_OK;
 
   result = GetURI(getter_AddRefs(uri));
 
-  nsCOMPtr<nsIURIWithQuery> url(do_QueryInterface(uri));
+  nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
   if (url) {
     nsAutoCString file;
 
     result = url->GetFilePath(file);
 
     if (NS_SUCCEEDED(result)) {
       AppendUTF8toUTF16(file, aPathname);
     }
@@ -599,22 +599,22 @@ NS_IMETHODIMP
 Location::SetPathname(const nsAString& aPathname)
 {
   nsCOMPtr<nsIURI> uri;
   nsresult rv = GetWritableURI(getter_AddRefs(uri));
   if (NS_WARN_IF(NS_FAILED(rv) || !uri)) {
     return rv;
   }
 
-  nsCOMPtr<nsIURIWithQuery> url(do_QueryInterface(uri));
-  if (url && NS_SUCCEEDED(url->SetFilePath(NS_ConvertUTF16toUTF8(aPathname)))) {
-    return SetURI(uri);
+  rv = uri->SetPath(NS_ConvertUTF16toUTF8(aPathname));
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
   }
 
-  return NS_OK;
+  return SetURI(uri);
 }
 
 NS_IMETHODIMP
 Location::GetPort(nsAString& aPort)
 {
   aPort.SetLength(0);
 
   nsCOMPtr<nsIURI> uri;
--- a/dom/url/tests/mochitest.ini
+++ b/dom/url/tests/mochitest.ini
@@ -13,9 +13,8 @@ support-files =
 [test_urlSearchParams.html]
 [test_urlSearchParams_utf8.html]
 [test_urlutils_stringify.html]
 [test_worker_url.html]
 [test_worker_urlApi.html]
 [test_worker_url_exceptions.html]
 [test_worker_urlSearchParams.html]
 [test_unknown_url_origin.html]
-[test_bloburl_location.html]
deleted file mode 100644
--- a/dom/url/tests/test_bloburl_location.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Test for blobURL in location</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-  <script type="application/javascript">
-
-var expectedData = null;
-onmessage = function(e) {
-  if (expectedData === null) {
-    expectedData = e.data;
-  } else {
-    is(e.data, expectedData, "Pathname should be not be changed");
-    SimpleTest.finish();
-  }
-}
-
-var ifr = document.createElement('iframe');
-document.body.appendChild(ifr);
-
-ifr.src = "data:html,<script>location=URL.createObjectURL(new%20Blob(['<script>parent.postMessage(location.pathname,\"*\");location.pathname=\"foo\";parent.postMessage(location.pathname,\"*\");<\/s' +'cript>'], {type:\"text/html\"}));<\/script>";
-
-SimpleTest.waitForExplicitFinish();
-
-  </script>
-</body>
-</html>