From 7c066883e6f6dcf2d9ab2163ce50c6fcbfce8a39 Mon Sep 17 00:00:00 2001 From: Stanca Serban Date: Thu, 18 Jul 2024 06:13:43 +0300 Subject: [PATCH] Backed out 12 changesets (bug 1831649) for causing multiple failures. Backed out changeset 501dc3134ae1 (bug 1831649) Backed out changeset 21235ab42839 (bug 1831649) Backed out changeset 279fdf36aac1 (bug 1831649) Backed out changeset 17fb50534fae (bug 1831649) Backed out changeset b2718b2f730d (bug 1831649) Backed out changeset a05aa1c75ece (bug 1831649) Backed out changeset becfb23cd6b4 (bug 1831649) Backed out changeset 2d0e7e662530 (bug 1831649) Backed out changeset 22538f7bdc88 (bug 1831649) Backed out changeset 4ddecb37950f (bug 1831649) Backed out changeset 1e6ed8b78e8f (bug 1831649) Backed out changeset 6e96a1a01c24 (bug 1831649) --- dom/base/Document.cpp | 38 --- dom/base/Document.h | 10 +- dom/base/InteractiveWidget.h | 19 -- dom/base/ViewportMetaData.cpp | 2 - dom/base/ViewportMetaData.h | 4 +- dom/base/moz.build | 1 - dom/ipc/BrowserChild.cpp | 18 -- dom/ipc/BrowserChild.h | 6 - dom/ipc/BrowserParent.cpp | 6 - dom/ipc/BrowserParent.h | 1 - dom/ipc/PBrowser.ipdl | 4 +- .../gtest/mvm/TestMobileViewportManager.cpp | 2 - layout/base/GeckoMVMContext.cpp | 3 - layout/base/GeckoMVMContext.h | 2 - layout/base/MVMContext.h | 5 - layout/base/MobileViewportManager.cpp | 113 +++----- layout/base/MobileViewportManager.h | 47 +-- layout/base/PresShell.cpp | 6 - layout/base/PresShell.h | 3 - layout/base/nsDocumentViewer.cpp | 6 - layout/base/nsLayoutUtils.cpp | 12 - layout/base/nsPresContext.cpp | 66 ++--- layout/base/nsPresContext.h | 8 +- layout/base/tests/mochitest.toml | 4 - .../base/tests/test_event_target_radius.html | 6 +- .../base/tests/test_interactive_widget.html | 273 ------------------ .../browser/engine/gecko/GeckoEngineView.kt | 8 - .../browser/engine/system/SystemEngineView.kt | 13 - .../components/concept/engine/EngineView.kt | 19 -- .../support/ktx/android/view/Activity.kt | 17 +- .../test/fakes/engine/FakeEngineView.kt | 13 +- .../consumer/geckoview-quick-start.rst | 9 - .../fenix/browser/BaseBrowserFragment.kt | 12 +- mobile/android/geckoview/api.txt | 5 - mobile/android/geckoview/build.gradle | 1 - .../org/mozilla/geckoview/GeckoDisplay.java | 45 --- .../org/mozilla/geckoview/GeckoSession.java | 22 -- .../java/org/mozilla/geckoview/GeckoView.java | 102 +------ .../mozilla/geckoview/doc-files/CHANGELOG.md | 7 +- .../test_runner/src/main/AndroidManifest.xml | 1 - view/nsView.cpp | 87 +++--- view/nsView.h | 9 - widget/android/nsWindow.cpp | 25 -- widget/android/nsWindow.h | 2 - widget/nsIWidgetListener.cpp | 1 - widget/nsIWidgetListener.h | 5 - xpcom/ds/StaticAtoms.py | 1 - 47 files changed, 132 insertions(+), 937 deletions(-) delete mode 100644 dom/base/InteractiveWidget.h delete mode 100644 layout/base/tests/test_interactive_widget.html diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index a913817953b7..31c304143739 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -194,7 +194,6 @@ #include "mozilla/dom/HTMLTextAreaElement.h" #include "mozilla/dom/ImageTracker.h" #include "mozilla/dom/InspectorUtils.h" -#include "mozilla/dom/InteractiveWidget.h" #include "mozilla/dom/Link.h" #include "mozilla/dom/MediaQueryList.h" #include "mozilla/dom/MediaSource.h" @@ -1433,7 +1432,6 @@ Document::Document(const char* aContentType) mHttpsOnlyStatus(nsILoadInfo::HTTPS_ONLY_UNINITIALIZED), mViewportType(Unknown), mViewportFit(ViewportFitType::Auto), - mInteractiveWidgetMode(InteractiveWidget::ResizesContent), mHeaderData(nullptr), mServoRestyleRootDirtyBits(0), mThrowOnDynamicMarkupInsertionCounter(0), @@ -10952,47 +10950,11 @@ ViewportMetaData Document::GetViewportMetaData() const { : ViewportMetaData(); } -static InteractiveWidget ParseInteractiveWidget( - const ViewportMetaData& aViewportMetaData) { - if (aViewportMetaData.mInteractiveWidgetMode.IsEmpty()) { - // The spec defines "use `resizes-visual` if no value specified", but here - // we use `resizes-content` for the backward compatibility now. - // We will change it in bug 1884807. - return InteractiveWidget::ResizesContent; - } - - if (aViewportMetaData.mInteractiveWidgetMode.EqualsIgnoreCase( - "resizes-visual")) { - return InteractiveWidget::ResizesVisual; - } - if (aViewportMetaData.mInteractiveWidgetMode.EqualsIgnoreCase( - "resizes-content")) { - return InteractiveWidget::ResizesContent; - } - if (aViewportMetaData.mInteractiveWidgetMode.EqualsIgnoreCase( - "overlays-content")) { - return InteractiveWidget::OverlaysContent; - } - // For the same reason above empty case, we use `resizes-content` here. - return InteractiveWidget::ResizesContent; -} - void Document::SetMetaViewportData(UniquePtr aData) { mLastModifiedViewportMetaData = std::move(aData); // Trigger recomputation of the nsViewportInfo the next time it's queried. mViewportType = Unknown; - // Parse interactive-widget here anyway. Normally we parse any data in the - // meta viewport tag in GetViewportInfo(), but GetViewportInfo() depends on - // the document state (e.g. display size, fullscreen, desktop-mode etc.) - // whereas interactive-widget is independent from the document state, it's - // necessary whatever the document state is. - dom::InteractiveWidget interactiveWidget = - ParseInteractiveWidget(*mLastModifiedViewportMetaData); - if (mInteractiveWidgetMode != interactiveWidget) { - mInteractiveWidgetMode = interactiveWidget; - } - AsyncEventDispatcher::RunDOMEventWhenSafe( *this, u"DOMMetaViewportFitChanged"_ns, CanBubble::eYes, ChromeOnlyDispatch::eYes); diff --git a/dom/base/Document.h b/dom/base/Document.h index c78a602f1b3f..a7b186d7cb34 100644 --- a/dom/base/Document.h +++ b/dom/base/Document.h @@ -246,6 +246,7 @@ class FeaturePolicy; class FontFaceSet; class FragmentDirective; class FrameRequestCallback; +class ImageTracker; class HighlightRegistry; class HTMLAllCollection; class HTMLBodyElement; @@ -254,8 +255,6 @@ class HTMLMetaElement; class HTMLDialogElement; class HTMLSharedElement; class HTMLImageElement; -class ImageTracker; -enum class InteractiveWidget : uint8_t; struct LifecycleCallbackArgs; class Link; class Location; @@ -3939,10 +3938,6 @@ class Document : public nsINode, public: const OriginTrials& Trials() const { return mTrials; } - dom::InteractiveWidget InteractiveWidget() const { - return mInteractiveWidgetMode; - } - private: void DoCacheAllKnownLangPrefs(); void RecomputeLanguageFromCharset(); @@ -5171,9 +5166,6 @@ class Document : public nsINode, // https://drafts.csswg.org/css-round-display/#viewport-fit-descriptor ViewportFitType mViewportFit; - // https://drafts.csswg.org/css-viewport/#interactive-widget-section - dom::InteractiveWidget mInteractiveWidgetMode; - // XXXdholbert This should really be modernized to a nsTHashMap or similar, // though note that the modernization will need to take care to also convert // the special hash_table_ops logic (e.g. how SubDocClearEntry clears the diff --git a/dom/base/InteractiveWidget.h b/dom/base/InteractiveWidget.h deleted file mode 100644 index 27b17ed73e62..000000000000 --- a/dom/base/InteractiveWidget.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef DOM_INTERACTIVE_WIDGET_H_ -#define DOM_INTERACTIVE_WIDGET_H_ - -namespace mozilla::dom { -// https://drafts.csswg.org/css-viewport/#interactive-widget-section -enum class InteractiveWidget : uint8_t { - OverlaysContent, - ResizesContent, - ResizesVisual, -}; -} // namespace mozilla::dom - -#endif // DOM_INTERACTIVE_WIDGET_H_ diff --git a/dom/base/ViewportMetaData.cpp b/dom/base/ViewportMetaData.cpp index a0669e500d6c..2646621629ce 100644 --- a/dom/base/ViewportMetaData.cpp +++ b/dom/base/ViewportMetaData.cpp @@ -59,8 +59,6 @@ static void ProcessViewportToken(ViewportMetaData& aData, aData.mUserScalable.Assign(value); } else if (key_atom == nsGkAtoms::viewport_fit) { aData.mViewportFit.Assign(value); - } else if (key_atom == nsGkAtoms::interactive_widget) { - aData.mInteractiveWidgetMode.Assign(value); } } diff --git a/dom/base/ViewportMetaData.h b/dom/base/ViewportMetaData.h index 14a908fff143..7de6eda731b4 100644 --- a/dom/base/ViewportMetaData.h +++ b/dom/base/ViewportMetaData.h @@ -20,7 +20,6 @@ struct ViewportMetaData { nsString mMaximumScale; nsString mUserScalable; nsString mViewportFit; - nsString mInteractiveWidgetMode; bool operator==(const ViewportMetaData& aOther) const { return mWidth == aOther.mWidth && mHeight == aOther.mHeight && @@ -28,8 +27,7 @@ struct ViewportMetaData { mMinimumScale == aOther.mMinimumScale && mMaximumScale == aOther.mMaximumScale && mUserScalable == aOther.mUserScalable && - mViewportFit == aOther.mViewportFit && - mInteractiveWidgetMode == aOther.mInteractiveWidgetMode; + mViewportFit == aOther.mViewportFit; } bool operator!=(const ViewportMetaData& aOther) const { return !(*this == aOther); diff --git a/dom/base/moz.build b/dom/base/moz.build index 2cfab9cfb1c8..9cc4c9bfdf88 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -208,7 +208,6 @@ EXPORTS.mozilla.dom += [ "IDTracker.h", "ImageEncoder.h", "ImageTracker.h", - "InteractiveWidget.h", "IntlUtils.h", "JSExecutionContext.h", "Link.h", diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp index 57f754ee9c9c..204ee71ece1a 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp @@ -278,7 +278,6 @@ BrowserChild::BrowserChild(ContentChild* aManager, const TabId& aTabId, mLayersId{0}, mEffectsInfo{EffectsInfo::FullyHidden()}, mDynamicToolbarMaxHeight(0), - mKeyboardHeight(0), mUniqueId(aTabId), mDidFakeShow(false), mTriedBrowserInit(false), @@ -1238,23 +1237,6 @@ mozilla::ipc::IPCResult BrowserChild::RecvDynamicToolbarOffsetChanged( return IPC_OK(); } -mozilla::ipc::IPCResult BrowserChild::RecvKeyboardHeightChanged( - const ScreenIntCoord& aHeight) { -#if defined(MOZ_WIDGET_ANDROID) - mKeyboardHeight = aHeight; - - RefPtr document = GetTopLevelDocument(); - if (!document) { - return IPC_OK(); - } - - if (nsPresContext* presContext = document->GetPresContext()) { - presContext->UpdateKeyboardHeight(aHeight); - } -#endif - return IPC_OK(); -} - mozilla::ipc::IPCResult BrowserChild::RecvSuppressDisplayport( const bool& aEnabled) { if (RefPtr presShell = GetTopLevelPresShell()) { diff --git a/dom/ipc/BrowserChild.h b/dom/ipc/BrowserChild.h index 51857965babf..bb440a294587 100644 --- a/dom/ipc/BrowserChild.h +++ b/dom/ipc/BrowserChild.h @@ -284,9 +284,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor, mozilla::ipc::IPCResult RecvDynamicToolbarOffsetChanged( const mozilla::ScreenIntCoord& aOffset); - mozilla::ipc::IPCResult RecvKeyboardHeightChanged( - const mozilla::ScreenIntCoord& aHeight); - mozilla::ipc::IPCResult RecvActivate(uint64_t aActionId); mozilla::ipc::IPCResult RecvDeactivate(uint64_t aActionId); @@ -546,7 +543,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor, ScreenIntCoord GetDynamicToolbarMaxHeight() const { return mDynamicToolbarMaxHeight; }; - mozilla::ScreenIntCoord GetKeyboardHeight() const { return mKeyboardHeight; } bool IPCOpen() const { return mIPCOpen; } @@ -808,8 +804,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor, // NOTE: This value is valuable only for the top level browser. LayoutDeviceIntPoint mChromeOffset; ScreenIntCoord mDynamicToolbarMaxHeight; - // The software keyboard height. - ScreenIntCoord mKeyboardHeight; TabId mUniqueId; bool mDidFakeShow : 1; diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp index 56a29891b4d5..2bc4975153e5 100644 --- a/dom/ipc/BrowserParent.cpp +++ b/dom/ipc/BrowserParent.cpp @@ -1213,12 +1213,6 @@ void BrowserParent::DynamicToolbarOffsetChanged(ScreenIntCoord aOffset) { Unused << SendDynamicToolbarOffsetChanged(aOffset); } } - -void BrowserParent::KeyboardHeightChanged(ScreenIntCoord aHeight) { - if (!mIsDestroyed) { - Unused << SendKeyboardHeightChanged(aHeight); - } -} #endif void BrowserParent::HandleAccessKey(const WidgetKeyboardEvent& aEvent, diff --git a/dom/ipc/BrowserParent.h b/dom/ipc/BrowserParent.h index 38f24d5767a7..6bd8178d5309 100644 --- a/dom/ipc/BrowserParent.h +++ b/dom/ipc/BrowserParent.h @@ -487,7 +487,6 @@ class BrowserParent final : public PBrowserParent, #if defined(MOZ_WIDGET_ANDROID) void DynamicToolbarMaxHeightChanged(ScreenIntCoord aHeight); void DynamicToolbarOffsetChanged(ScreenIntCoord aOffset); - void KeyboardHeightChanged(ScreenIntCoord aHeight); #endif void Activate(uint64_t aActionId); diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index f9af262927b3..a7238e37014c 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -697,9 +697,7 @@ child: async DynamicToolbarMaxHeightChanged(ScreenIntCoord height); - async DynamicToolbarOffsetChanged(ScreenIntCoord offset); - - async KeyboardHeightChanged(ScreenIntCoord height); + async DynamicToolbarOffsetChanged(ScreenIntCoord height); /** * StopIMEStateManagement() is called when the process loses focus and diff --git a/gfx/layers/apz/test/gtest/mvm/TestMobileViewportManager.cpp b/gfx/layers/apz/test/gtest/mvm/TestMobileViewportManager.cpp index ef4c316ceee9..e5b2dc7af884 100644 --- a/gfx/layers/apz/test/gtest/mvm/TestMobileViewportManager.cpp +++ b/gfx/layers/apz/test/gtest/mvm/TestMobileViewportManager.cpp @@ -12,7 +12,6 @@ #include "MobileViewportManager.h" #include "mozilla/MVMContext.h" #include "mozilla/dom/Event.h" -#include "mozilla/dom/InteractiveWidget.h" using namespace mozilla; @@ -43,7 +42,6 @@ class MockMVMContext : public MVMContext { MOCK_METHOD0(PostVisualViewportResizeEventByDynamicToolbar, void()); MOCK_METHOD0(UpdateDisplayPortMargins, void()); MOCK_METHOD0(GetDynamicToolbarOffset, ScreenIntCoord()); - MOCK_CONST_METHOD0(GetInteractiveWidgetMode, dom::InteractiveWidget()); void SetMVM(MobileViewportManager* aMVM) { mMVM = aMVM; } diff --git a/layout/base/GeckoMVMContext.cpp b/layout/base/GeckoMVMContext.cpp index 011ca3d97738..43af6232db8e 100644 --- a/layout/base/GeckoMVMContext.cpp +++ b/layout/base/GeckoMVMContext.cpp @@ -213,7 +213,4 @@ ScreenIntCoord GeckoMVMContext::GetDynamicToolbarOffset() { : ScreenIntCoord(0); } -dom::InteractiveWidget GeckoMVMContext::GetInteractiveWidgetMode() const { - return mDocument->InteractiveWidget(); -} } // namespace mozilla diff --git a/layout/base/GeckoMVMContext.h b/layout/base/GeckoMVMContext.h index ddd66c627dc1..fdbdcf22aef1 100644 --- a/layout/base/GeckoMVMContext.h +++ b/layout/base/GeckoMVMContext.h @@ -16,7 +16,6 @@ class PresShell; namespace dom { class Document; class EventTarget; -enum class InteractiveWidget : uint8_t; } // namespace dom /** @@ -58,7 +57,6 @@ class GeckoMVMContext final : public MVMContext { void UpdateDisplayPortMargins() override; MOZ_CAN_RUN_SCRIPT_BOUNDARY void Reflow(const CSSSize& aNewSize) override; ScreenIntCoord GetDynamicToolbarOffset() override; - dom::InteractiveWidget GetInteractiveWidgetMode() const override; private: RefPtr mDocument; diff --git a/layout/base/MVMContext.h b/layout/base/MVMContext.h index dc64b6b0316b..bf5ae09fcd8e 100644 --- a/layout/base/MVMContext.h +++ b/layout/base/MVMContext.h @@ -16,10 +16,6 @@ class nsIDOMEventListener; class nsIObserver; class nsISupports; -namespace mozilla::dom { -enum class InteractiveWidget : uint8_t; -} // namespace mozilla::dom - namespace mozilla { /** @@ -66,7 +62,6 @@ class MVMContext { virtual void Reflow(const CSSSize& aNewSize) = 0; virtual ScreenIntCoord GetDynamicToolbarOffset() = 0; - virtual dom::InteractiveWidget GetInteractiveWidgetMode() const = 0; }; } // namespace mozilla diff --git a/layout/base/MobileViewportManager.cpp b/layout/base/MobileViewportManager.cpp index a8a248798e90..0dcb57bd26ea 100644 --- a/layout/base/MobileViewportManager.cpp +++ b/layout/base/MobileViewportManager.cpp @@ -11,7 +11,6 @@ #include "mozilla/dom/Document.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/EventTarget.h" -#include "mozilla/dom/InteractiveWidget.h" #include "nsIFrame.h" #include "nsLayoutUtils.h" #include "nsViewManager.h" @@ -39,8 +38,7 @@ MobileViewportManager::MobileViewportManager(MVMContext* aContext, : mContext(aContext), mManagerType(aType), mIsFirstPaint(false), - mPainted(false), - mInvalidViewport(false) { + mPainted(false) { MOZ_ASSERT(mContext); MVM_LOG("%p: creating with context %p\n", this, mContext.get()); @@ -90,7 +88,8 @@ float MobileViewportManager::ComputeIntrinsicResolution() const { return 1.f; } - ScreenIntSize displaySize = GetLayoutDisplaySize(); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); CSSToScreenScale intrinsicScale = ComputeIntrinsicScale( mContext->GetViewportInfo(displaySize), displaySize, mMobileViewportSize); CSSToLayoutDeviceScale cssToDev = mContext->CSSToDevPixelScale(); @@ -259,7 +258,8 @@ LayoutDeviceToLayerScale MobileViewportManager::ZoomToResolution( void MobileViewportManager::UpdateResolutionForFirstPaint( const CSSSize& aViewportSize) { - ScreenIntSize displaySize = GetLayoutDisplaySize(); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); nsViewportInfo viewportInfo = mContext->GetViewportInfo(displaySize); ScreenIntSize compositionSize = GetCompositionSize(displaySize); @@ -281,7 +281,7 @@ void MobileViewportManager::UpdateResolutionForFirstPaint( MVM_LOG("%p: restored zoom is %f\n", this, restoreZoom.scale); restoreZoom = ClampZoom(restoreZoom, viewportInfo); - ApplyNewZoom(restoreZoom); + ApplyNewZoom(displaySize, restoreZoom); return; } @@ -299,13 +299,14 @@ void MobileViewportManager::UpdateResolutionForFirstPaint( MOZ_ASSERT(viewportInfo.GetMinZoom() <= defaultZoom && defaultZoom <= viewportInfo.GetMaxZoom()); - ApplyNewZoom(defaultZoom); + ApplyNewZoom(displaySize, defaultZoom); } void MobileViewportManager::UpdateResolutionForViewportSizeChange( const CSSSize& aViewportSize, const Maybe& aDisplayWidthChangeRatio) { - ScreenIntSize displaySize = GetLayoutDisplaySize(); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); nsViewportInfo viewportInfo = mContext->GetViewportInfo(displaySize); CSSToScreenScale zoom = GetZoom(); @@ -344,7 +345,7 @@ void MobileViewportManager::UpdateResolutionForViewportSizeChange( // 4. neither screen size nor CSS viewport changes if (!aDisplayWidthChangeRatio) { - UpdateVisualViewportSize(zoom); + UpdateVisualViewportSize(displaySize, zoom); return; } @@ -411,12 +412,13 @@ void MobileViewportManager::UpdateResolutionForViewportSizeChange( zoom, adjustedRatio, aViewportSize, mMobileViewportSize); CSSToScreenScale newZoom = ClampZoom(adjustedZoom, viewportInfo); - ApplyNewZoom(newZoom); + ApplyNewZoom(displaySize, newZoom); } void MobileViewportManager::UpdateResolutionForContentSizeChange( const CSSSize& aContentSize) { - ScreenIntSize displaySize = GetLayoutDisplaySize(); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); nsViewportInfo viewportInfo = mContext->GetViewportInfo(displaySize); CSSToScreenScale zoom = GetZoom(); @@ -439,7 +441,7 @@ void MobileViewportManager::UpdateResolutionForContentSizeChange( if (!mRestoreResolution && !mContext->IsResolutionUpdatedByApz() && !viewportInfo.IsDefaultZoomValid()) { if (zoom != intrinsicScale) { - ApplyNewZoom(intrinsicScale); + ApplyNewZoom(displaySize, intrinsicScale); } return; } @@ -457,11 +459,12 @@ void MobileViewportManager::UpdateResolutionForContentSizeChange( clampedZoom = ClampZoom(clampedZoom, viewportInfo); if (clampedZoom != zoom) { - ApplyNewZoom(clampedZoom); + ApplyNewZoom(displaySize, clampedZoom); } } -void MobileViewportManager::ApplyNewZoom(const CSSToScreenScale& aNewZoom) { +void MobileViewportManager::ApplyNewZoom(const ScreenIntSize& aDisplaySize, + const CSSToScreenScale& aNewZoom) { // If the zoom has changed, update the pres shell resolution accordingly. // We characterize this as MainThreadAdjustment, because we don't want our // change here to be remembered as a restore resolution. @@ -477,7 +480,7 @@ void MobileViewportManager::ApplyNewZoom(const CSSToScreenScale& aNewZoom) { MVM_LOG("%p: New zoom is %f\n", this, aNewZoom.scale); - UpdateVisualViewportSize(aNewZoom); + UpdateVisualViewportSize(aDisplaySize, aNewZoom); } ScreenIntSize MobileViewportManager::GetCompositionSize( @@ -505,17 +508,13 @@ ScreenIntSize MobileViewportManager::GetCompositionSize( } void MobileViewportManager::UpdateVisualViewportSize( - const CSSToScreenScale& aZoom) { + const ScreenIntSize& aDisplaySize, const CSSToScreenScale& aZoom) { if (!mContext) { return; } - ScreenIntSize displaySize = GetDisplaySizeForVisualViewport(); - if (displaySize.width == 0 || displaySize.height == 0) { - return; - } + ScreenSize compositionSize = ScreenSize(GetCompositionSize(aDisplaySize)); - ScreenSize compositionSize = ScreenSize(GetCompositionSize(displaySize)); CSSSize compSize = compositionSize / aZoom; MVM_LOG("%p: Setting VVPS %s\n", this, ToString(compSize).c_str()); mContext->SetVisualViewportSize(compSize); @@ -534,7 +533,8 @@ void MobileViewportManager::UpdateVisualViewportSizeByDynamicToolbar( return; } - ScreenIntSize displaySize = GetDisplaySizeForVisualViewport(); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); displaySize.height += aToolbarHeight; nsSize compSize = CSSSize::ToAppUnits( ScreenSize(GetCompositionSize(displaySize)) / GetZoom()); @@ -563,11 +563,19 @@ void MobileViewportManager::UpdateDisplayPortMargins() { void MobileViewportManager::RefreshVisualViewportSize() { // This function is a subset of RefreshViewportSize, and only updates the // visual viewport size. + if (!mContext) { return; } - UpdateVisualViewportSize(GetZoom()); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); + + if (displaySize.width == 0 || displaySize.height == 0) { + return; + } + + UpdateVisualViewportSize(displaySize, GetZoom()); } void MobileViewportManager::UpdateSizesBeforeReflow() { @@ -581,8 +589,9 @@ void MobileViewportManager::UpdateSizesBeforeReflow() { return; } - nsViewportInfo viewportInfo = - mContext->GetViewportInfo(GetLayoutDisplaySize()); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); + nsViewportInfo viewportInfo = mContext->GetViewportInfo(displaySize); mMobileViewportSize = viewportInfo.GetSize(); MVM_LOG("%p: MVSize updated to %s\n", this, ToString(mMobileViewportSize).c_str()); @@ -636,8 +645,9 @@ void MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution) { return; } - nsViewportInfo viewportInfo = - mContext->GetViewportInfo(GetLayoutDisplaySize()); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); + nsViewportInfo viewportInfo = mContext->GetViewportInfo(displaySize); MVM_LOG("%p: viewport info has zooms min=%f max=%f default=%f,valid=%d\n", this, viewportInfo.GetMinZoom().scale, viewportInfo.GetMaxZoom().scale, viewportInfo.GetDefaultZoom().scale, @@ -646,7 +656,7 @@ void MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution) { CSSSize viewport = viewportInfo.GetSize(); MVM_LOG("%p: Computed CSS viewport %s\n", this, ToString(viewport).c_str()); - if (!mInvalidViewport && !mIsFirstPaint && mMobileViewportSize == viewport) { + if (!mIsFirstPaint && mMobileViewportSize == viewport) { // Nothing changed, so no need to do a reflow return; } @@ -696,7 +706,6 @@ void MobileViewportManager::RefreshViewportSize(bool aForceAdjustResolution) { ShrinkToDisplaySizeIfNeeded(); mIsFirstPaint = false; - mInvalidViewport = false; } void MobileViewportManager::ShrinkToDisplaySizeIfNeeded() { @@ -728,9 +737,8 @@ void MobileViewportManager::ShrinkToDisplaySizeIfNeeded() { } CSSSize MobileViewportManager::GetIntrinsicCompositionSize() const { - // TODO: Should we use GetDisplaySizeForVisualViewport() for computing the - // intrinsic composition size? - ScreenIntSize displaySize = GetLayoutDisplaySize(); + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); ScreenIntSize compositionSize = GetCompositionSize(displaySize); CSSToScreenScale intrinsicScale = ComputeIntrinsicScale(mContext->GetViewportInfo(displaySize), @@ -741,44 +749,9 @@ CSSSize MobileViewportManager::GetIntrinsicCompositionSize() const { ParentLayerSize MobileViewportManager::GetCompositionSizeWithoutDynamicToolbar() const { + ScreenIntSize displaySize = ViewAs( + mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); return ViewAs( - ScreenSize(GetCompositionSize(GetDisplaySizeForVisualViewport())), + ScreenSize(GetCompositionSize(displaySize)), PixelCastJustification::ScreenIsParentLayerForRoot); } - -void MobileViewportManager::UpdateKeyboardHeight( - ScreenIntCoord aKeyboardHeight) { - if (aKeyboardHeight == mKeyboardHeight) { - return; - } - mKeyboardHeight = aKeyboardHeight; - mInvalidViewport = true; -} - -ScreenIntSize MobileViewportManager::GetLayoutDisplaySize() const { - ScreenIntSize displaySize = ViewAs( - mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); - switch (mContext->GetInteractiveWidgetMode()) { - case InteractiveWidget::ResizesContent: - break; - case InteractiveWidget::OverlaysContent: - case InteractiveWidget::ResizesVisual: - displaySize.height += mKeyboardHeight; - break; - } - return displaySize; -} - -ScreenIntSize MobileViewportManager::GetDisplaySizeForVisualViewport() const { - ScreenIntSize displaySize = ViewAs( - mDisplaySize, PixelCastJustification::LayoutDeviceIsScreenForBounds); - switch (mContext->GetInteractiveWidgetMode()) { - case InteractiveWidget::ResizesContent: - case InteractiveWidget::ResizesVisual: - break; - case InteractiveWidget::OverlaysContent: - displaySize.height += mKeyboardHeight; - break; - } - return displaySize; -} diff --git a/layout/base/MobileViewportManager.h b/layout/base/MobileViewportManager.h index d0c47bb625e6..1d4fba1d54f7 100644 --- a/layout/base/MobileViewportManager.h +++ b/layout/base/MobileViewportManager.h @@ -15,7 +15,6 @@ #include "nsIDOMEventListener.h" #include "nsIObserver.h" #include "Units.h" -#include "UnitTransforms.h" class nsViewportInfo; @@ -97,10 +96,8 @@ class MobileViewportManager final : public nsIDOMEventListener, * presShell is initialized. */ void SetInitialViewport(); - mozilla::LayoutDeviceIntSize DisplaySize() const { - return mozilla::ViewAs( - GetLayoutDisplaySize(), - mozilla::PixelCastJustification::LayoutDeviceIsScreenForBounds); + const mozilla::LayoutDeviceIntSize& DisplaySize() const { + return mDisplaySize; }; /* @@ -139,17 +136,15 @@ class MobileViewportManager final : public nsIDOMEventListener, mozilla::ParentLayerSize GetCompositionSizeWithoutDynamicToolbar() const; - void UpdateKeyboardHeight(mozilla::ScreenIntCoord aKeyboardHeight); - static mozilla::LazyLogModule gLog; + private: + ~MobileViewportManager(); + /* Main helper method to update the CSS viewport and any other properties that * need updating. */ void RefreshViewportSize(bool aForceAdjustResolution); - private: - ~MobileViewportManager(); - /* Secondary main helper method to update just the visual viewport size. */ void RefreshVisualViewportSize(); @@ -180,9 +175,11 @@ class MobileViewportManager final : public nsIDOMEventListener, void UpdateResolutionForContentSizeChange( const mozilla::CSSSize& aContentSize); - void ApplyNewZoom(const mozilla::CSSToScreenScale& aNewZoom); + void ApplyNewZoom(const mozilla::ScreenIntSize& aDisplaySize, + const mozilla::CSSToScreenScale& aNewZoom); - void UpdateVisualViewportSize(const mozilla::CSSToScreenScale& aZoom); + void UpdateVisualViewportSize(const mozilla::ScreenIntSize& aDisplaySize, + const mozilla::CSSToScreenScale& aZoom); /* Updates the displayport margins for the presShell's root scrollable frame */ @@ -200,23 +197,12 @@ class MobileViewportManager final : public nsIDOMEventListener, mozilla::ScreenIntSize GetCompositionSize( const mozilla::ScreenIntSize& aDisplaySize) const; - /* - * Returns the display size for layout. It varies depending on the - * interactive-widget value. - */ - mozilla::ScreenIntSize GetLayoutDisplaySize() const; - - /* - * Returns the display size for visual viewport events. It varies depending on - * the interactive-widget value. The size doesn't match above - * GetLayoutDisplaySize() in the case of resizes-visual. - */ - mozilla::ScreenIntSize GetDisplaySizeForVisualViewport() const; - mozilla::CSSToScreenScale GetZoom() const; RefPtr mContext; ManagerType mManagerType; + bool mIsFirstPaint; + bool mPainted; mozilla::LayoutDeviceIntSize mDisplaySize; mozilla::CSSSize mMobileViewportSize; mozilla::Maybe mRestoreResolution; @@ -229,17 +215,6 @@ class MobileViewportManager final : public nsIDOMEventListener, * FrameMetrics.mFixedLayerMargins to conform with this value. */ nsSize mVisualViewportSizeUpdatedByDynamicToolbar; - - /* - * The software keyboard height. - */ - mozilla::ScreenIntCoord mKeyboardHeight; - - bool mIsFirstPaint; - bool mPainted; - // True if this MobileViewportManager needs to update the visual viewport size - // even if the layout viewport size is unchanged. - bool mInvalidViewport; }; #endif diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index aebdbc3b6008..62722d834bf2 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -11460,12 +11460,6 @@ bool PresShell::SetVisualViewportOffset(const nsPoint& aScrollOffset, void PresShell::ResetVisualViewportOffset() { mVisualViewportOffset.reset(); } -void PresShell::RefreshViewportSize() { - if (mMobileViewportManager) { - mMobileViewportManager->RefreshViewportSize(false); - } -} - void PresShell::ScrollToVisual(const nsPoint& aVisualViewportOffset, FrameMetrics::ScrollOffsetUpdateType aUpdateType, ScrollMode aMode) { diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index 02e94b0a44a5..edcc3e05fbbe 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -1521,9 +1521,6 @@ class PresShell final : public nsStubDocumentObserver, // shown/hidden. nsSize GetVisualViewportSizeUpdatedByDynamicToolbar() const; - // Trigger refreshing the MobileViewportManager's size metrics. - void RefreshViewportSize(); - /* Enable/disable author style level. Disabling author style disables the * entire author level of the cascade, including the HTML preshint level. */ diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index d1ab1fa52246..4f9276d6e71b 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -1965,12 +1965,6 @@ nsDocumentViewer::SetBoundsWithFlags(const nsIntRect& aBounds, nsIFrame* f = rootView->GetFrame(); if (f) { f->InvalidateFrame(); - - // Forcibly refresh the viewport sizes even if the view size is not - // changed since it is possible that the |mBounds| change means that - // the software keyboard appeared/disappered, in such cases we might - // need to fire visual viewport events. - mPresShell->RefreshViewportSize(); } } } diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 5c4d05634d93..0e593a8daf5a 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -49,7 +49,6 @@ #include "mozilla/dom/HTMLVideoElement.h" #include "mozilla/dom/InspectorFontFace.h" #include "mozilla/dom/ImageBitmap.h" -#include "mozilla/dom/InteractiveWidget.h" #include "mozilla/dom/KeyframeEffect.h" #include "mozilla/dom/SVGViewportElement.h" #include "mozilla/dom/UIEvent.h" @@ -8252,17 +8251,6 @@ bool nsLayoutUtils::UpdateCompositionBoundsForRCDRSF( shouldSubtractDynamicToolbar)) { return false; } - - // Add the keyboard height in the case of - // `interactive-widget=overlays-content` so that contents being overlaid by - // the keyboard can NOT be reachable by scrolling. - if (aPresContext->GetKeyboardHeight() && - aPresContext->Document()->InteractiveWidget() == - InteractiveWidget::OverlaysContent) { - contentSize.height += ViewAs( - aPresContext->GetKeyboardHeight(), - PixelCastJustification::LayoutDeviceIsScreenForBounds); - } aCompBounds.SizeTo(ViewAs( LayoutDeviceSize(contentSize), PixelCastJustification::LayoutDeviceIsParentLayerForRCDRSF)); diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 618a69b49fbe..0c6bd0fbd6b7 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -96,7 +96,6 @@ #include "mozilla/layers/APZThreadUtils.h" #include "MobileViewportManager.h" #include "mozilla/dom/ImageTracker.h" -#include "mozilla/dom/InteractiveWidget.h" #ifdef ACCESSIBILITY # include "mozilla/a11y/DocAccessible.h" #endif @@ -247,7 +246,6 @@ nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType) mCurAppUnitsPerDevPixel(0), mDynamicToolbarMaxHeight(0), mDynamicToolbarHeight(0), - mKeyboardHeight(0), mPageSize(-1, -1), mPageScale(0.0), mPPScale(1.0f), @@ -718,15 +716,13 @@ nsresult nsPresContext::Init(nsDeviceContext* aDeviceContext) { mEventManager->SetPresContext(this); #if defined(MOZ_WIDGET_ANDROID) - if (IsRootContentDocumentCrossProcess()) { - if (BrowserChild* browserChild = BrowserChild::GetFrom(GetDocShell())) { - mKeyboardHeight = browserChild->GetKeyboardHeight(); - - if (MOZ_LIKELY(!Preferences::HasUserValue( - "layout.dynamic-toolbar-max-height"))) { - mDynamicToolbarMaxHeight = browserChild->GetDynamicToolbarMaxHeight(); - mDynamicToolbarHeight = mDynamicToolbarMaxHeight; - } + if (IsRootContentDocumentCrossProcess() && + MOZ_LIKELY( + !Preferences::HasUserValue("layout.dynamic-toolbar-max-height"))) { + if (BrowserChild* browserChild = + BrowserChild::GetFrom(mDocument->GetDocShell())) { + mDynamicToolbarMaxHeight = browserChild->GetDynamicToolbarMaxHeight(); + mDynamicToolbarHeight = mDynamicToolbarMaxHeight; } } #endif @@ -2963,9 +2959,9 @@ gfx::PaletteCache& nsPresContext::FontPaletteCache() { return *mFontPaletteCache.get(); } -void nsPresContext::SetVisibleArea(const nsRect& aRect) { - if (!aRect.IsEqualEdges(mVisibleArea)) { - mVisibleArea = aRect; +void nsPresContext::SetVisibleArea(const nsRect& r) { + if (!r.IsEqualEdges(mVisibleArea)) { + mVisibleArea = r; mSizeForViewportUnits = mVisibleArea.Size(); if (IsRootContentDocumentCrossProcess()) { AdjustSizeForViewportUnits(); @@ -3038,27 +3034,13 @@ void nsPresContext::UpdateDynamicToolbarOffset(ScreenIntCoord aOffset) { return; } - dom::InteractiveWidget interactiveWidget = mDocument->InteractiveWidget(); - if (interactiveWidget == InteractiveWidget::OverlaysContent && - mKeyboardHeight > 0) { - // On overlays-content mode, the toolbar offset change should NOT affect - // the visual viewport while the software keyboard is being shown since - // the toolbar will be positioned somewhere in the middle of the visual - // viewport. - return; - } - - if (interactiveWidget == InteractiveWidget::ResizesContent || - mKeyboardHeight == 0) { - // On resizes-content mode or the software keyboard is not visible, forcibly - // flush position:fixed elements in the case where the dynamic toolbar is - // going to be completely hidden or starts to be visible so that %-based - // style values will be recomputed with the visual viewport size which is - // including the area covered by the dynamic toolbar. - if (mDynamicToolbarHeight == 0 || aOffset == -mDynamicToolbarMaxHeight) { - mPresShell->MarkFixedFramesForReflow(IntrinsicDirty::None); - mPresShell->AddResizeEventFlushObserverIfNeeded(); - } + // Forcibly flush position:fixed elements in the case where the dynamic + // toolbar is going to be completely hidden or starts to be visible so that + // %-based style values will be recomputed with the visual viewport size which + // is including the area covered by the dynamic toolbar. + if (mDynamicToolbarHeight == 0 || aOffset == -mDynamicToolbarMaxHeight) { + mPresShell->MarkFixedFramesForReflow(IntrinsicDirty::None); + mPresShell->AddResizeEventFlushObserverIfNeeded(); } mDynamicToolbarHeight = mDynamicToolbarMaxHeight + aOffset; @@ -3072,20 +3054,6 @@ void nsPresContext::UpdateDynamicToolbarOffset(ScreenIntCoord aOffset) { ServoStyleSet::OnlyDynamic::Yes); } -void nsPresContext::UpdateKeyboardHeight(ScreenIntCoord aHeight) { - MOZ_ASSERT(IsRootContentDocumentCrossProcess()); - mKeyboardHeight = aHeight; - - if (!mPresShell) { - return; - } - - if (RefPtr mvm = - mPresShell->GetMobileViewportManager()) { - mvm->UpdateKeyboardHeight(aHeight); - } -} - DynamicToolbarState nsPresContext::GetDynamicToolbarState() const { if (!IsRootContentDocumentCrossProcess() || !HasDynamicToolbar()) { return DynamicToolbarState::None; diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index a82156a82835..4b3f1546d738 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -401,7 +401,7 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { * Set the currently visible area. The units for r are standard * nscoord units (as scaled by the device context). */ - void SetVisibleArea(const nsRect& aRect); + void SetVisibleArea(const nsRect& r); nsSize GetSizeForViewportUnits() const { return mSizeForViewportUnits; } @@ -433,10 +433,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { return mDynamicToolbarHeight; } - void UpdateKeyboardHeight(mozilla::ScreenIntCoord aHeight); - - mozilla::ScreenIntCoord GetKeyboardHeight() const { return mKeyboardHeight; } - /** * Returns the state of the dynamic toolbar. */ @@ -1223,8 +1219,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { // The maximum height of the dynamic toolbar on mobile. mozilla::ScreenIntCoord mDynamicToolbarMaxHeight; mozilla::ScreenIntCoord mDynamicToolbarHeight; - // The software keyboard height. - mozilla::ScreenIntCoord mKeyboardHeight; // Safe area insets support mozilla::ScreenIntMargin mSafeAreaInsets; nsSize mPageSize; diff --git a/layout/base/tests/mochitest.toml b/layout/base/tests/mochitest.toml index 75beb89a15ef..1b3b73a3bb75 100644 --- a/layout/base/tests/mochitest.toml +++ b/layout/base/tests/mochitest.toml @@ -8,7 +8,6 @@ support-files = [ "file_bug842853.html", "file_bug842853.sjs", "selection-utils.js", - "!/gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js", "!/gfx/layers/apz/test/mochitest/apz_test_utils.js", ] @@ -271,9 +270,6 @@ support-files = [ ["test_getClientRects_emptytext.html"] -["test_interactive_widget.html"] -run-if = ["os == 'android'"] - ["test_mozPaintCount.html"] skip-if = ["os == 'android'"] # android: Requires plugin support diff --git a/layout/base/tests/test_event_target_radius.html b/layout/base/tests/test_event_target_radius.html index ce6e4ad2d88a..a1e8d9c16cff 100644 --- a/layout/base/tests/test_event_target_radius.html +++ b/layout/base/tests/test_event_target_radius.html @@ -28,12 +28,12 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1733509 - + - + @@ -53,7 +53,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1733509 - + diff --git a/layout/base/tests/test_interactive_widget.html b/layout/base/tests/test_interactive_widget.html deleted file mode 100644 index c8a084e1ae7d..000000000000 --- a/layout/base/tests/test_interactive_widget.html +++ /dev/null @@ -1,273 +0,0 @@ - - - - - interactive-widget tests - - - - - - - - -

- -

-
-
-
diff --git a/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineView.kt b/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineView.kt
index b533539494f7..39a4c2d6cc0c 100644
--- a/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineView.kt
+++ b/mobile/android/android-components/components/browser/engine-gecko/src/main/java/mozilla/components/browser/engine/gecko/GeckoEngineView.kt
@@ -23,7 +23,6 @@ import org.mozilla.geckoview.BasicSelectionActionDelegate
 import org.mozilla.geckoview.GeckoResult
 import org.mozilla.geckoview.GeckoSession
 import java.lang.ref.WeakReference
-import androidx.core.view.OnApplyWindowInsetsListener as AndroidxOnApplyWindowInsetsListener
 
 /**
  * Gecko-based EngineView implementation.
@@ -234,13 +233,6 @@ class GeckoEngineView @JvmOverloads constructor(
         super.setVisibility(visibility)
     }
 
-    override fun addWindowInsetsListener(
-        key: String,
-        listener: AndroidxOnApplyWindowInsetsListener?,
-    ) = geckoView.addWindowInsetsListener(key, listener)
-
-    override fun removeWindowInsetsListener(key: String) = geckoView.removeWindowInsetsListener(key)
-
     companion object {
         internal const val DARK_COVER = 0xFF2A2A2E.toInt()
     }
diff --git a/mobile/android/android-components/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineView.kt b/mobile/android/android-components/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineView.kt
index bea82b1e2b01..d0a5a6af8ede 100644
--- a/mobile/android/android-components/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineView.kt
+++ b/mobile/android/android-components/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineView.kt
@@ -44,7 +44,6 @@ import android.widget.FrameLayout
 import androidx.annotation.VisibleForTesting
 import androidx.annotation.VisibleForTesting.Companion.PRIVATE
 import androidx.core.net.toUri
-import androidx.core.view.ViewCompat
 import kotlinx.coroutines.runBlocking
 import mozilla.components.browser.engine.system.matcher.UrlMatcher
 import mozilla.components.browser.engine.system.permission.SystemPermissionRequest
@@ -706,18 +705,6 @@ class SystemEngineView @JvmOverloads constructor(
         // no-op
     }
 
-    override fun addWindowInsetsListener(
-        key: String,
-        listener: androidx.core.view.OnApplyWindowInsetsListener?,
-    ) {
-        val rootView = (context as Activity).window.decorView.rootView
-        ViewCompat.setOnApplyWindowInsetsListener(rootView, listener)
-    }
-
-    override fun removeWindowInsetsListener(key: String) {
-        ViewCompat.setOnApplyWindowInsetsListener(rootView, null)
-    }
-
     override fun canScrollVerticallyUp() = session?.webView?.canScrollVertically(-1) ?: false
 
     override fun canScrollVerticallyDown() = session?.webView?.canScrollVertically(1) ?: false
diff --git a/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/EngineView.kt b/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/EngineView.kt
index e4327f04abb6..e217f511d809 100644
--- a/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/EngineView.kt
+++ b/mobile/android/android-components/components/concept/engine/src/main/java/mozilla/components/concept/engine/EngineView.kt
@@ -7,7 +7,6 @@ package mozilla.components.concept.engine
 import android.content.Context
 import android.graphics.Bitmap
 import android.view.View
-import androidx.core.view.OnApplyWindowInsetsListener
 import androidx.lifecycle.DefaultLifecycleObserver
 import androidx.lifecycle.Lifecycle
 import androidx.lifecycle.LifecycleOwner
@@ -139,24 +138,6 @@ interface EngineView {
      */
     fun setActivityContext(context: Context?)
 
-    /**
-     * Add an OnApplyWindowInsetsListener to observe the root view WindowInsets changes through
-     * the listener set on GeckoView
-     *
-     * @param key The key associated to the listener.
-     * @param listener The OnApplyWindowInsetsListener to be invoked.
-     */
-    fun addWindowInsetsListener(
-        key: String,
-        listener: OnApplyWindowInsetsListener?,
-    )
-
-    /**
-     * Remove the OnApplyWindowInsetsListener to stop observing WindowInsets changed.
-     * @param key The key associated to the listener to remove.
-     */
-    fun removeWindowInsetsListener(key: String)
-
     /**
      * A delegate that will handle interactions with text selection context menus.
      */
diff --git a/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/view/Activity.kt b/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/view/Activity.kt
index 4a467c93beeb..283bd30720cb 100644
--- a/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/view/Activity.kt
+++ b/mobile/android/android-components/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/view/Activity.kt
@@ -9,15 +9,12 @@ import android.os.Build.VERSION.SDK_INT
 import android.os.Build.VERSION_CODES
 import android.view.View
 import android.view.WindowManager
-import androidx.core.view.OnApplyWindowInsetsListener
 import androidx.core.view.ViewCompat
 import androidx.core.view.ViewCompat.onApplyWindowInsets
 import androidx.core.view.WindowInsetsCompat
 import androidx.core.view.WindowInsetsControllerCompat
 import mozilla.components.support.base.log.logger.Logger
 
-private const val IMMERSIVE_MODE_WINDOW_INSETS_LISTENER = "IMMERSIVE_MODE_WINDOW_INSETS_LISTENER"
-
 /**
  * Attempts to enter immersive mode - fullscreen with the status bar and navigation buttons hidden,
  * expanding itself into the notch area for devices running API 28+.
@@ -25,18 +22,13 @@ private const val IMMERSIVE_MODE_WINDOW_INSETS_LISTENER = "IMMERSIVE_MODE_WINDOW
  * This will automatically register and use an inset listener: [View.OnApplyWindowInsetsListener]
  * to restore immersive mode if interactions with various other widgets like the keyboard or dialogs
  * got the activity out of immersive mode without [exitImmersiveMode] being called.
- *
- * @param setListenerFunction is an optional function to setup an WindowInsets listener:
- * [View.OnApplyWindowInsetsListener] to allow having multiple listeners at the same time.
  */
 fun Activity.enterImmersiveMode(
     insetsController: WindowInsetsControllerCompat = window.createWindowInsetsController(),
-    setOnApplyWindowInsetsListener: (String, OnApplyWindowInsetsListener) ->
-    Unit = { _, listener -> ViewCompat.setOnApplyWindowInsetsListener(window.decorView, listener) },
 ) {
     insetsController.hideInsets()
 
-    val insetsListener = OnApplyWindowInsetsListener { view, insetsCompat ->
+    ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { view, insetsCompat ->
         if (insetsCompat.isVisible(WindowInsetsCompat.Type.statusBars())) {
             insetsController.hideInsets()
         }
@@ -44,8 +36,6 @@ fun Activity.enterImmersiveMode(
         onApplyWindowInsets(view, insetsCompat)
     }
 
-    setOnApplyWindowInsetsListener(IMMERSIVE_MODE_WINDOW_INSETS_LISTENER, insetsListener)
-
     if (SDK_INT >= VERSION_CODES.P) {
         window.setFlags(
             WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
@@ -70,16 +60,13 @@ private fun WindowInsetsControllerCompat.hideInsets() {
  *
  * @param insetsController is an optional [WindowInsetsControllerCompat] object for controlling the
  * window insets.
- * @param removeListenerFunction is an optional function which was used for [enterImmersiveMode].
  */
 fun Activity.exitImmersiveMode(
     insetsController: WindowInsetsControllerCompat = window.createWindowInsetsController(),
-    unregisterOnApplyWindowInsetsListener: (String) ->
-    Unit = { ViewCompat.setOnApplyWindowInsetsListener(window.decorView, null) },
 ) {
     insetsController.show(WindowInsetsCompat.Type.systemBars())
 
-    unregisterOnApplyWindowInsetsListener(IMMERSIVE_MODE_WINDOW_INSETS_LISTENER)
+    ViewCompat.setOnApplyWindowInsetsListener(window.decorView, null)
 
     if (SDK_INT >= VERSION_CODES.P) {
         window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
diff --git a/mobile/android/android-components/components/support/test-fakes/src/main/java/mozilla/components/support/test/fakes/engine/FakeEngineView.kt b/mobile/android/android-components/components/support/test-fakes/src/main/java/mozilla/components/support/test/fakes/engine/FakeEngineView.kt
index a133ba2a38af..61ccf87e6f3a 100644
--- a/mobile/android/android-components/components/support/test-fakes/src/main/java/mozilla/components/support/test/fakes/engine/FakeEngineView.kt
+++ b/mobile/android/android-components/components/support/test-fakes/src/main/java/mozilla/components/support/test/fakes/engine/FakeEngineView.kt
@@ -10,15 +10,11 @@ import android.view.View
 import mozilla.components.concept.engine.EngineSession
 import mozilla.components.concept.engine.EngineView
 import mozilla.components.concept.engine.selection.SelectionActionDelegate
-import androidx.core.view.OnApplyWindowInsetsListener as AndroidxOnApplyWindowInsetsListener
 
 /**
  * A fake [EngineView] to be used in tests.
  */
-class FakeEngineView(
-    context: Context,
-) : View(context),
-    EngineView {
+class FakeEngineView(context: Context) : View(context), EngineView {
     override fun render(session: EngineSession) = Unit
 
     override fun captureThumbnail(onFinish: (Bitmap?) -> Unit) = Unit
@@ -33,12 +29,5 @@ class FakeEngineView(
 
     override fun release() = Unit
 
-    override fun addWindowInsetsListener(
-        key: String,
-        listener: AndroidxOnApplyWindowInsetsListener?,
-    ) = Unit
-
-    override fun removeWindowInsetsListener(key: String) = Unit
-
     override var selectionActionDelegate: SelectionActionDelegate? = null
 }
diff --git a/mobile/android/docs/geckoview/consumer/geckoview-quick-start.rst b/mobile/android/docs/geckoview/consumer/geckoview-quick-start.rst
index f145a36daff9..6a529a0dfa12 100644
--- a/mobile/android/docs/geckoview/consumer/geckoview-quick-start.rst
+++ b/mobile/android/docs/geckoview/consumer/geckoview-quick-start.rst
@@ -109,15 +109,6 @@ Initialize GeckoView in an Activity
     view.setSession(session);
     session.loadUri("about:buildconfig"); // Or any other URL...
 
-**4. Set the** `windowSoftInputMode `_ **to** ``adjustResize`` **for** `interactive-widget `_ **:**
-
-.. code-block:: xml
-
-    
-        
-    
-
 You're done!
 ==============
 
diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
index 9e8c6ec39458..655006a429a5 100644
--- a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
+++ b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
@@ -28,7 +28,6 @@ import androidx.coordinatorlayout.widget.CoordinatorLayout
 import androidx.core.content.ContextCompat
 import androidx.core.content.ContextCompat.getColor
 import androidx.core.content.getSystemService
-import androidx.core.view.OnApplyWindowInsetsListener
 import androidx.core.view.isVisible
 import androidx.fragment.app.Fragment
 import androidx.fragment.app.activityViewModels
@@ -2077,11 +2076,7 @@ abstract class BaseBrowserFragment :
                 GestureNavUtils,
             ).show()
 
-            activity.enterImmersiveMode(
-                setOnApplyWindowInsetsListener = { key: String, listener: OnApplyWindowInsetsListener ->
-                    binding.engineView.addWindowInsetsListener(key, listener)
-                },
-            )
+            activity.enterImmersiveMode()
             (view as? SwipeGestureLayout)?.isSwipeEnabled = false
             browserToolbarView.collapse()
             browserToolbarView.gone()
@@ -2100,10 +2095,7 @@ abstract class BaseBrowserFragment :
 
             MediaState.fullscreen.record(NoExtras())
         } else {
-            activity.exitImmersiveMode(
-                unregisterOnApplyWindowInsetsListener = binding.engineView::removeWindowInsetsListener,
-            )
-
+            activity.exitImmersiveMode()
             (view as? SwipeGestureLayout)?.isSwipeEnabled = true
             (activity as? HomeActivity)?.let { homeActivity ->
                 // ExternalAppBrowserActivity exclusively handles it's own theming unless in private mode.
diff --git a/mobile/android/geckoview/api.txt b/mobile/android/geckoview/api.txt
index 5d89808a71f9..7c5774a31b40 100644
--- a/mobile/android/geckoview/api.txt
+++ b/mobile/android/geckoview/api.txt
@@ -45,8 +45,6 @@ import androidx.annotation.AnyThread;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.UiThread;
-import androidx.core.view.OnApplyWindowInsetsListener;
-import androidx.core.view.WindowInsetsCompat;
 import java.io.File;
 import java.io.InputStream;
 import java.lang.Boolean;
@@ -715,7 +713,6 @@ package org.mozilla.geckoview {
     method @UiThread public boolean shouldPinOnScreen();
     method @UiThread public void surfaceChanged(@NonNull GeckoDisplay.SurfaceInfo);
     method @UiThread public void surfaceDestroyed();
-    method @UiThread public void windowInsetsChanged(@NonNull WindowInsetsCompat);
   }
 
   public static interface GeckoDisplay.NewSurfaceProvider {
@@ -1947,7 +1944,6 @@ package org.mozilla.geckoview {
   @UiThread public class GeckoView extends FrameLayout implements GeckoDisplay.NewSurfaceProvider {
     ctor public GeckoView(Context);
     ctor public GeckoView(Context, AttributeSet);
-    method @UiThread public void addWindowInsetsListener(@NonNull String, @Nullable OnApplyWindowInsetsListener);
     method @NonNull @UiThread public GeckoResult capturePixels();
     method public void coverUntilFirstPaint(int);
     method public void dispatchDraw(@Nullable Canvas);
@@ -1961,7 +1957,6 @@ package org.mozilla.geckoview {
     method public void onDetachedFromWindow();
     method @NonNull public GeckoResult onTouchEventForDetailResult(@NonNull MotionEvent);
     method @Nullable @UiThread public GeckoSession releaseSession();
-    method @UiThread public void removeWindowInsetsListener(@NonNull String);
     method public void setActivityContextDelegate(@Nullable GeckoView.ActivityContextDelegate);
     method public void setAutofillEnabled(boolean);
     method public void setDynamicToolbarMaxHeight(int);
diff --git a/mobile/android/geckoview/build.gradle b/mobile/android/geckoview/build.gradle
index 10792e78c676..8f997d1eacd7 100644
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -234,7 +234,6 @@ dependencies {
 
     implementation "com.google.android.gms:play-services-fido:21.1.0"
     implementation "org.yaml:snakeyaml:2.2"
-    implementation 'androidx.core:core:1.12.0'
 
     implementation ComponentsDependencies.androidx_lifecycle_common
     implementation ComponentsDependencies.androidx_lifecycle_process
diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
index d8143aa168c3..e0c16d66cc2f 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoDisplay.java
@@ -8,15 +8,12 @@ package org.mozilla.geckoview;
 
 import android.graphics.Bitmap;
 import android.graphics.Rect;
-import android.os.Build;
 import android.view.Surface;
 import android.view.SurfaceControl;
-import android.view.WindowInsets;
 import androidx.annotation.AnyThread;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.UiThread;
-import androidx.core.view.WindowInsetsCompat;
 import org.mozilla.gecko.util.ThreadUtils;
 
 /**
@@ -530,46 +527,4 @@ public class GeckoDisplay {
   public @NonNull ScreenshotBuilder screenshot() {
     return new ScreenshotBuilder(mSession);
   }
-
-  private static int getKeyboardHeight(@NonNull final WindowInsetsCompat insetsCompat) {
-    if (Build.VERSION.SDK_INT >= 30) {
-      final WindowInsets insets = insetsCompat.toWindowInsets();
-      if (insets == null) {
-        return 0;
-      }
-
-      // https://developer.android.com/reference/android/view/WindowInsets.Type#ime()
-      final int imeHeight = insets.getInsets(WindowInsets.Type.ime()).bottom;
-      if (imeHeight == 0) {
-        return 0;
-      }
-      return imeHeight - insets.getInsets(WindowInsets.Type.navigationBars()).bottom;
-    }
-
-    if (Build.VERSION.SDK_INT >= 29) {
-      final int imeHeight = insetsCompat.getInsets(WindowInsetsCompat.Type.ime()).bottom;
-      if (imeHeight == 0) {
-        return 0;
-      }
-      return imeHeight - insetsCompat.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom;
-    }
-
-    return insetsCompat.getSystemWindowInsets().bottom;
-  }
-
-  /**
-   * Called when the root window insets changed.
-   *
-   * @param insets the WindowInsetsCompat
-   */
-  @UiThread
-  public void windowInsetsChanged(@NonNull final WindowInsetsCompat insets) {
-    ThreadUtils.assertOnUiThread();
-
-    final int keyboardHeight = getKeyboardHeight(insets);
-
-    if (mSession != null) {
-      mSession.onKeyboardHeight(keyboardHeight);
-    }
-  }
 }
diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
index 3f431d63457f..dff6b053ba59 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java
@@ -284,7 +284,6 @@ public class GeckoSession {
   private float mViewportLeft;
   private float mViewportTop;
   private float mViewportZoom = 1.0f;
-  private int mKeyboardHeight = 0; // The software keyboard height, 0 if it's hidden.
 
   //
   // NOTE: These values are also defined in
@@ -411,9 +410,6 @@ public class GeckoSession {
     @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
     public native void onSafeAreaInsetsChanged(int top, int right, int bottom, int left);
 
-    @WrapForJNI(calledFrom = "ui", dispatchTo = "gecko")
-    public native void onKeyboardHeightChanged(int height);
-
     @WrapForJNI(calledFrom = "ui")
     public void setPointerIcon(
         final int defaultCursor, final Bitmap customCursor, final float x, final float y) {
@@ -2642,10 +2638,6 @@ public class GeckoSession {
     } else {
       // Delete any pending memory pressure events since we're active again.
       ThreadUtils.removeUiThreadCallbacks(mNotifyMemoryPressure);
-
-      if (mAttachedCompositor) {
-        mCompositor.onKeyboardHeightChanged(mKeyboardHeight);
-      }
     }
 
     ThreadUtils.runOnUiThread(() -> getAutofillSupport().onActiveChanged(active));
@@ -7904,20 +7896,6 @@ public class GeckoSession {
     }
   }
 
-  /* package */ void onKeyboardHeight(final int height) {
-    ThreadUtils.assertOnUiThread();
-
-    if (mKeyboardHeight == height) {
-      return;
-    }
-
-    mKeyboardHeight = height;
-
-    if (mAttachedCompositor) {
-      mCompositor.onKeyboardHeightChanged(mKeyboardHeight);
-    }
-  }
-
   /* package */ void setPointerIcon(
       final int defaultCursor, final @Nullable Bitmap customCursor, final float x, final float y) {
     ThreadUtils.assertOnUiThread();
diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
index 75353224eda7..8b31862524fc 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoView.java
@@ -56,12 +56,10 @@ import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.UiThread;
 import androidx.core.view.ViewCompat;
-import androidx.core.view.WindowInsetsCompat;
 import java.io.InputStream;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.ref.WeakReference;
-import java.util.HashMap;
 import java.util.Objects;
 import org.mozilla.gecko.AndroidGamepadManager;
 import org.mozilla.gecko.EventDispatcher;
@@ -73,10 +71,6 @@ import org.mozilla.gecko.util.ThreadUtils;
 public class GeckoView extends FrameLayout implements GeckoDisplay.NewSurfaceProvider {
   private static final String LOGTAG = "GeckoView";
   private static final boolean DEBUG = false;
-  private static final String KEYBOARD_WINDOW_INSETS_LISTENER = "KEYBOARD_WINDOW_INSETS_LISTENER";
-  private final HashMap
-      mWindowInsetsListeners =
-          new HashMap();
 
   protected final @NonNull Display mDisplay = new Display();
 
@@ -101,8 +95,7 @@ public class GeckoView extends FrameLayout implements GeckoDisplay.NewSurfacePro
   private @Nullable ActivityContextDelegate mActivityDelegate;
   private GeckoSession.PrintDelegate mPrintDelegate;
 
-  private class Display
-      implements SurfaceViewWrapper.Listener, androidx.core.view.OnApplyWindowInsetsListener {
+  private class Display implements SurfaceViewWrapper.Listener {
     private final int[] mOrigin = new int[2];
 
     private GeckoDisplay mDisplay;
@@ -201,24 +194,6 @@ public class GeckoView extends FrameLayout implements GeckoDisplay.NewSurfacePro
       }
     }
 
-    @Override // OnApplyWindowInsetsListener
-    public WindowInsetsCompat onApplyWindowInsets(
-        @NonNull final View view, @NonNull final WindowInsetsCompat insets) {
-      final WindowInsetsCompat updatedInsets =
-          WindowInsetsCompat.toWindowInsetsCompat(
-              view.onApplyWindowInsets(insets.toWindowInsets()));
-      if (mDisplay != null) {
-        mDisplay.windowInsetsChanged(updatedInsets);
-      }
-      return updatedInsets;
-    }
-
-    public void windowInsetsChanged(@NonNull final WindowInsetsCompat insets) {
-      if (mDisplay != null) {
-        mDisplay.windowInsetsChanged(insets);
-      }
-    }
-
     public boolean shouldPinOnScreen() {
       return mDisplay != null && mDisplay.shouldPinOnScreen();
     }
@@ -637,75 +612,6 @@ public class GeckoView extends FrameLayout implements GeckoDisplay.NewSurfacePro
     return mSession.getPanZoomController();
   }
 
-  /**
-   * Register an internal windowInsetsListener that will forward its calls to the listeners
-   * registered in {@link GeckoView#mWindowInsetsListeners}
-   *
-   * @param activity The target Activity to observe.
-   */
-  private void attachWindowInsetsListener(final @NonNull Activity activity) {
-    try {
-      final View rootView = activity.getWindow().getDecorView().getRootView();
-      ViewCompat.setOnApplyWindowInsetsListener(
-          rootView,
-          (view, insets) -> {
-            final WindowInsetsCompat updatedInsets =
-                WindowInsetsCompat.toWindowInsetsCompat(
-                    view.onApplyWindowInsets(insets.toWindowInsets()));
-
-            for (final androidx.core.view.OnApplyWindowInsetsListener listener :
-                mWindowInsetsListeners.values()) {
-              listener.onApplyWindowInsets(view, updatedInsets);
-            }
-            return updatedInsets;
-          });
-    } catch (final Exception e) {
-      Log.e(LOGTAG, "Failed to attach WindowInsetsListener: ", e);
-    }
-  }
-
-  /**
-   * Unregister the internal WindowInsetsListener attached to the Activity's root view and clear the
-   * listeners that were attached through {@link GeckoView#addWindowInsetsListener(String,
-   * androidx.core.view.OnApplyWindowInsetsListener) }
-   *
-   * @param activity The target Activity to stop observing.
-   */
-  private void detachWindowInsetsListener(final @NonNull Activity activity) {
-    try {
-      final View rootView = activity.getWindow().getDecorView().getRootView();
-      ViewCompat.setOnApplyWindowInsetsListener(rootView, null);
-      mWindowInsetsListeners.clear();
-    } catch (final Exception e) {
-      Log.e(LOGTAG, "Failed to detach WindowInsetsListener: ", e);
-    }
-  }
-
-  /**
-   * Add an OnApplyWindowInsetsListener to observe the root view WindowInsets changes.
-   *
-   * @param key The key associated to the listener.
-   * @param listener The OnApplyWindowInsetsListener to be invoked.
-   */
-  @UiThread
-  public void addWindowInsetsListener(
-      final @NonNull String key,
-      final @Nullable androidx.core.view.OnApplyWindowInsetsListener listener) {
-    ThreadUtils.assertOnUiThread();
-    mWindowInsetsListeners.put(key, listener);
-  }
-
-  /**
-   * Remove the OnApplyWindowInsetsListener to stop observing WindowInsets changed.
-   *
-   * @param key The key associated to the listener to remove.
-   */
-  @UiThread
-  public void removeWindowInsetsListener(final @NonNull String key) {
-    ThreadUtils.assertOnUiThread();
-    mWindowInsetsListeners.remove(key);
-  }
-
   @Override
   public void onAttachedToWindow() {
     if (mIsSessionPoisoned) {
@@ -723,18 +629,12 @@ public class GeckoView extends FrameLayout implements GeckoDisplay.NewSurfacePro
     }
 
     super.onAttachedToWindow();
-
-    // This needs to be called after the `super.onAttachedToWindow()`.
-    attachWindowInsetsListener(getActivityFromContext(getContext()));
-    addWindowInsetsListener(KEYBOARD_WINDOW_INSETS_LISTENER, mDisplay);
   }
 
   @Override
   public void onDetachedFromWindow() {
     super.onDetachedFromWindow();
 
-    detachWindowInsetsListener(getActivityFromContext(getContext()));
-
     if (mSession == null) {
       return;
     }
diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
index 5d315bb1d394..183148e86b6e 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/doc-files/CHANGELOG.md
@@ -16,13 +16,8 @@ exclude: true
 ## v130
 - ⚠️ Removed [`TranslationState`][127.4] constructor, please use the new [`TranslationState`][127.3] constructor with `hasVisibleChange`. ([bug 1895275]({{bugzilla}}1895275))
 - Added support for controlling `privacy.fingerprintingProtection` and `privacy.fingerprintingProtection.pbmode` via [`GeckoRuntimeSettings.setFingerprintingProtection`][130.1]
-- Added [`GeckoDisplay.windowInsetsChanged`][130.2].
-- Added [`GeckoView.addWindowInsetsListener`][130.3] and [`GeckoView.removeWindowInsetsListener`][130.4] to allow listening WindowInsets changes of Activity's root window with multiple listeners.
 
 [130.1]: {{javadoc_uri}}/GeckoRuntimeSettings.html#setFingerprintingProtection
-[130.2]: {{javadoc_uri}}/GeckoDisplay.html#windowInsetsChanged
-[130.3]: {{javadoc_uri}}/GeckoView.html#addWindowInsetsListener
-[130.4]: {{javadoc_uri}}/GeckoView.html#removeWindowInsetsListener
 
 ## v129
 - Added [`ERROR_ADMIN_INSTALL_ONLY`][129.1] to `WebExtension.InstallException.ErrorCodes`. ([bug 1902222]({{bugzilla}}1902222))
@@ -1594,4 +1589,4 @@ to allow adding gecko profiler markers.
 [65.24]: {{javadoc_uri}}/CrashReporter.html#sendCrashReport(android.content.Context,android.os.Bundle,java.lang.String)
 [65.25]: {{javadoc_uri}}/GeckoResult.html
 
-[api-version]: f935b93b2a809fdf1fc8561189f3f14d3105ddce
+[api-version]: 54de491a757351b552176a5686609f62afb23da6
diff --git a/mobile/android/test_runner/src/main/AndroidManifest.xml b/mobile/android/test_runner/src/main/AndroidManifest.xml
index e0cb4b922a82..bed8d35bc763 100644
--- a/mobile/android/test_runner/src/main/AndroidManifest.xml
+++ b/mobile/android/test_runner/src/main/AndroidManifest.xml
@@ -20,7 +20,6 @@
         
         
         
diff --git a/view/nsView.cpp b/view/nsView.cpp
index b1c108aface6..c1c1e12f09ec 100644
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -921,8 +921,23 @@ void nsView::DynamicToolbarMaxHeightChanged(ScreenIntCoord aHeight) {
   MOZ_ASSERT(this == mViewManager->GetRootView(),
              "Should be called for the root view");
 
-  CallOnAllRemoteChildren(
-      [aHeight](dom::BrowserParent* aBrowserParent) -> CallState {
+  PresShell* presShell = mViewManager->GetPresShell();
+  if (!presShell) {
+    return;
+  }
+
+  dom::Document* document = presShell->GetDocument();
+  if (!document) {
+    return;
+  }
+
+  nsPIDOMWindowOuter* window = document->GetWindow();
+  if (!window) {
+    return;
+  }
+
+  nsContentUtils::CallOnAllRemoteChildren(
+      window, [&aHeight](dom::BrowserParent* aBrowserParent) -> CallState {
         aBrowserParent->DynamicToolbarMaxHeightChanged(aHeight);
         return CallState::Continue;
       });
@@ -933,8 +948,24 @@ void nsView::DynamicToolbarOffsetChanged(ScreenIntCoord aOffset) {
              "Should be only called for the browser parent process");
   MOZ_ASSERT(this == mViewManager->GetRootView(),
              "Should be called for the root view");
-  CallOnAllRemoteChildren(
-      [aOffset](dom::BrowserParent* aBrowserParent) -> CallState {
+
+  PresShell* presShell = mViewManager->GetPresShell();
+  if (!presShell) {
+    return;
+  }
+
+  dom::Document* document = presShell->GetDocument();
+  if (!document) {
+    return;
+  }
+
+  nsPIDOMWindowOuter* window = document->GetWindow();
+  if (!window) {
+    return;
+  }
+
+  nsContentUtils::CallOnAllRemoteChildren(
+      window, [&aOffset](dom::BrowserParent* aBrowserParent) -> CallState {
         // Skip background tabs.
         if (!aBrowserParent->GetDocShellIsActive()) {
           return CallState::Continue;
@@ -944,23 +975,6 @@ void nsView::DynamicToolbarOffsetChanged(ScreenIntCoord aOffset) {
         return CallState::Stop;
       });
 }
-
-void nsView::KeyboardHeightChanged(ScreenIntCoord aHeight) {
-  MOZ_ASSERT(XRE_IsParentProcess(),
-             "Should be only called for the browser parent process");
-  MOZ_ASSERT(this == mViewManager->GetRootView(),
-             "Should be called for the root view");
-  CallOnAllRemoteChildren(
-      [aHeight](dom::BrowserParent* aBrowserParent) -> CallState {
-        // Skip background tabs.
-        if (!aBrowserParent->GetDocShellIsActive()) {
-          return CallState::Continue;
-        }
-
-        aBrowserParent->KeyboardHeightChanged(aHeight);
-        return CallState::Stop;
-      });
-}
 #endif
 
 bool nsView::RequestWindowClose(nsIWidget* aWidget) {
@@ -1078,24 +1092,6 @@ void nsView::SafeAreaInsetsChanged(const ScreenIntMargin& aSafeAreaInsets) {
   // https://github.com/w3c/csswg-drafts/issues/4670
   // Actually we don't set this value on sub document. This behaviour is
   // same as Blink.
-  CallOnAllRemoteChildren([windowSafeAreaInsets](
-                              dom::BrowserParent* aBrowserParent) -> CallState {
-    Unused << aBrowserParent->SendSafeAreaInsetsChanged(windowSafeAreaInsets);
-    return CallState::Continue;
-  });
-}
-
-bool nsView::IsPrimaryFramePaintSuppressed() {
-  return StaticPrefs::layout_show_previous_page() && mFrame &&
-         mFrame->PresShell()->IsPaintingSuppressed();
-}
-
-void nsView::CallOnAllRemoteChildren(
-    const std::function& aCallback) {
-  PresShell* presShell = mViewManager->GetPresShell();
-  if (!presShell) {
-    return;
-  }
 
   dom::Document* document = presShell->GetDocument();
   if (!document) {
@@ -1107,5 +1103,16 @@ void nsView::CallOnAllRemoteChildren(
     return;
   }
 
-  nsContentUtils::CallOnAllRemoteChildren(window, aCallback);
+  nsContentUtils::CallOnAllRemoteChildren(
+      window,
+      [windowSafeAreaInsets](dom::BrowserParent* aBrowserParent) -> CallState {
+        Unused << aBrowserParent->SendSafeAreaInsetsChanged(
+            windowSafeAreaInsets);
+        return CallState::Continue;
+      });
+}
+
+bool nsView::IsPrimaryFramePaintSuppressed() {
+  return StaticPrefs::layout_show_previous_page() && mFrame &&
+         mFrame->PresShell()->IsPaintingSuppressed();
 }
diff --git a/view/nsView.h b/view/nsView.h
index 158993614e6e..af87038b1705 100644
--- a/view/nsView.h
+++ b/view/nsView.h
@@ -15,7 +15,6 @@
 #include "nsIWidgetListener.h"
 #include "Units.h"
 #include "mozilla/Attributes.h"
-#include "mozilla/CallState.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/UniquePtr.h"
 
@@ -25,9 +24,6 @@ class nsIFrame;
 
 namespace mozilla {
 class PresShell;
-namespace dom {
-class BrowserParent;
-}  // namespace dom
 namespace widget {
 struct InitData;
 enum class TransparencyMode : uint8_t;
@@ -433,7 +429,6 @@ class nsView final : public nsIWidgetListener {
       mozilla::ScreenIntCoord aHeight) override;
   virtual void DynamicToolbarOffsetChanged(
       mozilla::ScreenIntCoord aOffset) override;
-  virtual void KeyboardHeightChanged(mozilla::ScreenIntCoord aHeight) override;
 #endif
   virtual bool RequestWindowClose(nsIWidget* aWidget) override;
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
@@ -519,10 +514,6 @@ class nsView final : public nsIWidgetListener {
   // Update the cached RootViewManager for all view manager descendents.
   void InvalidateHierarchy();
 
-  void CallOnAllRemoteChildren(
-      const std::function&
-          aCallback);
-
   nsViewManager* mViewManager;
   nsView* mParent;
   nsCOMPtr mWindow;
diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp
index 381549e4c567..fceb57587f63 100644
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1315,21 +1315,6 @@ class LayerViewSupport final
     gkWindow->UpdateDynamicToolbarMaxHeight(ScreenIntCoord(aHeight));
   }
 
-  void OnKeyboardHeightChanged(int32_t aHeight) {
-    MOZ_ASSERT(NS_IsMainThread());
-    auto win(mWindow.Access());
-    if (!win) {
-      return;  // Already shut down.
-    }
-
-    nsWindow* gkWindow = win->GetNsWindow();
-    if (!gkWindow) {
-      return;
-    }
-
-    gkWindow->KeyboardHeightChanged(ScreenIntCoord(aHeight));
-  }
-
   void SyncPauseCompositor() {
     MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
 
@@ -3274,16 +3259,6 @@ void nsWindow::UpdateDynamicToolbarOffset(ScreenIntCoord aOffset) {
   }
 }
 
-void nsWindow::KeyboardHeightChanged(ScreenIntCoord aHeight) {
-  if (mWidgetListener) {
-    mWidgetListener->KeyboardHeightChanged(aHeight);
-  }
-
-  if (mAttachedWidgetListener) {
-    mAttachedWidgetListener->KeyboardHeightChanged(aHeight);
-  }
-}
-
 ScreenIntMargin nsWindow::GetSafeAreaInsets() const { return mSafeAreaInsets; }
 
 void nsWindow::UpdateSafeAreaInsets(const ScreenIntMargin& aSafeAreaInsets) {
diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h
index bbf57c403005..94e199001af7 100644
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -245,8 +245,6 @@ class nsWindow final : public nsBaseWidget {
   mozilla::ScreenIntMargin GetSafeAreaInsets() const override;
   void UpdateSafeAreaInsets(const mozilla::ScreenIntMargin& aSafeAreaInsets);
 
-  void KeyboardHeightChanged(mozilla::ScreenIntCoord aHeight);
-
   mozilla::jni::NativeWeakPtr
   GetNPZCSupportWeakPtr();
 
diff --git a/widget/nsIWidgetListener.cpp b/widget/nsIWidgetListener.cpp
index b0e2c438e5ee..a554a6363660 100644
--- a/widget/nsIWidgetListener.cpp
+++ b/widget/nsIWidgetListener.cpp
@@ -40,7 +40,6 @@ void nsIWidgetListener::SafeAreaInsetsChanged(const mozilla::ScreenIntMargin&) {
 void nsIWidgetListener::DynamicToolbarMaxHeightChanged(ScreenIntCoord aHeight) {
 }
 void nsIWidgetListener::DynamicToolbarOffsetChanged(ScreenIntCoord aOffset) {}
-void nsIWidgetListener::KeyboardHeightChanged(ScreenIntCoord aHeight) {}
 #endif
 
 void nsIWidgetListener::MacFullscreenMenubarOverlapChanged(
diff --git a/widget/nsIWidgetListener.h b/widget/nsIWidgetListener.h
index d0d2e334704a..55a6987b0b52 100644
--- a/widget/nsIWidgetListener.h
+++ b/widget/nsIWidgetListener.h
@@ -84,11 +84,6 @@ class nsIWidgetListener {
 #if defined(MOZ_WIDGET_ANDROID)
   virtual void DynamicToolbarMaxHeightChanged(mozilla::ScreenIntCoord aHeight);
   virtual void DynamicToolbarOffsetChanged(mozilla::ScreenIntCoord aOffset);
-
-  /**
-   * Called when the software keyboard appears/disappears.
-   */
-  virtual void KeyboardHeightChanged(mozilla::ScreenIntCoord aHeight);
 #endif
 
   /**
diff --git a/xpcom/ds/StaticAtoms.py b/xpcom/ds/StaticAtoms.py
index cbb72ac8e0bb..82c9e3ca64bf 100644
--- a/xpcom/ds/StaticAtoms.py
+++ b/xpcom/ds/StaticAtoms.py
@@ -568,7 +568,6 @@ STATIC_ATOMS = [
     Atom("insertion", "insertion"),
     Atom("integer", "integer"),
     Atom("integrity", "integrity"),
-    Atom("interactive_widget", "interactive-widget"),
     Atom("internal", "internal"),
     Atom("internals", "internals"),
     Atom("intersection", "intersection"),