Bug 951245. Forwarding to outer should check for active document, not current inner, to handle document.open() cases. r=peterv

This commit is contained in:
Boris Zbarsky 2013-12-20 14:28:18 -05:00
Родитель 04abdddba3
Коммит 5704575923
1 изменённых файлов: 15 добавлений и 13 удалений

Просмотреть файл

@ -307,9 +307,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return err_rval; \
} \
@ -321,11 +321,13 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer) { \
NS_WARNING("No outer window available!"); \
errorresult.Throw(NS_ERROR_NOT_INITIALIZED); \
} else if (outer->GetCurrentInnerWindow() != this) { \
errorresult.Throw(NS_ERROR_XPC_SECURITY_MANAGER_VETO); \
if (!HasActiveDocument()) { \
if (!outer) { \
NS_WARNING("No outer window available!"); \
errorresult.Throw(NS_ERROR_NOT_INITIALIZED); \
} else { \
errorresult.Throw(NS_ERROR_XPC_SECURITY_MANAGER_VETO); \
} \
} else { \
return outer->method args; \
} \
@ -337,9 +339,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return; \
} \
@ -352,9 +354,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return err_rval; \
} \
@ -377,9 +379,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return err_rval; \
} \