Closed Bug 1528052 Opened 5 years ago Closed 5 years ago

Fennec and Geckoview fire resize events on page-load while Chromium does not


(Core :: Layout, defect, P1)




Tracking Status
firefox67 --- wontfix
firefox68 --- fixed


(Reporter: twisniewski, Assigned: hiro)


(Blocks 1 open bug, )


(Keywords: dev-doc-complete, Whiteboard: [webcompat:p1][wptsync upstream])


(1 file)

Based on a trivial test-case:

<!DOCTYPE html>
    window.addEventListener("resize", function() {
      document.body.appendChild(document.createTextNode("resize "));

It seems as though Firefox fires a resize event during page-load while Chromium does not (though Chromium does fire similar resize events when the device changes orientation).

This extra resize event is throwing off the scripts at, which do not expect it, and causes their page to not load properly.

Flags: webcompat?
Priority: -- → P3

This is also affecting, making the page never stop (re)loading.

Component: DOM: Events → Layout

Hiro, you've done a bunch of viewport-related stuff, any chance you know what's going on here?

Flags: needinfo?(hikezoe)

The initial resize event is triggered from ResizeReflowIgnoreOverride call in RefreshVisualViewportSize on the initial paint. Probably we don't need the resize event at that time.

Also, in bug 1149555 unfortunately (accidentally?) we dropped the check whether the size is changed.

Assignee: nobody → hikezoe
Flags: needinfo?(hikezoe)

I thought initially we can avoid the resize event on the case where nsIPresShell::mIsFirstPaint is true, but it breaks existing test cases a lot.

We should probably avoid the event only on the case MobileViewportManager::mIsFirstPaint is true. Here is a try.
Probably a candidate for this bug.

ni? myself to discuss this at next webcompat triage.

Flags: needinfo?(svoisen)
Flags: webcompat? → webcompat+
Whiteboard: [webcompat] → [webcompat:p1]

@Hiro: Would you mind prioritizing this once all of the scroll snap and current Fission work is complete?

Flags: needinfo?(svoisen) → needinfo?(hikezoe)

Sure, I can finish this in 68 train.

Flags: needinfo?(hikezoe)
Priority: P3 → P1
Pushed by
Suppress resize events until the initial paint has finished on mobile. r=botond
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Created web-platform-tests PR for changes under testing/web-platform/tests
Whiteboard: [webcompat:p1] → [webcompat:p1][wptsync upstream]

It seems like a largish change to uplift but it was recentely raised to P1, so I am marking it as fix-optional until there is confirmation that we don't need this is 67 or that we want it but it is extra safe to uplift.

Documentation updated:

Regressions: 1551659
See Also: → 1768527
You need to log in before you can comment on or make changes to this bug.