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:
Timothy Nikkel 2013-06-12 10:25:32 -05:00
Родитель b564a8d6d4
Коммит 5ac0591ef9
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -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 {