Loading dom/base/nsGlobalWindow.cpp +8 −29 Original line number Diff line number Diff line Loading @@ -2917,21 +2917,6 @@ nsGlobalWindow::UpdateParentTarget() mParentTarget = eventTarget; } bool nsGlobalWindow::GetIsTabModalPromptAllowed() { MOZ_ASSERT(IsOuterWindow()); bool allowTabModal = true; if (mDocShell) { nsCOMPtr<nsIContentViewer> cv; mDocShell->GetContentViewer(getter_AddRefs(cv)); cv->GetIsTabModalPromptAllowed(&allowTabModal); } return allowTabModal; } EventTarget* nsGlobalWindow::GetTargetForDOMEvent() { Loading Loading @@ -6166,10 +6151,6 @@ nsGlobalWindow::AlertOrConfirm(bool aAlert, nsAutoString final; nsContentUtils::StripNullChars(aMessage, final); // Check if we're being called at a point where we can't use tab-modal // prompts, because something doesn't want reentrancy. bool allowTabModal = GetIsTabModalPromptAllowed(); nsresult rv; nsCOMPtr<nsIPromptFactory> promptFac = do_GetService("@mozilla.org/prompter;1", &rv); Loading @@ -6185,9 +6166,10 @@ nsGlobalWindow::AlertOrConfirm(bool aAlert, return false; } nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt); if (promptBag) promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), allowTabModal); // Always allow tab modal prompts for alert and confirm. if (nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt)) { promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), true); } bool result = false; nsAutoSyncOperation sync(mDoc); Loading Loading @@ -6281,10 +6263,6 @@ nsGlobalWindow::Prompt(const nsAString& aMessage, const nsAString& aInitial, nsContentUtils::StripNullChars(aMessage, fixedMessage); nsContentUtils::StripNullChars(aInitial, fixedInitial); // Check if we're being called at a point where we can't use tab-modal // prompts, because something doesn't want reentrancy. bool allowTabModal = GetIsTabModalPromptAllowed(); nsresult rv; nsCOMPtr<nsIPromptFactory> promptFac = do_GetService("@mozilla.org/prompter;1", &rv); Loading @@ -6300,9 +6278,10 @@ nsGlobalWindow::Prompt(const nsAString& aMessage, const nsAString& aInitial, return; } nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt); if (promptBag) promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), allowTabModal); // Always allow tab modal prompts for prompt. if (nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt)) { promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), true); } // Pass in the default value, if any. char16_t *inoutValue = ToNewUnicode(fixedInitial); Loading dom/base/nsGlobalWindow.h +0 −3 Original line number Diff line number Diff line Loading @@ -1299,9 +1299,6 @@ protected: virtual void UpdateParentTarget(); // Outer windows only. bool GetIsTabModalPromptAllowed(); inline int32_t DOMMinTimeoutValue() const; nsresult CloneStorageEvent(const nsAString& aType, Loading toolkit/components/prompts/src/nsPrompter.js +2 −1 Original line number Diff line number Diff line Loading @@ -458,7 +458,8 @@ ModalPrompter.prototype = { allowTabModal : false, QueryInterface : XPCOMUtils.generateQI([Ci.nsIPrompt, Ci.nsIAuthPrompt, Ci.nsIAuthPrompt2, Ci.nsIWritablePropertyBag2]), Ci.nsIAuthPrompt2, Ci.nsIWritablePropertyBag2]), /* ---------- internal methods ---------- */ Loading Loading
dom/base/nsGlobalWindow.cpp +8 −29 Original line number Diff line number Diff line Loading @@ -2917,21 +2917,6 @@ nsGlobalWindow::UpdateParentTarget() mParentTarget = eventTarget; } bool nsGlobalWindow::GetIsTabModalPromptAllowed() { MOZ_ASSERT(IsOuterWindow()); bool allowTabModal = true; if (mDocShell) { nsCOMPtr<nsIContentViewer> cv; mDocShell->GetContentViewer(getter_AddRefs(cv)); cv->GetIsTabModalPromptAllowed(&allowTabModal); } return allowTabModal; } EventTarget* nsGlobalWindow::GetTargetForDOMEvent() { Loading Loading @@ -6166,10 +6151,6 @@ nsGlobalWindow::AlertOrConfirm(bool aAlert, nsAutoString final; nsContentUtils::StripNullChars(aMessage, final); // Check if we're being called at a point where we can't use tab-modal // prompts, because something doesn't want reentrancy. bool allowTabModal = GetIsTabModalPromptAllowed(); nsresult rv; nsCOMPtr<nsIPromptFactory> promptFac = do_GetService("@mozilla.org/prompter;1", &rv); Loading @@ -6185,9 +6166,10 @@ nsGlobalWindow::AlertOrConfirm(bool aAlert, return false; } nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt); if (promptBag) promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), allowTabModal); // Always allow tab modal prompts for alert and confirm. if (nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt)) { promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), true); } bool result = false; nsAutoSyncOperation sync(mDoc); Loading Loading @@ -6281,10 +6263,6 @@ nsGlobalWindow::Prompt(const nsAString& aMessage, const nsAString& aInitial, nsContentUtils::StripNullChars(aMessage, fixedMessage); nsContentUtils::StripNullChars(aInitial, fixedInitial); // Check if we're being called at a point where we can't use tab-modal // prompts, because something doesn't want reentrancy. bool allowTabModal = GetIsTabModalPromptAllowed(); nsresult rv; nsCOMPtr<nsIPromptFactory> promptFac = do_GetService("@mozilla.org/prompter;1", &rv); Loading @@ -6300,9 +6278,10 @@ nsGlobalWindow::Prompt(const nsAString& aMessage, const nsAString& aInitial, return; } nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt); if (promptBag) promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), allowTabModal); // Always allow tab modal prompts for prompt. if (nsCOMPtr<nsIWritablePropertyBag2> promptBag = do_QueryInterface(prompt)) { promptBag->SetPropertyAsBool(NS_LITERAL_STRING("allowTabModal"), true); } // Pass in the default value, if any. char16_t *inoutValue = ToNewUnicode(fixedInitial); Loading
dom/base/nsGlobalWindow.h +0 −3 Original line number Diff line number Diff line Loading @@ -1299,9 +1299,6 @@ protected: virtual void UpdateParentTarget(); // Outer windows only. bool GetIsTabModalPromptAllowed(); inline int32_t DOMMinTimeoutValue() const; nsresult CloneStorageEvent(const nsAString& aType, Loading
toolkit/components/prompts/src/nsPrompter.js +2 −1 Original line number Diff line number Diff line Loading @@ -458,7 +458,8 @@ ModalPrompter.prototype = { allowTabModal : false, QueryInterface : XPCOMUtils.generateQI([Ci.nsIPrompt, Ci.nsIAuthPrompt, Ci.nsIAuthPrompt2, Ci.nsIWritablePropertyBag2]), Ci.nsIAuthPrompt2, Ci.nsIWritablePropertyBag2]), /* ---------- internal methods ---------- */ Loading