зеркало из https://github.com/mozilla/gecko-dev.git
Bug 860941 - Stop clearing return values on navigation. r=jst
Since this stuff is a property on the browsing context, this only makes sense as a security check. But now that we're using a DialogValueHolder, the origin checks are taken care of. So we can kill this off.
This commit is contained in:
Родитель
ea304d6343
Коммит
3d0e47e04e
|
@ -11630,21 +11630,6 @@ nsGlobalModalWindow::SetReturnValue(nsIVariant *aRetVal)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
|
||||||
nsGlobalModalWindow::SetNewDocument(nsIDocument *aDocument,
|
|
||||||
nsISupports *aState,
|
|
||||||
bool aForceReuseInnerWindow)
|
|
||||||
{
|
|
||||||
MOZ_ASSERT(aDocument);
|
|
||||||
|
|
||||||
// If we're loading a new document into a modal dialog, clear the
|
|
||||||
// return value that was set, if any, by the current document.
|
|
||||||
mReturnValue = nullptr;
|
|
||||||
|
|
||||||
return nsGlobalWindow::SetNewDocument(aDocument, aState,
|
|
||||||
aForceReuseInnerWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
nsGlobalWindow::SetHasAudioAvailableEventListeners()
|
nsGlobalWindow::SetHasAudioAvailableEventListeners()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1332,10 +1332,6 @@ public:
|
||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsGlobalModalWindow, nsGlobalWindow)
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsGlobalModalWindow, nsGlobalWindow)
|
||||||
|
|
||||||
virtual NS_HIDDEN_(nsresult) SetNewDocument(nsIDocument *aDocument,
|
|
||||||
nsISupports *aState,
|
|
||||||
bool aForceReuseInnerWindow);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// For use by outer windows only.
|
// For use by outer windows only.
|
||||||
nsRefPtr<DialogValueHolder> mReturnValue;
|
nsRefPtr<DialogValueHolder> mReturnValue;
|
||||||
|
|
|
@ -27,7 +27,10 @@ function runTest() {
|
||||||
window.addEventListener("message", onMsgRcv, false);
|
window.addEventListener("message", onMsgRcv, false);
|
||||||
|
|
||||||
var result = window.showModalDialog("file_bug504862.html", "my args");
|
var result = window.showModalDialog("file_bug504862.html", "my args");
|
||||||
is(result, null, "window sees previous dialog documents return value.");
|
// NB: We used to clear returnValue on each navigation, but now we do a
|
||||||
|
// security check on access, so we can safely make returnValue live on
|
||||||
|
// the browsing context, per spec.
|
||||||
|
is(result, 3, "window sees previous dialog documents return value.");
|
||||||
|
|
||||||
result = window.showModalDialog("http://test1.example.com/tests/dom/tests/mochitest/bugs/file_bug504862.html", "my args");
|
result = window.showModalDialog("http://test1.example.com/tests/dom/tests/mochitest/bugs/file_bug504862.html", "my args");
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче