Closed Bug 1496609 Opened 6 years ago Closed 5 years ago

Add tests of getViewportInfo with initial-scale smaller than min-scale

Categories

(DevTools :: Responsive Design Mode, defect, P1)

defect

Tracking

(firefox69 fixed)

RESOLVED FIXED
Firefox 69
Tracking Status
firefox69 --- fixed

People

(Reporter: hiro, Assigned: bradwerth)

References

(Blocks 1 open bug)

Details

(Whiteboard: [rdm-mvp] [dt-q])

Attachments

(2 files, 2 obsolete files)

STR

1. Open attachment 8855130 [details] in RDM
2. Enable touch simulation
Happens in Nightly only, not Stable or Dev Edition.
Priority: -- → P2
QA Contact: gl
Whiteboard: [dt-q]
I accidentally noticed how to solve this issue.
In MobileViewportManager::RefreshViewportSize we should also check nsLayoutUtils::ShouldHandleMetaViewport() along with gfxPrefs::APZAllowZooming() check [1].  And probably we also do the same thing in MobileViewportManager::RefreshVisualViewportSize().

[1] https://hg.mozilla.org/mozilla-central/file/e4220fa7a191/layout/base/MobileViewportManager.cpp#l413
Assignee: nobody → hikezoe
Status: NEW → ASSIGNED
Gah, simply adding ShouldHandleMetaViewport check breaks a bunch of test cases which enable dom.meta-viewport.enabled.

Botond, is it an intentional behavior that MobileViewportManager is generated when the pref is true?  (I thought ShouldHandleMetaViewport just simply returns true when the touch simulator is enabled on RDM).  If so, we will figure out another way to solve this bug.
Flags: needinfo?(botond)
(In reply to Hiroyuki Ikezoe (:hiro) from comment #4)
> Gah, simply adding ShouldHandleMetaViewport check breaks a bunch of test
> cases which enable dom.meta-viewport.enabled.
> 
> Botond, is it an intentional behavior that MobileViewportManager is
> generated when the pref is true?  (I thought ShouldHandleMetaViewport just
> simply returns true when the touch simulator is enabled on RDM).  If so, we
> will figure out another way to solve this bug.

We need a MobileViewportManager for correct handling of a meta viewport tag, so we create one when touch simulation is enabled in RDM (when we want to start respecting the page's meta viewport tag).

Let me know if that answers your question. I don't understand the breakage you mention, if you go into more detail I might be able to suggest something.
Flags: needinfo?(botond)
Blocks: rdm-ux

Once Bug 1521814 lands, this issue will need the pref dom.meta-viewport.enabled set to true in order to properly test it.

(In reply to Brad Werth [:bradwerth] from comment #6)

Once Bug 1521814 lands, this issue will need the pref dom.meta-viewport.enabled set to true in order to properly test it.

Update: the relevant pref is devtools.responsive.metaViewport.enabled.

No longer blocks: rdm-ux

Hello Hiroyuki. Want to confirm if you are still working on this bug or if it can be reassigned to a member of the RDM Team? Thanks.

Flags: needinfo?(hikezoe)
Whiteboard: [dt-q] → [rdm-mvp] [dt-q]

I attempted to reproduce this bug and noticed a more severe problem that's appeared since the bug was filed. After returning from RDM, the page content is cropped to a much smaller area. According to mozregression, this new unwanted behavior appeared with the landing of Bug 1501665. That isn't terribly surprising since that bug changed so much.

Not changing the bug title yet because these results are probably related to the same cause. In other words, the scrollbars being cropped to a too-small rectangle (the original bug) is now joined by the viewport being cropped to a too-small rectangle.

Attachment 8855130 [details] has meta viewport tag:

<meta name="viewport" content="width=250, initial-scale=0.01">

initial-scale is the likely issue for this problem. I don't think we have good test coverage of RDM with initial-scale.

No, I am not actively working on this any more. Thanks!

(In reply to Brad Werth [:bradwerth] from comment #10)

Attachment 8855130 [details] has meta viewport tag:

<meta name="viewport" content="width=250, initial-scale=0.01">

initial-scale is the likely issue for this problem. I don't think we have good test coverage of RDM with initial-scale.

FWIW, the behavior for cases where initial-scale < 0.25 might be changed by bug 1550105, since the spec says non negative scale value is clamped to the range [0.1, 10], and we changed the value of the minimum boundary to 0.25 in bug 1510214.

Assignee: hikezoe → nobody
Status: ASSIGNED → NEW
Flags: needinfo?(hikezoe)

Still thinking this through. The call to nsPresContext::SetVisibleArea is getting correct values, but the visible area is getting scaled by the very high resolution value that was used by the RDM mode with meta viewport on. You can see the content cropping bug just by toggling touch simulation button (which also controls meta viewport).

Assignee: nobody → bwerth
Status: NEW → ASSIGNED
Priority: P2 → P1

This is another one that's difficult to test in an automated fashion. I'll request review of the patch as-is with an explanation of the difficulties.

I've been wondering we can simulate RDM in our reftest harness.

Hiro, would you please test that the attached patch solves the issue you found with the scrollbars? I was never really able to replicate that issue but instead found this screen cropping issue instead. I hope that the patch will resolve the issue you found, as well.

Flags: needinfo?(hikezoe)

It's been already fixed by you! Bug 1521814 fixed the issue I mentioned in comment 0. Thank you!

Flags: needinfo?(hikezoe)

(In reply to Hiroyuki Ikezoe (:hiro) from comment #18)

It's been already fixed by you! Bug 1521814 fixed the issue I mentioned in comment 0. Thank you!

In that case, would you please retest with the pref devtools.responsive.metaViewport.enabled set? That's all that Bug 1521814 affected.

Flags: needinfo?(hikezoe)

With the pref set (true) the scrollbars in the example in question are not incorrectly rendered but initial-scale=0.1 seems not to be applied. But with the binary in the try in comment 14 the example looks fine to me.

Flags: needinfo?(hikezoe)
Attachment #9066570 - Attachment is obsolete: true
Attachment #9067049 - Attachment description: Bug 1496609 Part 1: Make GetViewportInfo properly constraint mScaleFloat to [min, max]. → Bug 1496609 Part 1: Make GetViewportInfo properly constrain mScaleFloat to [min, max].
Attachment #9067049 - Attachment description: Bug 1496609 Part 1: Make GetViewportInfo properly constrain mScaleFloat to [min, max]. → Bug 1496609 Part 1: Make GetViewportInfo properly constraint mScaleFloat to [min, max].
Attachment #9067049 - Attachment description: Bug 1496609 Part 1: Make GetViewportInfo properly constraint mScaleFloat to [min, max]. → Bug 1496609 Part 1: Make GetViewportInfo properly report viewport sizes when initial-scale is less than min-scale.

It appears this has been fixed by Bug 1550105.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Whiteboard: [rdm-mvp] [dt-q] → [dt-q]

We might as well still land the test.

I just came to the same conclusion. The tests for Bug 1550105 don't go through getViewportInfo, and that seems useful to test as well.

Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Summary: Scrollbars are incorrectly rendered → Add tests of getViewportInfo with initial-scale smaller than min-scale
Attachment #9067049 - Attachment is obsolete: true
Attachment #9067134 - Attachment description: Bug 1496609 Part 2: Add a test of getViewportInfo clamping initial-scale to min-scale. → Bug 1496609 Part 1: Add a test of getViewportInfo clamping initial-scale to min-scale.
Pushed by bwerth@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4b337e189320
Part 1: Add a test of getViewportInfo clamping initial-scale to min-scale. r=botond
Status: REOPENED → ASSIGNED
Whiteboard: [dt-q] → [rdm-mvp] [dt-q]
Status: ASSIGNED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: