Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers

This change removes docshell's `mTouchEventsOverride` and replaces it
with a new `BrowsingContext` field `TouchEventsOverrideInternal`.
All uses of the old field have been replaced and an override should
now work under fission when there are cross-origin descendent frames.

Differential Revision: https://phabricator.services.mozilla.com/D96414
This commit is contained in:
Steven MacLeod
2020-11-10 15:57:30 +00:00
parent 968f2e5665
commit cc94eb3f9f
16 changed files with 123 additions and 102 deletions

View File

@@ -376,7 +376,6 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
mLoadType(0),
mFailedLoadType(0),
mJSRunToCompletionDepth(0),
mTouchEventsOverride(nsIDocShell::TOUCHEVENTS_OVERRIDE_NONE),
mMetaViewportOverride(nsIDocShell::META_VIEWPORT_OVERRIDE_NONE),
mCreatingDocument(false),
#ifdef DEBUG
@@ -2340,34 +2339,6 @@ nsDocShell::ClearCachedUserAgent() {
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetTouchEventsOverride(TouchEventsOverride* aTouchEventsOverride) {
*aTouchEventsOverride = mTouchEventsOverride;
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::SetTouchEventsOverride(TouchEventsOverride aTouchEventsOverride) {
// We don't have a way to verify this coming from Javascript, so this check is
// still needed.
if (!(aTouchEventsOverride == TOUCHEVENTS_OVERRIDE_NONE ||
aTouchEventsOverride == TOUCHEVENTS_OVERRIDE_ENABLED ||
aTouchEventsOverride == TOUCHEVENTS_OVERRIDE_DISABLED)) {
return NS_ERROR_INVALID_ARG;
}
mTouchEventsOverride = aTouchEventsOverride;
uint32_t childCount = mChildList.Length();
for (uint32_t i = 0; i < childCount; ++i) {
nsCOMPtr<nsIDocShell> childShell = do_QueryInterface(ChildAt(i));
if (childShell) {
childShell->SetTouchEventsOverride(aTouchEventsOverride);
}
}
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::GetMetaViewportOverride(
MetaViewportOverride* aMetaViewportOverride) {
@@ -2627,8 +2598,6 @@ nsresult nsDocShell::SetDocLoaderParent(nsDocLoader* aParent) {
SetAffectPrivateSessionLifetime(
parentAsDocShell->GetAffectPrivateSessionLifetime());
SetTouchEventsOverride(parentAsDocShell->GetTouchEventsOverride());
// We don't need to inherit metaViewportOverride, because the viewport
// is only relevant for the outermost nsDocShell, not for any iframes
// like this that might be embedded within it.