Closed Bug 424074 Opened 17 years ago Closed 17 years ago

[Mac] Scrollbar thumb is drawn with wrong size for custom scrollbars

Categories

(Core :: Widget: Cocoa, defect, P2)

x86
macOS
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: mstange, Assigned: mstange)

References

(Depends on 1 open bug)

Details

(Keywords: testcase)

Attachments

(2 files, 4 obsolete files)

When creating a custom scrollbar using the XUL <scrollbar> element, the size of the scrollbar's thumb can be controlled with the pageincrement attribute. nsNativeThemeCocoa::GetScrollbarDrawInfo does not use the pageincrement attribute when setting the thumb size; it makes the assumption that pageincrement equals the scrollbar size, which luckily works for normal scrollbars. However, it makes custom scrollbars behave very strangely.
Flags: blocking1.9?
Attachment #310730 - Flags: review?(vladimir)
Attached file Testcase
Comment on attachment 310730 [details] [diff] [review] Fix (use pageincrement attribute for thumb size) Is pageincrement guaranteed to be present? If so, and if it has the correct value at, then this looks fine for me but get sr frm josh, please.
Comment on attachment 310730 [details] [diff] [review] Fix (use pageincrement attribute for thumb size) (In reply to comment #2) > Is pageincrement guaranteed to be present? The pageincrement attribute has a default value (10), so I think it is.
Attachment #310730 - Flags: superreview?(joshmoz)
+'ing w/ P2. Josh, please reprioritize/minus if necessary.
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Attachment #310730 - Flags: superreview?(vladimir)
Attachment #310730 - Flags: superreview?(joshmoz)
Attachment #310730 - Flags: review?(vladimir)
Attachment #310730 - Flags: review+
Comment on attachment 310730 [details] [diff] [review] Fix (use pageincrement attribute for thumb size) Looks fine, add a reftest? (Compare whether a scrollbar without an explicit thumb size looks different than one with.)
Attachment #310730 - Flags: superreview?(vladimir) → superreview+
Attached patch Reftest (obsolete) — Splinter Review
Do reftests need to be reviewed?
Keywords: checkin-needed
Attached patch The real reftest (obsolete) — Splinter Review
Well, I did manage to get it wrong, so maybe they should...
Attachment #311133 - Attachment is obsolete: true
I'm thinking too much. The other testcase wasn't wrong. But the patch is wrong. We have to take care of using the right default value ourselves. CheckIntAttr just returns 0 when the attribute isn't set. A new patch is coming. Sorry for the inconvenience.
Keywords: checkin-needed
I've changed nsNativeTheme::CheckIntAttr to accept a default value as third parameter. Now we're matching the behavior of nsSliderFrame: http://mxr.mozilla.org/firefox/source/layout/xul/base/src/nsSliderFrame.cpp#185 Again, sorry that I didn't investigate this issue the first time.
Attachment #310730 - Attachment is obsolete: true
Attachment #311146 - Flags: review?(joshmoz)
Attachment #311146 - Flags: superreview?(vladimir)
Attachment #311146 - Flags: review?(joshmoz)
Attachment #311146 - Flags: review+
// These are used by nsNativeThemeGtk Should probably just remove this comment since it is no longer true.
Attachment #311146 - Flags: superreview?(vladimir) → superreview+
I've removed the comment and added better reftests. The following is tested: 1. If the right default values are applied when the attributes are not set 2. If setting pageincrement to a different value changes the appearance 3. If the thumbsize is the same for the pageincrement/maxpos combinations 40/100 and 400/1000.
Attachment #311134 - Attachment is obsolete: true
Attachment #311146 - Attachment is obsolete: true
Keywords: checkin-needed
landed on trunk, thanks Markus
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
(In reply to comment #12) > landed on trunk, thanks Markus You missed crediting Markus with the patch in your checkin comment.
oops, sorry
Depends on: 425368
(In reply to comment #13) > You missed crediting Markus with the patch in your checkin comment. Filed bug 425426 to fix the checkin comment.
verified fixed using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9pre) Gecko/2008050621 Firefox/3.0pre and the testcase from markus --> Verified fixed
Status: RESOLVED → VERIFIED
Keywords: testcase
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: