Closed Bug 1566991 Opened 5 years ago Closed 5 years ago

Add some assertions to validate that mobile viewport zoom factors are positive

Categories

(Core :: Layout: Scrolling and Overflow, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

As noted in bug 1566824, it's apparently possible for MobileViewportManager to call into nsLayoutUtils::SetVisualViewportSize with a negative (or perhaps NaN) aSize arg, which trips a fatal assertion.

Per bug 1566824 comment 2, I only see this being possible if we're somehow using a zoom factor whose value is 0 or negative for the expression CSSSize compSize = compositionSize / aZoom;

I don't see a lot of clamping around this aZoom value. Let's add some assertions to help catch this problem a bit earlier on and shine light on places where clamping may be missing.

Bugbug thinks this bug is a task, but please change it back in case of error.

Type: defect → task

Try run to be sure these assertions don't insta-fail in our existing testsuite:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=24e87784821fb0afaa0bf2cf14a9d90f10d931f8

Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/58eb45e75568
Add some assertions to sanity-check that our mobile viewport zoom factors are positive. r=botond

Oops, sorry -- I noticed that build failure locally & forgot to post my tweak before landing.

Flags: needinfo?(dholbert)

The build-fixing tweak was included in my Try run in comment 3 (even though I forgot to update phabricator), so I'm pretty confident that we're good with that.

Retriggered autoland.

Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ac8dd9828c25
Add some assertions to sanity-check that our mobile viewport zoom factors are positive. r=botond
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Blocks: 1568405
Blocks: 1568673
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: