Backed out 2 changesets (bug 1495363) for causing bug 1542912 a=backout
authorAndreea Pavel <apavel@mozilla.com>
Thu, 16 May 2019 14:43:59 +0300
changeset 474054 7aeb3ef01176fc25e7b51d6f32b4093661800084
parent 474053 aa58df721b0cb74590eb5fb1cffe081824c03ab1
child 474055 f01cf298b7fbe53caacc6942616af17b4da772f2
push id36022
push userncsoregi@mozilla.com
push dateThu, 16 May 2019 21:55:16 +0000
treeherdermozilla-central@96802be91766 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1495363, 1542912
milestone68.0a1
backs out1d6b361c337ad7b5b4fa016030f2f2aa84a76f83
7973453599bb4562c4a13b9a91027ac9724640ff
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1495363) for causing bug 1542912 a=backout Backed out changeset 1d6b361c337a (bug 1495363) Backed out changeset 7973453599bb (bug 1495363)
dom/html/test/forms/file_bug1495363.html
dom/html/test/forms/file_bug1495363.sjs
dom/html/test/forms/mochitest.ini
dom/html/test/forms/test_bug1495363.html
uriloader/base/nsDocLoader.cpp
deleted file mode 100644
--- a/dom/html/test/forms/file_bug1495363.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<form id="form" method="POST" action="file_bug1495363.sjs" enctype="multipart/form-data">
-  <input type="text" name="post" id="post" />
-  <input type="file" name="file" id="file" />
-  <input id="btn" type="submit" />
-</form>
-
-<script type="application/javascript">
-
-let p = new Promise(resolve => {
-  let url = SimpleTest.getTestFileURL("../../../../dom/filesystem/tests/script_fileList.js");
-  let script = SpecialPowers.loadChromeScript(url);
-
-  function onOpened(message) {
-    SpecialPowers.wrap(document.getElementById("file")).mozSetFileArray([message.file]);
-    resolve();
-  }
-
-  script.addMessageListener("file.opened", onOpened);
-  script.sendAsyncMessage("file.open");
-});
-
-p.then(() => {
-  let form = document.getElementById("form");
-  form.onsubmit = function() {
-    setTimeout(() => {
-      document.getElementById("post").value = "TIMEOUT";
-      form.submit();
-      parent.timeoutExpired();
-    }, 0);
-    parent.formSubmitted();
-    return true;
-  }
-
-  document.getElementById("post").value = "CLICK";
-  document.getElementById("btn").click();
-});
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/html/test/forms/file_bug1495363.sjs
+++ /dev/null
@@ -1,45 +0,0 @@
-const CC = Components.Constructor;
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
-                             "nsIBinaryInputStream",
-                             "setInputStream");
-
-function handleRequest(aRequest, aResponse) {
-  aResponse.setStatusLine(aRequest.httpVersion, 200);
-
-  // This returns number of requests received so far.
-  if (aRequest.queryString.includes("result")) {
-    let hints = getState("hints") || 0;
-    setState("hints", "0");
-
-    let submitter = getState("submitter");
-    setState("submitter", "");
-
-    aResponse.write(hints + "-" + submitter);
-    return;
-  }
-
-  // Here we count the number of requests and we store who was the last
-  // submitter.
-
-  let bodyStream = new BinaryInputStream(aRequest.bodyInputStream);
-  let requestBody = "";
-  while ((bodyAvail = bodyStream.available()) > 0) {
-    requestBody += bodyStream.readBytes(bodyAvail);
-  }
-
-  let lines = requestBody.split("\n");
-  let submitter = "";
-  for (let i = 0; i < lines.length; ++i) {
-    if (lines[i].trim() == 'Content-Disposition: form-data; name="post"') {
-      submitter = lines[i+2].trim();
-      break;
-    }
-  }
-
-  let hints = parseInt(getState("hints") || 0) + 1;
-  setState("hints", hints.toString());
-  setState("submitter", submitter);
-
-  aResponse.setHeader("Content-Type", "text/html", false);
-  aResponse.write("Hello World!");
-}
--- a/dom/html/test/forms/mochitest.ini
+++ b/dom/html/test/forms/mochitest.ini
@@ -114,14 +114,8 @@ skip-if = android_version == '18' || os 
 [test_stepup_stepdown.html]
 [test_textarea_attributes_reflection.html]
 [test_validation.html]
 [test_valueAsDate_pref.html]
 [test_valueasdate_attribute.html]
 [test_valueasnumber_attribute.html]
 [test_validation_not_in_doc.html]
 [test_reportValidation_preventDefault.html]
-[test_bug1495363.html]
-skip-if = (toolkit == 'android' && !is_fennec) || (webrender && os == "linux") # Bugs 1525959, 1520674
-support-files =
-  file_bug1495363.html
-  file_bug1495363.sjs
-  !/dom/filesystem/tests/script_fileList.js
deleted file mode 100644
--- a/dom/html/test/forms/test_bug1495363.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test for Bug 1495363</title>
-  <script src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<script type="application/javascript">
-
-let readyToCheck = 0;
-window.timeoutExpired = () => {
-  ok(true, "Timeout expired");
-  readyToCheck++;
-  maybeCheckResults();
-}
-
-window.formSubmitted = () => {
-  ok(true, "Form submited!");
-  ifr.addEventListener("load", () => {
-    readyToCheck++;
-    maybeCheckResults();
-  }, {once: true});
-}
-
-SimpleTest.waitForExplicitFinish();
-
-var ifr = document.createElement('iframe');
-ifr.src = "file_bug1495363.html";
-document.body.appendChild(ifr);
-
-function maybeCheckResults() {
-  ok(readyToCheck <= 2, "So far so good");
-  if (readyToCheck < 2) {
-    return;
-  }
-
-  SimpleTest.executeSoon(() => {
-    fetch("file_bug1495363.sjs?result").then(r => r.text()).then(text => {
-      let parts = text.split("-");
-      is(parts[0], "1", "We have 1 request only");
-      is(parts[1], "TIMEOUT", "The request comes from the timer");
-      SimpleTest.finish();
-    });
-  });
-}
-
-</script>
-</body>
-</html>
--- a/uriloader/base/nsDocLoader.cpp
+++ b/uriloader/base/nsDocLoader.cpp
@@ -398,22 +398,23 @@ nsDocLoader::OnStartRequest(nsIRequest* 
 
   //
   // Only fire a doStartDocumentLoad(...) if the document loader
   // has initiated a load...  Otherwise, this notification has
   // resulted from a request being added to the load group.
   //
   if (mIsLoadingDocument) {
     if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI) {
-      // If we have a document request channel, and this is not a redirect, we
-      // must abort it and replace it with the new one.
-      if (!(loadFlags & nsIChannel::LOAD_REPLACE) && mDocumentRequest) {
-        mDocumentRequest->Cancel(NS_ERROR_ABORT);
-        mDocumentRequest = nullptr;
-      }
+      //
+      // Make sure that the document channel is null at this point...
+      // (unless its been redirected)
+      //
+      NS_ASSERTION(
+          (loadFlags & nsIChannel::LOAD_REPLACE) || !(mDocumentRequest.get()),
+          "Overwriting an existing document channel!");
 
       // This request is associated with the entire document...
       mDocumentRequest = request;
       mLoadGroup->SetDefaultLoadRequest(request);
 
       // Only fire the start document load notification for the first
       // document URI...  Do not fire it again for redirections
       //