Bug 1986701 - Link mChildView only after mNativeLayerRoot is initialized. a=RyanVM DONTBUILD

Original Revision: https://phabricator.services.mozilla.com/D263616

Differential Revision: https://phabricator.services.mozilla.com/D263736
This commit is contained in:
Steven Michaud
2025-09-05 01:43:10 +00:00
committed by rvandermeulen@mozilla.com
parent dbbe73f5d7
commit 1c0eec2481

View File

@@ -4609,12 +4609,15 @@ nsresult nsCocoaWindow::Create(nsIWidget* aParent, const DesktopIntRect& aRect,
initWithFrame:mWindow.childViewFrameRectForCurrentBounds
geckoChild:this];
mChildView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
[contentView addSubview:mChildView];
mNativeLayerRoot =
NativeLayerRootCA::CreateForCALayer(mChildView.rootCALayer);
mNativeLayerRoot->SetBackingScale(BackingScaleFactor());
// Link mChildView into the native NSView hierarchy only after
// mNativeLayerRoot is initialized. This resolves bug 1986701.
[contentView addSubview:mChildView];
[WindowDataMap.sharedWindowDataMap ensureDataForWindow:mWindow];
NS_ASSERTION(!mTextInputHandler, "mTextInputHandler has already existed");