mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1697927 - Part 1: Only expose HadOriginalOpener on BrowsingContext, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D108860
This commit is contained in:
parent
b2e94b592b
commit
27ff2d45df
@ -4822,7 +4822,7 @@ bool nsGlobalWindowOuter::CanMoveResizeWindows(CallerType aCallerType) {
|
||||
if (aCallerType != CallerType::System) {
|
||||
// Don't allow scripts to move or resize windows that were not opened by a
|
||||
// script.
|
||||
if (!HadOriginalOpener()) {
|
||||
if (!mBrowsingContext->HadOriginalOpener()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -6158,8 +6158,9 @@ void nsGlobalWindowOuter::CloseOuter(bool aTrustedCaller) {
|
||||
nsresult rv = mDoc->GetURL(url);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
|
||||
if (!StringBeginsWith(url, u"about:neterror"_ns) && !HadOriginalOpener() &&
|
||||
!aTrustedCaller && !IsOnlyTopLevelDocumentInSHistory()) {
|
||||
if (!StringBeginsWith(url, u"about:neterror"_ns) &&
|
||||
!mBrowsingContext->HadOriginalOpener() && !aTrustedCaller &&
|
||||
!IsOnlyTopLevelDocumentInSHistory()) {
|
||||
bool allowClose =
|
||||
mAllowScriptsToClose ||
|
||||
Preferences::GetBool("dom.allow_scripts_to_close_windows", true);
|
||||
@ -7439,10 +7440,6 @@ int16_t nsGlobalWindowOuter::Orientation(CallerType aCallerType) const {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool nsPIDOMWindowOuter::HadOriginalOpener() const {
|
||||
return nsGlobalWindowOuter::Cast(this)->HadOriginalOpener();
|
||||
}
|
||||
|
||||
#if defined(_WINDOWS_) && !defined(MOZ_WRAPPED_WINDOWS_H)
|
||||
# pragma message( \
|
||||
"wrapper failure reason: " MOZ_WINDOWS_WRAPPER_DISABLED_REASON)
|
||||
|
@ -458,10 +458,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
|
||||
|
||||
bool IsCleanedUp() const { return mCleanedUp; }
|
||||
|
||||
bool HadOriginalOpener() const {
|
||||
return GetBrowsingContext()->HadOriginalOpener();
|
||||
}
|
||||
|
||||
virtual void FirePopupBlockedEvent(
|
||||
Document* aDoc, nsIURI* aPopupURI, const nsAString& aPopupWindowName,
|
||||
const nsAString& aPopupWindowFeatures) override;
|
||||
|
@ -789,8 +789,6 @@ class nsPIDOMWindowOuter : public mozIDOMWindowProxy {
|
||||
|
||||
float GetDevicePixelRatio(mozilla::dom::CallerType aCallerType);
|
||||
|
||||
bool HadOriginalOpener() const;
|
||||
|
||||
virtual nsPIDOMWindowOuter* GetPrivateRoot() = 0;
|
||||
|
||||
/**
|
||||
|
@ -283,7 +283,7 @@ nsresult ClientSource::WindowExecutionReady(nsPIDOMWindowInner* aInnerWindow) {
|
||||
FrameType frameType = FrameType::Top_level;
|
||||
if (!outer->GetBrowsingContext()->IsTop()) {
|
||||
frameType = FrameType::Nested;
|
||||
} else if (outer->HadOriginalOpener()) {
|
||||
} else if (outer->GetBrowsingContext()->HadOriginalOpener()) {
|
||||
frameType = FrameType::Auxiliary;
|
||||
}
|
||||
|
||||
@ -325,7 +325,7 @@ nsresult ClientSource::DocShellExecutionReady(nsIDocShell* aDocShell) {
|
||||
FrameType frameType = FrameType::Top_level;
|
||||
if (!outer->GetBrowsingContext()->IsTop()) {
|
||||
frameType = FrameType::Nested;
|
||||
} else if (outer->HadOriginalOpener()) {
|
||||
} else if (outer->GetBrowsingContext()->HadOriginalOpener()) {
|
||||
frameType = FrameType::Auxiliary;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user