Closed Bug 1756826 Opened 2 years ago Closed 2 years ago

Horizontal scrollbar displayed when it should not

Categories

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

Firefox 97
defect

Tracking

()

VERIFIED FIXED
99 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox97 --- wontfix
firefox98 --- wontfix
firefox99 --- verified

People

(Reporter: jcubic, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Steps to reproduce:

I've used:

.terminal {
scrollbar-gutter: stable;
overflow-y: auto;
background: black;
width: 600px;
height: 200px;
position: relative;
}
.terminal .sentinel {
width: 100%;
padding: 10px;
position: absolute;
left: 0;
box-sizing: border-box;
}

and:

<div class="terminal">
<div class="sentinel"></div>
</div>

Here is live demo:
https://codepen.io/jcubic/pen/JjOZPaE

Actual results:

The inner element is triggering the horizontal scrollbar even though it should not be supposed to. It works in Chrome

Expected results:

There should be no horizontal scrollbar because the inner element has width: 100%.

Status: UNCONFIRMED → NEW
Has Regression Range: --- → yes
Has STR: --- → yes
Component: Untriaged → Layout: Scrolling and Overflow
Ever confirmed: true
Keywords: regression
Product: Firefox → Core
Regressed by: 1715112
Flags: needinfo?(aethanyc)

Ah, here is it.

Assignee: nobody → emilio
Flags: needinfo?(aethanyc)

Can we use aFrameSize [1] as the containing block's size? We should reflow the abspos children only if the block frame is the abs containing block (because we place the abspos child frames in abspos child list), and aFrameSize shouldn't include any scrollbar's size if the block frame is a -moz-scrolled-content wrapper. Or can we call nsIFrame::FinishReflowWithAbsoluteFrames in the block frame? Many other frames such as flex container call this method to reflow its abspos children.

[1] https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsBlockFrame.cpp#1041
[2] https://searchfox.org/mozilla-central/rev/9b0bdcc37419e6765223358a31a4a54d62e1cd97/layout/generic/nsIFrame.cpp#6845

(In reply to Ting-Yu Lin [:TYLin] (UTC-8) from comment #4)
Yeah I had written such thing already, was waiting on try: https://treeherder.mozilla.org/jobs?repo=try&revision=a2f869999c8e41da94f98a8be158919d1f980929 :)

I'll send it, let's assume it works out.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6739837be6a8
Simplify nsBlockFrame abspos cb size code to account for scrollbars correctly. r=TYLin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/32958 for changes under testing/web-platform/tests

Backed out changeset 6739837be6a8 (Bug 1756826) for causing build bustages on nsBlockFrame.cpp.
Backout link
Push with failures
Failure Log

Flags: needinfo?(emilio)
Upstream PR was closed without merging
Attachment #9265209 - Attachment description: Bug 1756826 - Simplify nsBlockFrame abspos cb size code to account for scrollbars correctly. r=TYLin,dholbert → Bug 1756826 - Simplify nsBlockFrame abspos cb size code to account for scrollbars correctly. r=TYLin
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1fa7d333934d
Simplify nsBlockFrame abspos cb size code to account for scrollbars correctly. r=TYLin
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
Flags: qe-verify+

I can not reproduce the issue on Win10x64 using builds 99.0a1(20220223190530) and 97.0b9(20220127193706). Is there any other information available in order to reproduce the isssue?
Can you please check if the issue is still reproducing on latest beta https://archive.mozilla.org/pub/firefox/candidates/99.0b4-candidates/build1/win64/en-US/ ? Thank you.

Flags: needinfo?(jcubic)

(In reply to Monica Chiorean from comment #13)

I can not reproduce the issue on Win10x64 using builds 99.0a1(20220223190530) and 97.0b9(20220127193706). Is there any other information available in order to reproduce the isssue?
Can you please check if the issue is still reproducing on latest beta https://archive.mozilla.org/pub/firefox/candidates/99.0b4-candidates/build1/win64/en-US/ ? Thank you.

Sorry but I don't understand, did you read the status of the issue?

Status: NEW → RESOLVED
Closed: 23 days ago
status-firefox99: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

I didn't test on Firefox 99, but it says that it's fixed. Also, the issue is about GNU/Linux why do you ask about Window10x64?
Maybe it fine there, I don't have access to WIndows so I can't test.

Flags: needinfo?(jcubic)

(In reply to Jakub T. Jankiewicz from comment #14)

(In reply to Monica Chiorean from comment #13)

I can not reproduce the issue on Win10x64 using builds 99.0a1(20220223190530) and 97.0b9(20220127193706). Is there any other information available in order to reproduce the isssue?
Can you please check if the issue is still reproducing on latest beta https://archive.mozilla.org/pub/firefox/candidates/99.0b4-candidates/build1/win64/en-US/ ? Thank you.

Sorry but I don't understand, did you read the status of the issue?

Status: NEW → RESOLVED
Closed: 23 days ago
status-firefox99: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

I didn't test on Firefox 99, but it says that it's fixed. Also, the issue is about GNU/Linux why do you ask about Window10x64?
Maybe it fine there, I don't have access to WIndows so I can't test.

Sorry I was not clear enough. What I meant to say was that I try to reproduce the issue before the fix, in order to confirm the fix, also it was not mentioned to be a linux issue (that is why I tried on Win).
Today I tried again on Linux -> Ubuntu 20.4 using builds 99.0a1(20220223190530) and Beta 97.0b9 and I was not able to reproduce the issue before fix.
Can you please confirm if the issue is still reproducing on fixed version https://archive.mozilla.org/pub/firefox/candidates/99.0b6-candidates/build1/ ? Thank you.

Yes, it's fixed. You can see how it's working on a real site here: https://terminal.jcubic.pl/#demo The reproduction was based on this usage.

I've noticed one thing, I don't know if this is intended, similar issue is in Chrome but only when the vertical scrollbar is present.
if there is overflow: auto the border-radius is not applied on the right top/bottom.

If there's an scrollbar then it is intended, yes, otherwise the scrollbar would get clipped or so.

Ok, thanks that were my intention to clip 5px on the corner. It works in Chrome, but not when there is a visible scrollbar, but I would just use another div to do what I want.

Marking issue as verified based on comment #16.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Upstream PR was closed without merging
Upstream PR merged by jgraham
Duplicate of this bug: 1543140
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: