Open
Bug 292284
Opened 20 years ago
Updated 6 months ago
Scrollbar disappears with very small window/div with overflow:scroll
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
REOPENED
People
(Reporter: martijn.martijn, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: testcase)
Attachments
(10 files, 4 obsolete files)
431 bytes,
text/html
|
Details | |
1.10 KB,
text/html
|
Details | |
45.74 KB,
image/gif
|
Details | |
3.03 KB,
image/gif
|
Details | |
4.24 KB,
image/gif
|
Details | |
435 bytes,
application/vnd.mozilla.xul+xml
|
Details | |
1.68 KB,
text/html
|
Details | |
6.21 KB,
image/gif
|
Details | |
11.40 KB,
patch
|
Details | Diff | Splinter Review | |
16.99 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050426 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050426 Firefox/1.0+
See upcoming testcase.
When a window/overflow scroll div is very small, the horizontal/vertical
scrollbar in Mozilla disappears.
This is not what IE6 is doing. There, the scrollbarbuttons shrink to fit in the
remaining space left.
Reproducible: Always
Steps to Reproduce:
1. Make window very small
2.
3.
Actual Results:
Vertical scrollbar of the content area disappears when the window is at a
certain size.
Expected Results:
Make the scrollbarbuttons smaller to fit in the remaining space of the window.
Reporter | ||
Comment 1•20 years ago
|
||
Reporter | ||
Comment 2•20 years ago
|
||
This patch fixes it. It makes Mozilla behave the same as IE6.
Reporter | ||
Comment 3•20 years ago
|
||
But that patch is incomplete. Also things need to happen for Seamonkey and Linux
and Mac themes, I guess.
You don't want to remove the scrollbar removal code from nsGfxScrollFrame. We
still want that on platforms where the scroll arrows can't or shouldn't shrink.
You just need to set the scrollbar button minimum height or width to 0 in
nsNativeThemeWin (but note that, e.g., a scrollarrow-right should still have a
minimum *height*), and fix the themes to not set the minimum size in CSS, and
that should solve the problem.
You'd also need to verify that the arrows do paint correctly when they have a
small size.
Reporter | ||
Comment 6•20 years ago
|
||
Ah, ok. Thanks for the info. I'll try that. Hopefully I can manage it before my
holiday.
Reporter | ||
Comment 7•20 years ago
|
||
Like this, I guess.
I haven't checked the print related changes in the patch (I don't know how to
check).
Attachment #182118 -
Attachment is obsolete: true
Reporter | ||
Comment 8•20 years ago
|
||
Reporter | ||
Comment 9•20 years ago
|
||
This is the rendering of testcase2 in IE6/Firefox/patched Firefox.
Three issues:
- when height of the overflow:scroll div is smaller than 4px, then the vertical
scrollbar overlaps (which is hardly noticable). Could have something to do with
the borders that are set on the scrollbarbutton.
- IE6 also shrinks the height of the horizontal scrollbar when there is no room
for it anymore.
- The patched Firefox shrinks the height of the scrollbarbuttons too soon
(which you can see in the second to last overflow:scroll div). From bug 276204,
comment 1, I would think that height would act as min-height here, not?
Comment 10•20 years ago
|
||
I filed bug 184998 for this issue a while ago, i guess it can be duped to this
one since it has a patch. Though note that it set to block bug 180144
Retest after 292312 has landed.
Depends on: 292312
Comment 12•20 years ago
|
||
Comment 13•20 years ago
|
||
Comment 14•20 years ago
|
||
Comment on attachment 182894 [details] [diff] [review]
patch2
> case NS_THEME_SCROLLBAR_BUTTON_UP:
> case NS_THEME_SCROLLBAR_BUTTON_DOWN:
> (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL);
>- (*aResult).height = ::GetSystemMetrics(SM_CYVSCROLL);
>+ (*aResult).height = 0;
> *aIsOverridable = PR_FALSE;
Don't you need to leave the default height, but allow it to reduce?
(from something bryner told me it's *aIsOverridble that controls that)
Reporter | ||
Comment 15•20 years ago
|
||
(In reply to comment #11)
> Retest after 292312 has landed.
I still get the same results after bug 292312.
(In reply to comment #14)
> Don't you need to leave the default height, but allow it to reduce?
> (from something bryner told me it's *aIsOverridble that controls that)
I tried that (only setting *IsOverridable to PR_TRUE), but that way I keep the
current behavior of Mozilla (like without the patch).
The behavior of this testcase3 changes when the patch is applied: without the
patch, the width of the scrollbar is equal to the width of the browser. With
the patch the width of the scrollbar stays at 16px.
I don't know if that is an issue.
More in general, I'm afraid the patch is going to break themes.
The third issue I mentioned in comment 9: "The patched Firefox shrinks the
height of the scrollbarbuttons too soon (which you can see in the second to
last overflow:scroll div)."
I think this happens because of min-width/min-height of thumb. When I set this
to 50px for example, I get the issue much earlier (at 50px).
I think this has got something to do with:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/xul/base/src/nsSliderFrame.cpp&rev=1.131&root=/cvsroot#289
So the slider is not painted anymore when the thumb gets larger than the
available area, but it still takes part in layout (at least that's what it
looks like to me).
Martijn, why don't you set the arrow minimum-size to be zero in both directions?
It looks like IE does that.
Reporter | ||
Comment 17•20 years ago
|
||
Yes, that helps and makes it compatible with IE6 (although I find it personally
more useless, since you'll get a horizontal scrollbar that overlaps the
content).
This is in fact the second issue I mentioned in comment 9.
With this extra hackery I did here, I sort of resolve issue 3 in comment 9, I
don't know/think if this is any good, though.
Comment 18•20 years ago
|
||
Try setting the slider's preferred size to zero; this for Modern:
slider {
width: 0px;
height: 15px;
background: url("...") repeat-x;
}
slider[orient="vertical"] {
width: 15px;
height: 0px;
background: url("...") repeat-y;
}
Reporter | ||
Comment 19•20 years ago
|
||
Thanks Neil! That works (now I understand those attached screenshots of yours).
But I have no idea why it works, maybe it should not even work.
This patch also addresses comment 16.
Attachment #182894 -
Attachment is obsolete: true
Attachment #183211 -
Attachment is obsolete: true
Reporter | ||
Comment 20•20 years ago
|
||
Strange, patch4 doesn't work for horizontal scrollbars. See my upcoming
screenshot of testcase 4 with a build with patch4.
Reporter | ||
Comment 21•20 years ago
|
||
Comment 22•19 years ago
|
||
*** Bug 184998 has been marked as a duplicate of this bug. ***
Updated•19 years ago
|
Reporter | ||
Comment 23•19 years ago
|
||
Comment on attachment 183758 [details] [diff] [review]
patch4
So is this ready?
There's still this issue left for horizontal scrollbars, but I think that
situation happens much more seldom.
Attachment #183758 -
Flags: review?(neil.parkwaycc.co.uk)
Comment 24•19 years ago
|
||
(In reply to comment #20)
>Created an attachment (id=183764)
>Testcase4
Eww, this attachment really confuses Mozilla 1.6 :-(
Comment 25•19 years ago
|
||
Comment on attachment 183758 [details] [diff] [review]
patch4
I shouldn't be doing reviews at this time of night, so I'll just point out a
couple of oversights for now:
>Index: gfx/src/windows/nsNativeThemeWin.cpp
I'd be surprised if the other native themes don't need patching.
> *aIsOverridable = PR_TRUE;
> switch (aWidgetType) {
> case NS_THEME_RADIO:
> case NS_THEME_CHECKBOX:
> (*aResult).width = (*aResult).height = 13;
> break;
> case NS_THEME_SCROLLBAR_BUTTON_UP:
> case NS_THEME_SCROLLBAR_BUTTON_DOWN:
>- (*aResult).width = ::GetSystemMetrics(SM_CXVSCROLL);
>- (*aResult).height = ::GetSystemMetrics(SM_CYVSCROLL);
>- *aIsOverridable = PR_FALSE;
>+ (*aResult).width = 0;
>+ (*aResult).height = 0;
>+ *aIsOverridable = PR_TRUE;
Conveniently this is set by default at the beginning of the diff.
Reporter | ||
Comment 26•19 years ago
|
||
Sorry that I didn't let respond for so long.
(In reply to comment #25)
> I'd be surprised if the other native themes don't need patching.
Yes, but I don't know which other native themes are doing, and when looking at:
http://lxr.mozilla.org/seamonkey/source/gfx/src/
there seem to be quite a bit of themes that maybe need patching (gtk, mac, qt
and shared ?)
Reporter | ||
Comment 27•19 years ago
|
||
*** Bug 297055 has been marked as a duplicate of this bug. ***
Reporter | ||
Comment 28•19 years ago
|
||
http://wargers.org/mozilla/Bug292284/konqueror.png
http://wargers.org/mozilla/Bug292284/safari.png
Screenshots of testcase4 with Safari an Konqueror. They seem to handle this differently, but they seem both like buggy solutions to me.
Comment 29•19 years ago
|
||
Comment on attachment 183758 [details] [diff] [review]
patch4
Sorry for the ridiculous delay, keep poking me next time ;-)
This works very nicely, but only if I want 16px scrollbars; it ignores the OS setting :-(
Attachment #183758 -
Flags: review?(neil) → review-
Reporter | ||
Comment 30•19 years ago
|
||
No problem with the delay (if I really wanted to, I would have poked you :-)
Hmm, I see what you mean.
I guess I would need some magic css value (-moz-scrollbarbutton-width or something) to get this working.
Comment 31•19 years ago
|
||
Either that or perhaps the native theme code could be altered so that it can set the maximum and the preferred size rather than just the minimum size.
Reporter | ||
Comment 32•19 years ago
|
||
(In reply to comment #31)
> Either that or perhaps the native theme code could be altered so that it can
> set the maximum and the preferred size rather than just the minimum size.
Ok, I did that with this patch (I think). Not sure if this is the correct way to do this.
Attachment #183758 -
Attachment is obsolete: true
Reporter | ||
Comment 33•18 years ago
|
||
One thing I remembered about patch5 is that I abused canOverride. It's also only a windows fix.
Reporter | ||
Comment 34•18 years ago
|
||
*** Bug 341236 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•16 years ago
|
Product: Core → SeaMonkey
Updated•15 years ago
|
Assignee: themes → nobody
Component: Themes → Layout
Product: SeaMonkey → Core
QA Contact: themes → layout
Comment 37•15 years ago
|
||
How about this approach?
The small size is got from nsBoxFrame::GetMinSize through nsBoxLayoutStat.
Comment 38•14 years ago
|
||
Comment on attachment 447083 [details] [diff] [review]
another approach
roc, could you review this patch?
I use BoxLayoutState to hand the small size to nsBoxFrame. GetMinSize hands the value to LayoutScrollbars from BoxLayoutState instead of intrinsic size. I think this patch influences only the layout of the scrollbars.
Attachment #447083 -
Flags: review?(roc)
Updated•14 years ago
|
OS: Windows XP → All
Hardware: x86 → All
Comment 39•9 years ago
|
||
Its been a while since this bug has been updated, so I thought I'd just note that this behaviour is still present in Firefox 43 Windows. I encountered it while using `overflow:scroll` to make scrollbars show, and while these worked everywhere else, it doesn't in Firefox Win if the height of the scrolling element is <34px.
This behaviour is not the same as described on MDN ( https://developer.mozilla.org/en/docs/Web/CSS/overflow ):
> scroll - The content is clipped and desktop browsers use scrollbars, whether or not any content is clipped. This avoids any problem with scrollbars appearing and disappearing in a dynamic environment. Printers may print overflowing content.
Attachment #447083 -
Flags: review?(roc)
Reporter | ||
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Updated•8 years ago
|
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
Updated•2 years ago
|
Severity: normal → S3
Comment 41•2 years ago
|
||
The severity field for this bug is relatively low, S3. However, the bug has 6 duplicates and 12 votes.
:dholbert, could you consider increasing the bug severity?
For more information, please visit auto_nag documentation.
Flags: needinfo?(dholbert)
Comment 42•2 years ago
|
||
The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.
Flags: needinfo?(dholbert)
You need to log in
before you can comment on or make changes to this bug.
Description
•