mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1178354 - Ensure we fire a before-first-paint event for printing as well. r=tn
This commit is contained in:
parent
6bc3f407c4
commit
d005fffd01
@ -1736,6 +1736,12 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
|
||||
}
|
||||
}
|
||||
|
||||
// If we get here and painting is not suppressed, then we can paint anytime
|
||||
// and we should fire the before-first-paint notification
|
||||
if (!mPaintingSuppressed) {
|
||||
ScheduleBeforeFirstPaint();
|
||||
}
|
||||
|
||||
if (root && root->IsXULElement()) {
|
||||
mozilla::Telemetry::AccumulateTimeDelta(Telemetry::XUL_INITIAL_FRAME_CONSTRUCTION,
|
||||
timerStart);
|
||||
@ -3773,6 +3779,17 @@ PresShell::CaptureHistoryState(nsILayoutHistoryState** aState)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::ScheduleBeforeFirstPaint()
|
||||
{
|
||||
if (!mDocument->IsResourceDoc()) {
|
||||
// Notify observers that a new page is about to be drawn. Execute this
|
||||
// as soon as it is safe to run JS, which is guaranteed to be before we
|
||||
// go back to the event loop and actually draw the page.
|
||||
nsContentUtils::AddScriptRunner(new nsBeforeFirstPaintDispatcher(mDocument));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::UnsuppressAndInvalidate()
|
||||
{
|
||||
@ -3784,12 +3801,7 @@ PresShell::UnsuppressAndInvalidate()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mDocument->IsResourceDoc()) {
|
||||
// Notify observers that a new page is about to be drawn. Execute this
|
||||
// as soon as it is safe to run JS, which is guaranteed to be before we
|
||||
// go back to the event loop and actually draw the page.
|
||||
nsContentUtils::AddScriptRunner(new nsBeforeFirstPaintDispatcher(mDocument));
|
||||
}
|
||||
ScheduleBeforeFirstPaint();
|
||||
|
||||
mPaintingSuppressed = false;
|
||||
nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
|
||||
|
@ -413,6 +413,7 @@ protected:
|
||||
void HandlePostedReflowCallbacks(bool aInterruptible);
|
||||
void CancelPostedReflowCallbacks();
|
||||
|
||||
void ScheduleBeforeFirstPaint();
|
||||
void UnsuppressAndInvalidate();
|
||||
|
||||
void WillCauseReflow() {
|
||||
|
Loading…
Reference in New Issue
Block a user