Closed Bug 1749661 Opened 3 years ago Closed 2 years ago

Resize event for visualViewport in iframe doesn't fire if container element was hidden

Categories

(Core :: Panning and Zooming, defect, P2)

Firefox 95
defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: iriz1994, Assigned: tnikkel)

References

Details

Attachments

(2 files)

Steps to reproduce:

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:95.0) Gecko/20100101 Firefox/95.0

Resize event for visualViewport in iframe doesn't fire if container element was hidden.

(1) Open https://jsfiddle.net/kq1Lc0fo/
(2) Open the console

Actual results:

Only "W resize" output

Expected results:

Print "VW resize" and "W resize" after page is loaded

The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Printing: Output
Product: Firefox → Core
Component: Printing: Output → Panning and Zooming

I can reproduce, but only about 20% of the time.

Blocks: 1725569

I added this check in bug 1725569 because I said it matched other browsers. I'm not sure what testing I did there, or I made a mistake or what but the behaviour is not consistent between browsers.

For top level documents on initial load Safari sends a resize event, Chrome does not. Firefox sends a resize event.

For iframes Chrome and Safari send a resize event. Firefox usually sends a resize event.

Given the inconsistent behaviour here it seems better to err on the side of sending resize events because sites depend on it and might not work without it.

In the testcase from the bug I am able to reproduce about 20% of the time, and the problem is the first reflow check. So I'm removing that and I think it will fix the problem the user is seeing (which sounds to be more consistent).

Assignee: nobody → tnikkel
Severity: -- → S3
Priority: -- → P2
Pushed by tnikkel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/47c0d5a85cd7
Always fire visual viewport resize event even if first reflow. r=botond
https://hg.mozilla.org/integration/autoland/rev/e2dfad4efbed
Add test. r=botond
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/32424 for changes under testing/web-platform/tests
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: