Bug 1937785 - Remove nsPresContext::mKeyboardHeight and introduce MobileViewportManager::mPendingKeyboardHeight. r=botond

There's a race condition where the keyboard height change notification
has arrived but nsDocumentViewer size change hasn't yet arrived.

MobileViewportManager::mPendingKeyboardHeight is introduced to fix the race.

Differential Revision: https://phabricator.services.mozilla.com/D234262
This commit is contained in:
Hiroyuki Ikezoe
2025-01-22 20:49:57 +00:00
parent afc3d02460
commit 00782a4f37
5 changed files with 24 additions and 12 deletions

View File

@@ -11418,7 +11418,11 @@ void PresShell::MaybeRecreateMobileViewportManager(bool aAfterInitialization) {
("Created MVM %p (type %d) for URI %s", mMobileViewportManager.get(),
(int)*mvmType, uri ? uri->GetSpecOrDefault().get() : "(null)"));
}
if (BrowserChild* browserChild = BrowserChild::GetFrom(this)) {
mMobileViewportManager->UpdateKeyboardHeight(browserChild->GetKeyboardHeight());
}
}
if (aAfterInitialization) {
// Setting the initial viewport will trigger a reflow.
if (mMobileViewportManager) {