Open Bug 1840166 Opened 2 years ago Updated 3 months ago

Difference in scroll anchoring suppression between Firefox and Chrome

Categories

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

Firefox 115
defect

Tracking

()

Webcompat Score 5
Webcompat Priority P1
Tracking Status
firefox-esr102 --- unaffected
firefox-esr115 --- unaffected
firefox114 --- unaffected
firefox115 --- disabled
firefox116 --- disabled
firefox117 --- disabled
firefox118 --- disabled
firefox119 --- disabled

People

(Reporter: ksenia, Unassigned, NeedInfo)

References

(Blocks 1 open bug, Regression, )

Details

(6 keywords, Whiteboard: [webcompat:sightline])

User Story

platform:windows,mac,linux,android
impact:site-broken
configuration:general
affects:all
branch:release
user-impact-score:2000
diagnosis-team:layout

Attachments

(1 file, 2 obsolete files)

This was originally reported in https://github.com/webcompat/web-bugs/issues/123254

To reproduce, visit https://www.tvmovie.de/tv/fernsehprogramm in Nightly 116.0a1 (2023-06-23) and try to scroll down.

Actual:
Scrollbar returns to the top of the page

Expected:
Scrollbar stays in the same position where you finished scrolling

From mozregression: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5eb0c339e4a6c919642f1e70d15347b766ceec00&tochange=4adf1e46346688c72a6dbaeb5e965cfee658401b

Hello Hiroyuki, wonder if you could take a look at this, please?

Flags: needinfo?(hikezoe.birchill)

Set release status flags based on info from the regressing bug 1833758

Attached file A minimized test case (obsolete) —

It still depends on sticky-kit jQuery plugin though

I suppose this is a sort of our table layout issue.

Attaching file is an example to see what's going on there basically.

In the example, in every 2000ms we do either one of the following repeatedly

  1. making a table-row element position:fixed and inserting an element to compensate the table-row element
  2. making the table-row element back to position: static and removing the element for compensation

Basically with these steps, the table height should be unchanged, but somehow we layout a display: table-cell element in a different row differently. You can easily see it on the example. "Bella Italia - Camping auf Deutsch" is the text inside the table-cell element.

Moving into Layout:Tables. Setting P3:S3 for now since I believe such kind of cases (i.e. using sticky-kit with table layout) are rarely used. If it's widely used we should bump the severity.

Severity: -- → S3
Component: Layout: Scrolling and Overflow → Layout: Tables
Flags: needinfo?(hikezoe.birchill)
Priority: -- → P3

Hiro, your test-case in comment 4 is hitting the "disable scroll anchoring" heuristic, do you know why the page is not hitting it? I also don't quite follow, the example in comment 4 prints:

110.33332824707031 != 110.33332824707031?

For me. So there's something else going on in that site. Maybe we should flip the pref you added in non-Nightly to get to the bottom of this?

Component: Layout: Tables → Layout: Scrolling and Overflow
Flags: needinfo?(hikezoe.birchill)

I also don't think this is S3, this makes the page unusable.

Severity: S3 → S2

The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.

Priority: P3 → --

IIRC the sticky-ish element is the anchor node itself, thus our scroll anchoring implementation thinks the anchor has been moved, and unfortunately the sticky-kit library changes the sticky-ish element position repeatedly (with forcible layout flush) back and forth due to the table height difference (i.e. the library thinks the content height has been changed, thus it tries to align the stick-ish element again and again..).

(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)

For me. So there's something else going on in that site. Maybe we should flip the pref you added in non-Nightly to get to the bottom of this?

I am reluctant disable it for this specific site. We should rather figure out a way to fix this janky sticky position scrolling issue with our web intervention extension?

I also start thinking our behavior on this table-layout: fixed difference may be correct, given that each table column width depends on the first row cell width..

Flags: needinfo?(hikezoe.birchill)

Set release status flags based on info from the regressing bug 1833758

Just ran across this in our S2 bug triage list. hiro, do you have cycles to push this forward at some point this half, since you've looked a bit? If not, I can try to find an owner for it. Thanks!

Flags: needinfo?(hikezoe.birchill)

I was wrong. This is truly an issue in our scroll anchor implementation, specifically scroll anchoring suppression.

Here is a test case to reproduce the issue. Once after you scrolled down the content, it keeps scrolling.

So what the issue in the scroll anchoring suppression is, it's asymmetric in this test case.

The test case does flip position value from "fixed" to "static" and from "static" back to "fixed" repeatedly, but in the case of flipping to "static" the target element gets removed and re-inserted at the same time, thus we don't have nsChangeHint_ReconstructFrame change hint for the change, thus we do suppress scroll anchoring in the case of "static" to "fixed", but we don't in the case of "fixed" to "static", it keeps scrolling in a single direction unfortunately.

Emilio, do you have any ideas how we address this asymmetric of the scroll anchoring suppression?

Attachment #9341182 - Attachment is obsolete: true
Attachment #9341428 - Attachment is obsolete: true
Flags: needinfo?(hikezoe.birchill) → needinfo?(emilio)

I figured out a way to fix this issue by using our webcompat intervention extension.

.has-sticky * {
  overflow-anchor: none ! important;
}

Adding this style to the site would solve the issue.

Ksenia, would you mind adding this into our intervention extension? Thanks!

Flags: needinfo?(emilio) → needinfo?(kberezina)

Should still try to look into it tho.

:root {
  overflow-anchor: none;
}

Would be a more efficient intervention.

Flags: needinfo?(emilio)

Ksenia, would you mind adding this into our intervention extension? Thanks!

Sounds good, I filed bug1868345 for the intervention.

Flags: needinfo?(kberezina)

Firefox 123 now includes an intervention for this.

Retriaging as S3 given that we're shipping an intervention for the known-affected site. The intervention applies the fix that we identified.

If we run across other affected sites, it might make sense to retriage as S2 again [or ship more interventions :) ].

Severity: S2 → S3
No longer depends on: 1868345
Summary: Can't scroll tv program on tvmovie.de → Difference in scroll anchoring suppression between Firefox and Chrome
Webcompat Priority: --- → ?
Webcompat Priority: ? → P3
Keywords: parity-chrome
No longer blocks: 1897392
Priority: -- → P3
Whiteboard: [webcompat:sightline]
User Story: (updated)
Webcompat Priority: P3 → P1
Webcompat Score: --- → 10

The severity field for this bug is set to S3. However, this bug has a P1 WebCompat priority.
:hiro, could you consider increasing the severity of this web compatibility bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(hikezoe.birchill)

I'd keep this bug as S3, given that the Webcompat score is quite low, 10.

Flags: needinfo?(hikezoe.birchill)
Webcompat Score: 10 → 6
Webcompat Score: 6 → 5
User Story: (updated)
Webcompat Score: 5 → 10
Webcompat Score: 10 → 5

I changed the diagnosis-team to layout, which aligns with the current component.

User Story: (updated)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: