Closed Bug 1704062 Opened 3 years ago Closed 3 years ago

Pinch to zoom or double tapping breaks links inside position: fixed

Categories

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

Firefox 89
defect

Tracking

()

VERIFIED FIXED
90 Branch
Tracking Status
firefox89 --- wontfix
firefox90 --- verified

People

(Reporter: TheOne, Assigned: botond)

References

(Blocks 2 open bugs)

Details

Attachments

(4 files)

Using pinch-to-zoom or double-tap-to-zoom breaks links on some websites. The links are not clickable anymore once you zoom beyond a certain level.

STR:

  1. Visit https://www.tagesspiegel.de/ . A cookie consent overlay should pop up.
  2. Zoom in using one of the aforementioned methods.

Expected result:
The links in the overlay should stay clickable no matter what the zoom level is.

Actual result:
Beyond a certain zoom level, the links in the overlay are not clickable anymore.

The links are in an iframe that is inside position: fixed, that probably has something to do with it.

Summary: Pinch to zoom or double tapping breaks links → Pinch to zoom or double tapping breaks links inside position: fixed
Severity: -- → S2
Priority: -- → P2
Assignee: nobody → botond

(In reply to Timothy Nikkel (:tnikkel) from comment #1)

The links are in an iframe that is inside position: fixed, that probably has something to do with it.

The page structure is notable in that, not only is the iframe inside a div that's position: fixed, but the <html> element of the parent document is position: fixed as well. With this sort of page structure, I can reproduce the hit testing issue in a simple constructed test case as well.

Attached file Reduced testcase

Attached is a reduced testcase. Pinch-zooming in and then clicking on the button inside the iframe demonstrates the problem.

Attached file RCD frame tree

Attached is a frame tree for the root content document in the reduced testcase.

The issue is related to the fact that the FixedList contains a frame (Block(html)(-1)@7fec3282cae0) which has the same content element (the <html> element) as the scroll frame (HTMLScroll(html)(-1)@7fec3282c1a8).

This leads to double application of the <html> element's callback transform (which represents the visual viewport offset) in GetCumulativeApzCallbackTransform(), as follows:

  1. Iteration starts at the <html> element's primary frame, which is the Block(html)(-1)@7fec3282cae0. Since this frame has the <html> as its content, the callback transform gets applied once.
  2. However, seenRcdRsf is not set, because we check for the scroll frame, not its content element.
  3. Iteration then reaches the ViewportFrame without encountering the scroll frame (because we're in the fixed list).
  4. We then apply the callback transform again here because we incorrectly think it hasn't already been applied.

The callback transform is stored as a content property, so the relevant
condition is whether we've seen a frame whose content element contains
the RCD-RSF callback transform.

Depends on D116061

Pushed by bballo@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/09e2d5795110
Fix include-what-you-use error in PositionedEventTargeting.cpp. r=tnikkel
https://hg.mozilla.org/integration/autoland/rev/2cf09d6dcf02
Set 'seenRcdRsf' correctly in GetCumulativeApzCallbackTransform(). r=tnikkel
Flags: qe-verify+

I have reproduced this on an affected Nightly build 89.0a1 (2021-04-09).
Confirming this issue as verified fixed on Win 10x64 and macOS 10.15, using Firefox 90.0b4 (2021-06-06).
Thanks!

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: