Backed out changeset 76a96d6f0330 (bug 1001957) for mochitest-2 bustage on a CLOSED TREE

This commit is contained in:
Wes Kocher 2014-07-08 17:55:35 -07:00
parent 07061b97ea
commit 196c4d51c5
5 changed files with 19 additions and 129 deletions

View File

@ -2632,14 +2632,24 @@ function BrowserReloadWithFlags(reloadFlags) {
return;
}
let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
/* First, we'll try to use the session history object to reload so
* that framesets are handled properly. If we're in a special
* window (such as view-source) that has no session history, fall
* back on using the web navigation's reload method.
*/
gBrowser.selectedBrowser
.messageManager
.sendAsyncMessage("Browser:Reload",
{ flags: reloadFlags,
handlingUserInput: windowUtils.isHandlingUserInput });
var webNav = gBrowser.webNavigation;
try {
var sh = webNav.sessionHistory;
if (sh)
webNav = sh.QueryInterface(nsIWebNavigation);
} catch (e) {
}
try {
webNav.reload(reloadFlags);
} catch (e) {
}
}
var PrintPreviewListener = {

View File

@ -34,34 +34,6 @@ addMessageListener("Browser:HideSessionRestoreButton", function (message) {
}
});
addMessageListener("Browser:Reload", function(message) {
/* First, we'll try to use the session history object to reload so
* that framesets are handled properly. If we're in a special
* window (such as view-source) that has no session history, fall
* back on using the web navigation's reload method.
*/
let webNav = docShell.QueryInterface(Ci.nsIWebNavigation);
try {
let sh = webNav.sessionHistory;
if (sh)
webNav = sh.QueryInterface(Ci.nsIWebNavigation);
} catch (e) {
}
let reloadFlags = message.data.flags;
let handlingUserInput;
try {
handlingUserInput = content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)
.setHandlingUserInput(message.data.handlingUserInput);
webNav.reload(reloadFlags);
} catch (e) {
} finally {
handlingUserInput.destruct();
}
});
addEventListener("DOMFormHasPassword", function(event) {
InsecurePasswordUtils.checkForInsecurePasswords(event.target);
LoginManagerContent.onFormPassword(event);

View File

@ -173,13 +173,7 @@ function MixedTest6B() {
function MixedTest6C() {
gTestBrowser.removeEventListener("load", MixedTest6C, true);
waitForCondition(function() {
try {
return content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello";
} catch (e) {
return false;
}
}, MixedTest6D, "Waited too long for mixed script to run in Test 6");
waitForCondition(function() content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello", MixedTest6D, "Waited too long for mixed script to run in Test 6");
}
function MixedTest6D() {
ok(content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello","Mixed script didn't load in Test 6");

View File

@ -1,5 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sts=2 sw=2 et tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -3588,74 +3587,6 @@ nsDOMWindowUtils::GetOMTAStyle(nsIDOMElement* aElement,
return NS_OK;
}
namespace {
class HandlingUserInputHelper MOZ_FINAL : public nsIJSRAIIHelper
{
public:
HandlingUserInputHelper(bool aHandlingUserInput);
NS_DECL_ISUPPORTS
NS_DECL_NSIJSRAIIHELPER
private:
~HandlingUserInputHelper();
bool mHandlingUserInput;
bool mDestructCalled;
};
NS_IMPL_ISUPPORTS(HandlingUserInputHelper, nsIJSRAIIHelper)
HandlingUserInputHelper::HandlingUserInputHelper(bool aHandlingUserInput)
: mHandlingUserInput(aHandlingUserInput),
mDestructCalled(false)
{
if (aHandlingUserInput) {
EventStateManager::StartHandlingUserInput();
}
}
HandlingUserInputHelper::~HandlingUserInputHelper()
{
// We assert, but just in case, make sure we notify the ESM.
MOZ_ASSERT(mDestructCalled);
if (!mDestructCalled) {
Destruct();
}
}
NS_IMETHODIMP
HandlingUserInputHelper::Destruct()
{
if (NS_WARN_IF(mDestructCalled)) {
return NS_ERROR_FAILURE;
}
mDestructCalled = true;
if (mHandlingUserInput) {
EventStateManager::StopHandlingUserInput();
}
return NS_OK;
}
}
NS_IMETHODIMP
nsDOMWindowUtils::SetHandlingUserInput(bool aHandlingUserInput,
nsIJSRAIIHelper** aHelper)
{
if (!nsContentUtils::IsCallerChrome()) {
return NS_ERROR_DOM_SECURITY_ERR;
}
nsRefPtr<HandlingUserInputHelper> helper(
new HandlingUserInputHelper(aHandlingUserInput));
helper.forget(aHelper);
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetContentAPZTestData(JSContext* aContext,
JS::MutableHandleValue aOutContentTestData)

View File

@ -47,9 +47,8 @@ interface nsIDOMEventTarget;
interface nsIRunnable;
interface nsICompositionStringSynthesizer;
interface nsITranslationNodeList;
interface nsIJSRAIIHelper;
[scriptable, uuid(e156a9f5-d0e3-4a2f-a4a8-19c648d5ecb9)]
[scriptable, uuid(46e3f206-9a8f-4d66-8248-7ec6a37de45a)]
interface nsIDOMWindowUtils : nsISupports {
/**
@ -1639,13 +1638,6 @@ interface nsIDOMWindowUtils : nsISupports {
*/
AString getOMTAStyle(in nsIDOMElement aElement, in AString aProperty);
/**
* If we are currently handling user input, this informs the event state
* manager. Remember to call destruct() on the return value!
* See also nsIDOMWindowUtils::isHandlingUserInput.
*/
nsIJSRAIIHelper setHandlingUserInput(in boolean aHandlingInput);
/**
* Get the content- and compositor-side APZ test data instances.
* The return values are of type APZTestData (see APZTestData.webidl).
@ -1682,12 +1674,3 @@ interface nsITranslationNodeList : nsISupports {
// which its parent is not a translation node.
boolean isTranslationRootAtIndex(in unsigned long index);
};
/**
* JS doesn't do RAII very well. We can use this interface to make remembering
* to destruct an object in a finally clause easier.
*/
[scriptable, uuid(52e5a996-d0a9-4efc-a6fa-24489c532b19)]
interface nsIJSRAIIHelper : nsISupports {
void destruct();
};