Open Bug 1702407 Opened 4 years ago Updated 4 years ago

Incorrect scrollX/scrollY value when use meta viewport in RDM

Categories

(Core :: Layout: Scrolling and Overflow, defect)

Firefox 89
defect

Tracking

()

People

(Reporter: noiseyou99, Unassigned)

Details

Attachments

(2 files)

Attached file viewport.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36
Firefox for Android

Steps to reproduce:

  1. set pref dom.meta-viewport.enabled to true
  2. Use Inspect and responsive => 240 x 375
  3. open/use attachment html
  4. scrollTo(0,30) and scrollY is 0 -- KO
  5. scrollTo(30,0) and scrollX is 0 -- KO

Actual results:

Incorrect scrollX/scrollY
scrollTo(0,30) and scrollY is 0
scrollTo(30,0) and scrollX is 0

Expected results:

scrollTo(0,30) and scrollY is 30
scrollTo(30,0) and scrollX is 30

Component: Untriaged → Layout: Scrolling and Overflow
Product: Firefox → Core

That's because the root element is not scrollable. If you scroll the content by hand (mouse wheel or some) and query document.scrollingElement.scrollTop then you will see 0. Instead visualViewport.offsetTop is not 0.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID

Weird, scrollTo(0, 30) worked now. There's definitely something I am missing.

Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---

This is something in RDM. On mobile scrollTo works always, but in RDM window.scrollMaxY and window.scrollMaxX are zero in the case where scrollTo doesn't work.

Attached patch patch.diffSplinter Review

I think something wrong in UpdateMinimumScaleSize,
I try this patch/attachment, it can work fine.

Flags: needinfo?(hikezoe.birchill)

As I commented in Matrix, the change doesn't look correct to me. Whether we apply the minimum scale or not is not affected by the current zoom level.

Flags: needinfo?(hikezoe.birchill)

Anyway, I confirmed this issue yesterday.

Also note that setting "dom.meta-viewport.enabled" is not necessary to reproduce this issue.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Incorrect scrollX/scrollY value when use meta viewport → Incorrect scrollX/scrollY value when use meta viewport in RDM
Severity: -- → S3

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

Anyway, I confirmed this issue yesterday.

Also note that setting "dom.meta-viewport.enabled" is not necessary to reproduce this issue.
Hi,
How to reproduce this issue when "dom.meta-viewport.enabled" is flase?

Flags: needinfo?(hikezoe.birchill)

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

Anyway, I confirmed this issue yesterday.

Also note that setting "dom.meta-viewport.enabled" is not necessary to reproduce this issue.

Hi,
How to reproduce this issue when "dom.meta-viewport.enabled" is flase?

In RDM even if "dom.meta-viewport.enabled" is false, it properly emulates mobile viewport stuff.

Flags: needinfo?(hikezoe.birchill)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: