Bug 24703 - Support snapping, ticks for <input type="range">
Summary: Support snapping, ticks for <input type="range">
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on: 27450 27451
Blocks: HTML5Forms
  Show dependency treegraph
Reported: 2009-03-19 14:27 PDT by Peter Kasting
Modified: 2013-03-28 01:36 PDT (History)
10 users (show)

See Also:

Testcase (72 bytes, text/html)
2009-03-19 14:27 PDT, Peter Kasting
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kasting 2009-03-19 14:27:21 PDT
<input type="range" min="1" max="3" step="1"> draws as an unmarked slider that slides smoothly from one end to the other.  It would be nicer to have tickmarks and to snap to them.  Try using Opera for a sample experience.
Comment 1 Peter Kasting 2009-03-19 14:27:46 PDT
Created attachment 28763 [details]
Comment 2 Peter Kasting 2009-03-27 14:40:02 PDT
Hixie says: Draw tickmarks as given in list="".  If no list="", draw them for step="", unless step has been set to "any".

Hyatt says: 
Comment 3 Peter Kasting 2009-03-27 14:40:58 PDT
Bah, didn't mean to submit that yet.  Anyway, Hyatt says: Don't want ticks by default.  Perhaps also no ticks for step=1.
Comment 4 Peter Kasting 2009-03-27 14:59:46 PDT
My proposal: Do what Hixie says, but also don't draw tickmarks if we don't have enough room.  Assuming 1-px ticks, you'd need 2n + 1 pixels or more.  If the theme only goes down to k-px ticks, we'd probably want k(2n + 1) free pixels; below that, no tickmarks + no snapping.

Hopefully, this avoids breaking too many existing Mac widgets that don't want tickmarks, e.g. the Safari RSS widget, because they'd fail the 2n + 1 test.
Comment 5 Radar WebKit Bug Importer 2011-09-06 14:41:32 PDT
Comment 6 Ravi Phaneendra Kasibhatla 2011-10-13 05:22:09 PDT
Is this issue still valid? If yes, I would like to propose a patch for the same.
Comment 7 Peter Kasting 2011-10-13 11:05:12 PDT
(In reply to comment #6)
> Is this issue still valid?

It's not closed and no one has commented otherwise, so assume yes.
Comment 8 Kent Tamura 2011-10-13 19:47:21 PDT
(In reply to comment #6)
> Is this issue still valid? If yes, I would like to propose a patch for the same.

I think Comment #2 to #4 are reasonable.
Comment 9 Kent Tamura 2013-03-28 01:36:55 PDT
This was done as <datalist> support.