Bug 1282334 part 2 - Ensure scheduling flush for fullscreen change. r?smaug
The refresh driver may not be triggered regularly if the page is static.
In that case, we need to ensure a flush is scheduled for fullscreen
change, otherwise the page may get stuck.
MozReview-Commit-ID: c5FhqaIUQW
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -3203,16 +3203,20 @@ static void
PrepareForFullscreenChange(nsIPresShell* aPresShell, const nsSize& aSize,
nsSize* aOldSize = nullptr)
{
if (!aPresShell) {
return;
}
if (nsRefreshDriver* rd = aPresShell->GetRefreshDriver()) {
rd->SetIsResizeSuppressed();
+ // Since we are suppressing the resize reflow which would originally
+ // be triggered by view manager, we need to ensure that the refresh
+ // driver actually schedules a flush, otherwise it may get stuck.
+ rd->ScheduleViewManagerFlush();
}
if (!aSize.IsEmpty()) {
if (nsViewManager* viewManager = aPresShell->GetViewManager()) {
if (aOldSize) {
viewManager->GetWindowDimensions(&aOldSize->width, &aOldSize->height);
}
viewManager->SetWindowDimensions(aSize.width, aSize.height);
}