Closed
Bug 1187237
Opened 9 years ago
Closed 9 years ago
We see no "track" on "Range"-type input with GTK3 builds
Categories
(Core :: Widget: Gtk, defect)
Core
Widget: Gtk
Tracking
()
RESOLVED
FIXED
mozilla42
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: julienw, Assigned: acomminos)
References
Details
Attachments
(3 files, 3 obsolete files)
STR: * open data:text/html;charset=utf-8,<input type%3Drange> Expected: * we see a track on this range input. Actual: * we only see the thumb.
Reporter | ||
Comment 1•9 years ago
|
||
Here is the same thing on Aurora.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → acomminos
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•9 years ago
|
||
After some investigation, there appear to be several issues at fault here; - The range's background is not drawn with gtk_render_background. - There is no minimum size set for the range, nor does the range inherit the minimum size of the range thumb. - The range trough is not drawn with GTK_STYLE_CLASS_TROUGH as per gtk_range_draw. - The range trough is not drawn within the range's margins. - The range trough may extend unbounded in the direction perpendicular to the slider- it should be clamped to the minimum size of the trough. I'll be working on a patch to correct these issues.
Assignee | ||
Comment 3•9 years ago
|
||
This patch puts rendering in line with upstream GTK's gtk_range_draw, and adds minimum and maximum size bounds like GTK as well. Thanks!
Attachment #8640607 -
Flags: review?(karlt)
Assignee | ||
Comment 4•9 years ago
|
||
Whoops, committed an accidental test change. Fixed.
Attachment #8640607 -
Attachment is obsolete: true
Attachment #8640607 -
Flags: review?(karlt)
Attachment #8640609 -
Flags: review?(karlt)
Comment 5•9 years ago
|
||
Comment on attachment 8640609 [details] [diff] [review] Correct range slider drawing on GTK3. Most of this looks good, but I have some questions. (In reply to Andrew Comminos [:acomminos] from comment #2) > - There is no minimum size set for the range, nor does the range inherit the > minimum size of the range thumb. It is not usually the role of widget code to set the minimum size for container widgets. Usually container widgets set only the border and/or padding. Are you sure that the code using NS_THEME_RANGE has a similar bug to the code using NS_THEME_SCROLLBAR_TRACK_*? I suspect moz_gtk_get_widget_border should be modified to use trough-border and wonder whether that would make the minimum size unnecessary? > gint >+moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width, >+ gint* scale_height) Given this always returns the same value, and the return value is not checked, just return void. >+ GdkRectangle rect; Unused. >+ case NS_THEME_RANGE: >+ if (IsRangeHorizontal(aFrame)) { >+ moz_gtk_get_scale_metrics(GTK_ORIENTATION_HORIZONTAL, &scale_width, &scale_height); >+ } else { >+ moz_gtk_get_scale_metrics(GTK_ORIENTATION_VERTICAL, &scale_width, &scale_height); >+ } Perhaps ?: would be useful. >+ *aIsOverridable = true; NS_THEME_SCALE_THUMB_*, NS_THEME_SCROLLBAR_TRACK_*, and most other widgets set *aIsOverridable = false. Is there a reason to use true here? If the width across the slider is less, then moz_gtk_scale_paint() may draw outside its rect, which could cause rendering problems. If *aIsOverridable = false then that won't happen.
Flags: needinfo?(acomminos)
Attachment #8640609 -
Flags: review?(karlt)
Assignee | ||
Comment 6•9 years ago
|
||
(In reply to Karl Tomlinson (ni?:karlt) from comment #5) > (In reply to Andrew Comminos [:acomminos] from comment #2) > > - There is no minimum size set for the range, nor does the range inherit the > > minimum size of the range thumb. > > It is not usually the role of widget code to set the minimum size for > container widgets. Usually container widgets set only the border and/or > padding. Are you sure that the code using NS_THEME_RANGE has a similar bug > to the code using NS_THEME_SCROLLBAR_TRACK_*? Fairly sure. nsRangeFrame doesn't seem to respect the (anonymously created) thumb's size as far as I can tell. Other platforms' implementations also provide size constraints for NS_THEME_RANGE. > I suspect moz_gtk_get_widget_border should be modified to use trough-border > and wonder whether that would make the minimum size unnecessary? I don't think so, not as long as NS_THEME_RANGE does not accommodate the thumb's size. > NS_THEME_SCALE_THUMB_*, NS_THEME_SCROLLBAR_TRACK_*, and most other widgets > set > *aIsOverridable = false. Is there a reason to use true here? Nope, this was part of an older solution I was working on- I'll fix that up to false. Thanks!
Flags: needinfo?(acomminos)
Assignee | ||
Comment 7•9 years ago
|
||
Sorry, I was wrong; we do need aIsOverridable = true to override the minimum size set for the range in the browser theme's CSS. nsNativeThemeCocoa does the same thing.
Assignee | ||
Comment 8•9 years ago
|
||
Here's an updated patch with your suggestions, thanks.
Attachment #8640609 -
Attachment is obsolete: true
Attachment #8641195 -
Flags: review?(karlt)
Assignee | ||
Comment 9•9 years ago
|
||
Mark aIsOverridable = true.
Attachment #8641195 -
Attachment is obsolete: true
Attachment #8641195 -
Flags: review?(karlt)
Attachment #8641207 -
Flags: review?(karlt)
Comment 10•9 years ago
|
||
(In reply to Karl Tomlinson (ni?:karlt) from comment #5) > If the width across the slider is less, then moz_gtk_scale_paint() > may draw outside its rect, which could cause rendering problems. > If *aIsOverridable = false then that won't happen. Sorry, I misunderstood the meaning of aIsOverridable, assuming true permitted overriding the minimum size, but GetMinimumWidgetSize() documentation says it just permits using a larger size. (In reply to Andrew Comminos [:acomminos] from comment #6) > (In reply to Karl Tomlinson (ni?:karlt) from comment #5) > > It is not usually the role of widget code to set the minimum size for > > container widgets. Usually container widgets set only the border and/or > > padding. Are you sure that the code using NS_THEME_RANGE has a similar bug > > to the code using NS_THEME_SCROLLBAR_TRACK_*? > > Fairly sure. nsRangeFrame doesn't seem to respect the (anonymously created) > thumb's size as far as I can tell. Other platforms' implementations also > provide size constraints for NS_THEME_RANGE. I don't see this in nsNativeThemeWin::GetMinimumWidgetSize() but nsRangeFrame::GetMinISize() doesn't consider its children. https://hg.mozilla.org/mozilla-central/annotate/2ddec2dedced/layout/forms/nsRangeFrame.cpp#l763
Updated•9 years ago
|
Attachment #8641207 -
Flags: review?(karlt) → review+
Assignee | ||
Comment 11•9 years ago
|
||
Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7edb7b53d5fe
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 12•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2162bd0f0411
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2162bd0f0411
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in
before you can comment on or make changes to this bug.
Description
•