Closed Bug 1906475 Opened 4 months ago Closed 3 months ago

Categories

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

Firefox 127
defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 --- wontfix
firefox128 --- wontfix
firefox129 --- wontfix
firefox130 --- wontfix
firefox131 --- fixed

People

(Reporter: jonathan, Assigned: emilio)

Details

Attachments

(5 files)

Attached video 2024-07-05 21-10-04.mkv

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Steps to reproduce:

Visit https://plugins.jetbrains.com/docs/marketplace/revenue-sharing-and-fees.html, then scroll a bit.

Tested with Firefox on Windows 10 x64. I also tried with all extensions disabled.
Please note I did not face this issue in an Arch Linux VM.

Actual results:

The webpage content shakes. Please see attached screen recording.
Also, when it's shacking, pressing F12 does nothing. If I scroll up, it stops shaking, F12 opens the console, but I see no error or warning. If I scroll down again, it shakes.

Expected results:

The webpage content should not shake.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core

Thanks for the report.

Did this start happening recently? Or did old versions have the problem?

Old versions have the same problem. At least Firefox 126 and 125. Actually, I'm facing this issue since a while (months), but as only very few webpages at https://plugins.jetbrains.com/docs/ are affected, I did not take the time to raise an issue until today.

Component: Graphics: WebRender → Layout: Scrolling and Overflow
Status: UNCONFIRMED → NEW
Ever confirmed: true

FWIW, disabling the following CSS will fix the issue.

https://resources.jetbrains.com/storage/help-app/v6/app.css

.table__wrapper--with-scroll {
overflow-x: auto;
}

The severity field is not set for this bug.
:hiro, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hikezoe.birchill)

This doesn't look like scrolling issues since if it's a scrolling issue the whole contents should be wobbled. I'd start with Layout:Tables.

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

Hm, reminiscent of bug 1907289.
I unfortunately had problems reproducing that, no dice on reproducing this one either.
Reporter, does the bug still happen on release 128.0.2?

Flags: needinfo?(jonathan)

(In reply to David Shin[:dshin] from comment #7)

Hm, reminiscent of bug 1907289.
I unfortunately had problems reproducing that, no dice on reproducing this one either.
Reporter, does the bug still happen on release 128.0.2?

For me, the bug is still present with release 128.0.2.

Flags: needinfo?(jonathan)

Interesting, at least part of the reason why I can't repro is because the wrapper for the table receives table__wrapper--without-scroll for me, instead of table__wrapper--with-scroll. Putting that into the table in question generates the scrollbar, but doesn't cause the shaking behaviour.
It'd be nice if anyone who can reproduce this save the page ("Web page, complete").

(In reply to David Shin[:dshin] from comment #9)

Interesting, at least part of the reason why I can't repro is because the wrapper for the table receives table__wrapper--without-scroll for me, instead of table__wrapper--with-scroll. Putting that into the table in question generates the scrollbar, but doesn't cause the shaking behaviour.
It'd be nice if anyone who can reproduce this save the page ("Web page, complete").

Sure: attached Revenue sharing _ JetBrains Marketplace Documentation.zip

I can reproduce on Linux by zooming the page 110%. Note that it only reproduces when 'Always show scrollbars' is enabled in about:preferences

Got bug 1825384 as the cause with mozregression. This contradicts comment 3 which says the issue has been present since 126/125.

Reporter, please consider using mozregression to find out which version introduced the problem for you

Just wondering whether it's fixed by setting "layout.scroll.disable-pixel-alignment" to true in about:config.

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

Just wondering whether it's fixed by setting "layout.scroll.disable-pixel-alignment" to true in about:config.

I tried, but it changed nothing.

So their code is doing something very weird. They have a setup similar to this:

<!doctype html>
<p>Do you see scrollbars below?</p>
<div style="overflow: auto; width: 500px; height: 500px;">
  <table style="width: auto; height: 300px; margin: -1px; clip-path: inset(1px);"></table>
</div>

Except they add or remove the overflow: auto dynamically based on something, and they're getting into a loop thinking they need scrollbars when they don't and then vice versa.

They don't have source maps and their codebase is a react app so it'd be great to get some feedback from them to know what are they using...

My guess is they might be using Element.client{Width,Height}, which round and thus are prone to fractional issues like these in some systems / at some zoom levels... But would be great to confirm that's the case.

The other issue is that I think they try to rely on that clip-path to not cause overflow, but that's not the case per spec. They could use overflow: clip and overflow-clip-margin instead to achieve the effect they want...

Just for info, I also opened an issue on JetBrains' bugtracker, if you want to discuss with them: https://youtrack.jetbrains.com/issue/MP-6715/Rendering-issues-with-Firefox

Thanks! I had just tried to contact them in the email at the bottom of the page.

I commented there as well.

A somewhat related issue can be reproduced in Safari, too, as seen in this screen recording. Note how the horizontal scrollbar under the table appears and disappears as the window is resized horizontally.
(But I didn't manage to find a state where it got into a continuous loop while the window size is static, as seen in the Firefox issue, so it's more of a transient annoyance while actively resizing.)

Severity: -- → S3
Attachment #9417689 - Attachment description: Screen Recording 2024-08-05 at 12.50.21.mov → [macOS/Safari] Screen Recording 2024-08-05 at 12.50.21.mov
Attached file Reduced test-case.

This seems to be due to how we compute scroll{Width,Height} for overflow: visible elements. The mix of the border and the negative margin causes us to return a different result (a higher scroll margin). With the right content you can trick their logic.

In the page both the border and the margin are 1px and -1px rather than 10, which made it rather trickier to find...

I'm still not quite sure what the right answer is here tho. I think per https://drafts.csswg.org/cssom-view/#dom-element-scrollwidth we're doing the right thing, but of course calling that a "scrolling area" seems funny.

WebKit's implementation is here, Blink's is here.

It makes some sense to clamp to the client rect I guess, since it matches what it'd return if you were scrollable?

Flags: needinfo?(emilio)
Assignee: nobody → emilio
Attachment #9418218 - Attachment description: WIP: Bug 1906475 - Make scroll{Width,Height} implementation for overflow: visible match WebKit/Blink. → Bug 1906475 - Make scroll{Width,Height} implementation for overflow: visible match WebKit/Blink. r=#layout
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)

Is this something where we'd want to open a spec issue to get it improved for the future?

Yes, I thought of doing that, but then realized that the spec says (if I'm not wrong) that WebKit / blink is correct: https://drafts.csswg.org/cssom-view/#scrolling-area for an element says the left edge of the "scrolling area" is the left padding edge (thus that we should ignore the left margin and the border).

Attachment #9418218 - Attachment description: Bug 1906475 - Make scroll{Width,Height} implementation for overflow: visible match WebKit/Blink. r=#layout → Bug 1906475 - Improve scroll{Width,Height} implementation for overflow: visible frames. r=#layout
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8d836e6ec98a Improve scroll{Width,Height} implementation for overflow: visible frames. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/47619 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch

Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.

Upstream PR merged by moz-wptsync-bot

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox130 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

This feels rather risky to uplift.

Flags: needinfo?(emilio)
Component: Layout: Tables → Layout: Scrolling and Overflow
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: