Some cleanups for viewport handling

RESOLVED FIXED in Firefox 65

Status

()

enhancement
P3
normal
RESOLVED FIXED
10 months ago
10 months ago

People

(Reporter: hiro, Assigned: hiro)

Tracking

Trunk
mozilla65
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox65 fixed)

Details

Attachments

(3 attachments, 1 obsolete attachment)

I am going to drop nsIDocument::mAutoSize with various test cases here in this bug.
This is a follow-up fix for bug 1431601, I didn't notice that we constrain
mMaxZoom in here nsViewport class.
In bug 1431601, instead we did constrain the value in nsIDocument::GetViewportInfo
since the contrained value is used in the function.
It would be clear that |displayWidthChangeRatio| is set only in an
|if (aForceAdjustResolution)| block.

Depends on D9459
Following four conditions are where nsIDocument::mAutoSize is true and
test cases for each condition. The conditions are the cases where we
currently set nsIDocument::mAutoSize true in nsIDocument:GetViewportInfo.

1) width=device-width
  test_meta_viewport_auto_size_by_device_width.html
2) no width && height=device-height
  test_meta_viewport_auto_size_by_device_height.html
3) no width && initial-scale=1
  test_meta_viewport_auto_size_by_fixed_height_and_initial_scale_1.html
  test_meta_viewport_auto_size_by_initial_scale_1.html
4) invalid width && (invalid height || no height)
  test_meta_viewport_auto_size_by_invalid_width.html

Below tests are cases that autoSize is disabled.
  test_meta_viewport_auto_size_by_fixed_width_and_initial_scale_1.html
  test_meta_viewport_auto_size_by_fixed_width_and_device_height.html
  test_meta_viewport_auto_size_by_initial_scale_0_5.html
  test_meta_viewport_auto_size_by_invalid_width_and_fixed_height.html

Depends on D9460
I guess we can eventually replace the conditions for autoSize with
`width == nsViewportInfo::Auto` or `height == nsViewportInfo::Auto`, but it
will break current behavior so for now we are going to preserve the current
behavior.  For example, we currently consider no viewport meta tag means
autoSize is disabled but it should be an autoSize case.

Depends on D9461
Attachment #9019212 - Attachment is obsolete: true
Attachment #9019211 - Attachment description: Bug 1501106 - Drop constain max zoom in nsViewportInfo. r=botond → Bug 1501106 - Drop constaint of max zoom in nsViewportInfo. r=botond
Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/09f5387e2002
Drop constaint of max zoom in nsViewportInfo. r=botond
https://hg.mozilla.org/integration/autoland/rev/e46f20ef7d4c
Various test cases checking current autoSize behavior. r=botond
https://hg.mozilla.org/integration/autoland/rev/40b1b00e610a
Drop nsIDocument::mAutoSize and relevant members. r=botond
Attachment #9019211 - Attachment description: Bug 1501106 - Drop constaint of max zoom in nsViewportInfo. r=botond → Bug 1501106 - Drop constraint of max zoom in nsViewportInfo. r=botond
You need to log in before you can comment on or make changes to this bug.