Bug 1578933 - Run scroll anchoring adjustments when blocking script. r=dholbert

I wanted to fix the more general problem and script-block more of
FlushPendingNotifications, but simple attempts to do that have resulted in
terribly orange try runs with very bizarre failures, so in the "perfect is the
enemy of good" spirit, fix the issue at hand (scroll anchoring adjustments not
dealing with layout reentering beneath them) by running them while
script-blocked, which is the right thing to do anyway.

Differential Revision: https://phabricator.services.mozilla.com/D47256

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-09-26 17:07:03 +00:00
parent cfe1667ccf
commit e0740e7784
2 changed files with 6 additions and 7 deletions

View File

@ -4157,10 +4157,6 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
mFrameConstructor->RecalcQuotesAndCounters();
viewManager->FlushDelayedResize(true);
if (ProcessReflowCommands(flushType < FlushType::Layout)) {
// We didn't get interrupted. Go ahead and perform scroll anchor
// adjustments and scroll content into view
FlushPendingScrollAnchorAdjustments();
if (mContentToScrollTo) {
DoScrollContentIntoView();
if (mContentToScrollTo) {
@ -9401,6 +9397,12 @@ bool PresShell::ProcessReflowCommands(bool aInterruptible) {
interrupted = !mDirtyRoots.IsEmpty();
overflowTracker.Flush();
if (!interrupted) {
// We didn't get interrupted. Go ahead and perform scroll anchor
// adjustments.
FlushPendingScrollAnchorAdjustments();
}
}
// Exiting the scriptblocker might have killed us

View File

@ -1,3 +0,0 @@
[anchoring-with-bounds-clamping-div.html]
[Anchoring combined with scroll bounds clamping in a <div>.]
expected: FAIL