gecko-dev/layout/painting/crashtests
Kartikaya Gupta 40a788d924 Bug 1647034 - Change how the visual viewport is updated to eliminate spurious reflows. r=tnikkel
There's two code changes in this patch:

- The update to the visual viewport that was happening just before positioning
  the fixed items gets moved to happen after determining the scrollbars for
  the root scrollframe. This moves it a little bit earlier, to basically the
  earliest point at which the visual viewport can actually be computed, since
  it depends on the presence of the root scrollframe's scrollbars.

  More importantly, this change sets the visual viewport without checking to
  see if one was already set, as the old code did. This means every reflow
  of the root scrollframe on a presShell with an MVM will now have a visual
  viewport set. Previously the visual viewport would only get set for the first
  time when the MVM got a load or first-paint event, and then would get updated
  for subsequent reflows. The net effect here is that the visual viewport is
  set earlier, and this can sometimes eliminate extra reflows from after the
  load event, because everything is already in a consistent state.

- The NotifyResizeReflow call to MVM is replaced by a NotifyReflow call that
  runs before every reflow, instead of just on resizes. Note that the
  NotifyReflow also doesn't update the visual viewport like NotifyResizeReflow
  used to do, because that is taken care of by the above-mentioned code change
  to set the visual viewport.

  This is desirable because there are things that run during reflow that attempt
  to read the display size from the MVM, and they were getting a zero size
  for reflows that happened before the first resize or load/first-paint events.
  Now they get a valid display size on every reflow, and so again this allows
  fewer overall reflows as the code converges to a stable state faster.

Together these changes ensure that every reflow has access to up-to-date
properties (display size, mobile viewport size, visual viewport size) from the
MVM. This eliminates unnecessary reflows because of out-of-order computations
based on stale values and such. Therefore the number of reflows goes down,
which is reflected by the changes to the crashtest assertion counts.

Differential Revision: https://phabricator.services.mozilla.com/D81375
2020-06-29 18:39:57 +00:00
..
1402183-1.html
1405881-1.html
1407470-1.html
1413073-1.html
1413073-2.html
1418177-1.html
1418722-1.html
1419917.html
1425271-1.html
1428906-1.html
1430589-1.html
1454105-1.html
1455944-1.html
1465305-1.html
1468124-1.html
1469472.html
1477831-1.html
1504033.html
1514544-1.html
1547420-1.html
1549909.html
1551389-1.html
1555819-1.html
1574392.html
1589800-1.html
crashtests.list Bug 1647034 - Change how the visual viewport is updated to eliminate spurious reflows. r=tnikkel 2020-06-29 18:39:57 +00:00