mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Backout changeset 674cde7d007a (bug 770000 because DLBI is being backed out
This commit is contained in:
parent
8471850074
commit
d08ef39a09
@ -55,15 +55,16 @@ function childFocused() {
|
||||
|
||||
function childResized() {
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
|
||||
is(win.windowState, win.STATE_MAXIMIZED,
|
||||
"window should be maximized");
|
||||
|
||||
if (isOSXLion) {
|
||||
todo_is(win.windowState, win.STATE_MAXIMIZED,
|
||||
"A resize before being maximized breaks this test on 10.7");
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
is(win.windowState, win.STATE_MAXIMIZED,
|
||||
"window should be maximized");
|
||||
|
||||
isnot(win.innerWidth, 300,
|
||||
"window inner width should have changed");
|
||||
|
||||
|
@ -341,7 +341,7 @@ void nsViewManager::Refresh(nsView *aView, const nsIntRegion& aRegion,
|
||||
printf("--COMPOSITE-- %p\n", mPresShell);
|
||||
#endif
|
||||
mPresShell->Paint(aView, damageRegion, nsIPresShell::PaintType_Composite,
|
||||
false);
|
||||
aWillSendDidPaint);
|
||||
#ifdef DEBUG_INVALIDATIONS
|
||||
printf("--ENDCOMPOSITE--\n");
|
||||
#endif
|
||||
@ -387,27 +387,6 @@ bool nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
|
||||
aView->SkippedPaint();
|
||||
skipped = true;
|
||||
} else {
|
||||
// If an ancestor widget was hidden and then shown, we could
|
||||
// have a delayed resize to handle.
|
||||
for (nsViewManager *vm = this; vm;
|
||||
vm = vm->mRootView->GetParent()
|
||||
? vm->mRootView->GetParent()->GetViewManager()
|
||||
: nsnull) {
|
||||
if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
|
||||
vm->mRootView->IsEffectivelyVisible() &&
|
||||
mPresShell && mPresShell->IsVisible()) {
|
||||
vm->FlushDelayedResize(true);
|
||||
vm->InvalidateView(vm->mRootView);
|
||||
}
|
||||
}
|
||||
|
||||
// Flush things like reflows and plugin widget geometry updates by
|
||||
// calling WillPaint on observer presShells.
|
||||
nsRefPtr<nsViewManager> rootVM = RootViewManager();
|
||||
if (mPresShell) {
|
||||
rootVM->CallWillPaintOnObservers(true);
|
||||
}
|
||||
|
||||
aView->ClearSkippedPaints();
|
||||
aView->SetPendingRefresh(false);
|
||||
widget->SetNeedsPaint(false);
|
||||
@ -416,13 +395,11 @@ bool nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
|
||||
printf("---- PAINT START ----PresShell(%p), nsView(%p), nsIWidget(%p)\n", mPresShell, aView, widget);
|
||||
#endif
|
||||
nsAutoScriptBlocker scriptBlocker;
|
||||
mPresShell->Paint(aView, nsRegion(), nsIPresShell::PaintType_NoComposite, true);
|
||||
mPresShell->Paint(aView, nsRegion(), nsIPresShell::PaintType_NoComposite, false);
|
||||
#ifdef DEBUG_INVALIDATIONS
|
||||
printf("---- PAINT END ----\n");
|
||||
#endif
|
||||
SetPainting(false);
|
||||
|
||||
rootVM->CallDidPaintOnObserver();
|
||||
}
|
||||
}
|
||||
FlushDirtyRegionToWidget(aView);
|
||||
@ -755,6 +732,35 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
break;
|
||||
|
||||
*aStatus = nsEventStatus_eConsumeNoDefault;
|
||||
|
||||
nsPaintEvent *event = static_cast<nsPaintEvent*>(aEvent);
|
||||
|
||||
NS_ASSERTION(static_cast<nsView*>(aView) ==
|
||||
nsView::GetViewFor(event->widget),
|
||||
"view/widget mismatch");
|
||||
|
||||
// If an ancestor widget was hidden and then shown, we could
|
||||
// have a delayed resize to handle.
|
||||
for (nsViewManager *vm = this; vm;
|
||||
vm = vm->mRootView->GetParent()
|
||||
? vm->mRootView->GetParent()->GetViewManager()
|
||||
: nsnull) {
|
||||
if (vm->mDelayedResize != nsSize(NSCOORD_NONE, NSCOORD_NONE) &&
|
||||
vm->mRootView->IsEffectivelyVisible() &&
|
||||
mPresShell && mPresShell->IsVisible()) {
|
||||
vm->FlushDelayedResize(true);
|
||||
vm->InvalidateView(vm->mRootView);
|
||||
}
|
||||
}
|
||||
|
||||
// Flush things like reflows and plugin widget geometry updates by
|
||||
// calling WillPaint on observer presShells.
|
||||
nsRefPtr<nsViewManager> rootVM = RootViewManager();
|
||||
if (mPresShell) {
|
||||
rootVM->CallWillPaintOnObservers(event->willSendDidPaint);
|
||||
}
|
||||
// Flush view widget geometry updates and invalidations.
|
||||
rootVM->ProcessPendingUpdates();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -772,6 +778,17 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
"shouldn't be receiving paint events while painting is "
|
||||
"disallowed!");
|
||||
|
||||
if (!event->didSendWillPaint) {
|
||||
// Send NS_WILL_PAINT event ourselves.
|
||||
nsPaintEvent willPaintEvent(true, NS_WILL_PAINT, event->widget);
|
||||
willPaintEvent.willSendDidPaint = event->willSendDidPaint;
|
||||
DispatchEvent(&willPaintEvent, view, aStatus);
|
||||
|
||||
// Get the view pointer again since NS_WILL_PAINT might have
|
||||
// destroyed it during CallWillPaintOnObservers (bug 378273).
|
||||
view = nsView::GetViewFor(event->widget);
|
||||
}
|
||||
|
||||
if (!view || event->region.IsEmpty())
|
||||
break;
|
||||
|
||||
@ -782,6 +799,8 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent,
|
||||
}
|
||||
|
||||
case NS_DID_PAINT: {
|
||||
nsRefPtr<nsViewManager> rootVM = RootViewManager();
|
||||
rootVM->CallDidPaintOnObserver();
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user