Bug 1661544 - Ensure initial viewport is computed before reporting innerWidth. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88947
This commit is contained in:
@@ -161,6 +161,7 @@
|
||||
#include "nsBlockFrame.h"
|
||||
|
||||
#include "DOMMatrix.h"
|
||||
#include "MobileViewportManager.h"
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
# include "nsAccessibilityService.h"
|
||||
@@ -845,13 +846,17 @@ nsRect Element::GetClientAreaRect() {
|
||||
// We will always have a pres shell if we have a pres context, and we will
|
||||
// only get here if we have a pres context from the root content document
|
||||
// check
|
||||
PresShell* presShell = doc->GetPresShell();
|
||||
RefPtr<PresShell> presShell = doc->GetPresShell();
|
||||
|
||||
// Ensure up to date dimensions, but don't reflow
|
||||
RefPtr<nsViewManager> viewManager = presShell->GetViewManager();
|
||||
if (viewManager) {
|
||||
viewManager->FlushDelayedResize(false);
|
||||
}
|
||||
if (RefPtr<MobileViewportManager> mvm =
|
||||
presShell->GetMobileViewportManager()) {
|
||||
mvm->EnsureInitialViewportSet();
|
||||
}
|
||||
return nsRect(nsPoint(), presContext->GetVisibleArea().Size());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user