зеркало из https://github.com/mozilla/gecko-dev.git
Bug 641188. Ensure that delayed resizes are flushed from the view subsystem to the prescontext's visible area before using the visible area for innerWidth/Height. r=bz
This commit is contained in:
Родитель
b564a8d6d4
Коммит
5ac0591ef9
|
@ -4068,8 +4068,13 @@ nsGlobalWindow::GetInnerWidth(int32_t* aInnerWidth)
|
|||
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
nsRefPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||
|
||||
if (presContext) {
|
||||
if (presContext && presShell) {
|
||||
nsRefPtr<nsViewManager> viewManager = presShell->GetViewManager();
|
||||
if (viewManager) {
|
||||
viewManager->FlushDelayedResize(false);
|
||||
}
|
||||
nsRect shellArea = presContext->GetVisibleArea();
|
||||
*aInnerWidth = nsPresContext::AppUnitsToIntCSSPixels(shellArea.width);
|
||||
} else {
|
||||
|
@ -4136,8 +4141,13 @@ nsGlobalWindow::GetInnerHeight(int32_t* aInnerHeight)
|
|||
|
||||
nsRefPtr<nsPresContext> presContext;
|
||||
mDocShell->GetPresContext(getter_AddRefs(presContext));
|
||||
nsRefPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||
|
||||
if (presContext) {
|
||||
if (presContext && presShell) {
|
||||
nsRefPtr<nsViewManager> viewManager = presShell->GetViewManager();
|
||||
if (viewManager) {
|
||||
viewManager->FlushDelayedResize(false);
|
||||
}
|
||||
nsRect shellArea = presContext->GetVisibleArea();
|
||||
*aInnerHeight = nsPresContext::AppUnitsToIntCSSPixels(shellArea.height);
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче