Bug 1896760 - Make resize event timing match the spec. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D210383
This commit is contained in:
Emilio Cobos Álvarez
2024-05-15 16:22:13 +00:00
parent 0df00f724e
commit 2844cddbc3

View File

@@ -2658,21 +2658,7 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime,
}
}
// Resize events should be fired before layout flushes or calling animation
// frame callbacks.
// Step 8. For each doc of docs, run the resize steps for doc.
// FIXME(emilio, bug 1896760): This should happen per spec below, near the
// scroll steps.
DispatchResizeEvents();
DispatchVisualViewportResizeEvents();
if (!mPresContext || !mPresContext->GetPresShell()) {
return StopTimer();
}
// Dispatch coalesced input events.
// FIXME(emilio, bug 1896760): This should happen before resize events
// probably.
if (!TickObserverArray(0, aNowTime)) {
return StopTimer();
}
@@ -2714,6 +2700,10 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime,
// node navigable is a top-level traversable.
FlushAutoFocusDocuments();
// Step 8. For each doc of docs, run the resize steps for doc.
DispatchResizeEvents();
DispatchVisualViewportResizeEvents();
// Step 9. For each doc of docs, run the scroll steps for doc.
DispatchScrollEvents();
DispatchVisualViewportScrollEvents();