Closed Bug 800668 Opened 14 years ago Closed 14 years ago

Hideous scrollbars when zoomed in

Categories

(Core :: Widget: Cocoa, defect)

All
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla19
Tracking Status
firefox18 --- verified

People

(Reporter: tjmart1, Assigned: jfkthame)

References

Details

(Keywords: regression)

Attachments

(2 files)

Attached image ScrollbarScreenshot.png —
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:19.0) Gecko/19.0 Firefox/19.0 Build ID: 20121011030552 Steps to reproduce: Zoom in on a page 5 stemps from the default size. Actual results: The scrollbars will become about twice the proper width, and display incorrectly. Expected results: Scrollbars should render correctly at all zoom levels.
This is a regression from my hidpi-native-theming patch from bug 674373.
Blocks: 674373
Status: UNCONFIRMED → NEW
Component: Untriaged → Widget: Cocoa
Ever confirmed: true
Keywords: regression
Product: Firefox → Core
Hardware: x86 → All
Version: 19 Branch → Trunk
Specifically, this only happens as described on a non-HiDPI display; however, on a HiDPI (retina) display, we have the opposite problem: the scrollbars will become too *narrow* when zoomed out by three or more steps.
Hmm. The fact that zooming now influences the scrollbar sizes was partly intentional. But it seems I haven't really thought this through; if it results in different behavior in hidpi mode vs non-hidpi mode, that's obviously not a good change. The buggy scrollbar rendering only exists up to 10.6. On Lion, zooming on a non-HiDPI display makes the scrollbars bigger but they render fine.
FWIW, Safari does not make the scrollbars bigger when zooming the page.
I think that if we want to make scrollbars scale in response to zoom (which I'm not sure about one way or the other), we should handle it in a separate bug where we can discuss that feature in its own right, rather than allow it to happen as a side-effect of HiDPI support. So IMO, the proper fix for this bug should restore the pre-HiDPI situation where scrollbars are immune to zoom. If people think they *should* be affected, file a bug for that. (How is this handled on other platforms, as well as by other browsers?)
(In reply to Jonathan Kew (:jfkthame) from comment #5) > (How is this handled on other platforms, as > well as by other browsers?) Scrollbars are immune to zoom in Windows 7. Tested in Opera, IE and Chrome.
(In reply to Jonathan Kew (:jfkthame) from comment #5) > I think that if we want to make scrollbars scale in response to zoom (which > I'm not sure about one way or the other), we should handle it in a separate > bug where we can discuss that feature in its own right, rather than allow it > to happen as a side-effect of HiDPI support. I agree. And we probably don't want it at all. So the reason this happens is because we double the scrollbar size at the end of nsNativeThemeCocoa::GetMinimumWidgetSize in the IsContextZoomedToHighResolution case. And IsContextZoomedToHighResolution only looks at device pixels per CSS pixel, not at whether the window is HiDPI. So that needs to change.
That sounds right to me. Feel free to put up a patch if you have the time, otherwise I'll get to it sometime soon.
It looks to me like we just need to replace IsContextZoomedToHighResolution with a function such as IsHiDPIContext, which can be implemented by simply looking at the *unscaled* device pixel value, not the scaled value that changes with zoom.
Attachment #671073 - Flags: review?(mstange)
Comment on attachment 671073 [details] [diff] [review] doubling of Cocoa widget sizes should depend on whether the context is HiDPI, not on the zoom factor. Great! I didn't expect it to be so simple.
Attachment #671073 - Flags: review?(mstange) → review+
Assignee: nobody → jfkthame
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment on attachment 671073 [details] [diff] [review] doubling of Cocoa widget sizes should depend on whether the context is HiDPI, not on the zoom factor. Review of attachment 671073 [details] [diff] [review]: ----------------------------------------------------------------- ::: widget/cocoa/nsNativeThemeCocoa.mm @@ +1902,3 @@ > { > + return nsPresContext::AppUnitsPerCSSPixel() >= > + 2 * aContext->UnscaledAppUnitsPerDevPixel(); Wouldn't it make more sense to return a scale factor, which is AppUnitsPerCSSPixel()/UnscaledAppUnitsPerDevPixel(), and then scale everything by that? Rather than supporting only the hardcoded value "2"?
I suppose so. But in that case we should re-think GetBackingScaleFactorForRendering() as well, I presume; it's also hard-coded to return either "1" or "2", nothing else. And when additional backing scale factors arise, we'll need to re-examine how we're dealing with bitmapped UI assets, too; right now we assume that 1x and 2x are the only sizes we care about. It's sounding to me like we could have a followup bug about generalized variable-resolution support, but we don't actually need to worry about it right now for the current HiDPI support on retina-display systems.
Comment on attachment 671073 [details] [diff] [review] doubling of Cocoa widget sizes should depend on whether the context is HiDPI, not on the zoom factor. [Approval Request Comment] Bug caused by (feature/regressing bug #): 674373 User impact if declined: ugly visual regression in zoomed windows (see screenshot) Testing completed (on m-c, etc.): verified locally as fixing the bug; on m-c since Saturday Risk to taking this patch (and alternatives if risky): minimal risk - a simple correction in Mac-only code String or UUID changes made by this patch: none
Attachment #671073 - Flags: approval-mozilla-aurora?
Comment on attachment 671073 [details] [diff] [review] doubling of Cocoa widget sizes should depend on whether the context is HiDPI, not on the zoom factor. Approving for aurora as it is OS X only low risk fix leading to avoiding ugly visual regression in zoomed windows for retina displays
Attachment #671073 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
It looks as expected on Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:18.0) Gecko/20100101 Firefox/18.0 (20121212073002).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: