Last Comment Bug 556009 - Implement step attribute for <input type='number'>
: Implement step attribute for <input type='number'>
Status: RESOLVED FIXED
: doc-bug-filed, html5
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
-- normal with 6 votes (vote)
: mozilla16
Assigned To: Mounir Lamouri (:mounir)
:
: Andrew Overholt [:overholt]
Mentors:
http://www.whatwg.org/specs/web-apps/...
Depends on: 636750
Blocks: 559753 563637 344616
  Show dependency treegraph
 
Reported: 2010-03-30 09:37 PDT by Mounir Lamouri (:mounir)
Modified: 2013-04-27 15:05 PDT (History)
16 users (show)
mounir: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Part 1 - Add the attribute (4.43 KB, patch)
2011-02-24 17:19 PST, Mounir Lamouri (:mounir)
jonas: review+
Details | Diff | Splinter Review
Part 2 - Constraint validation (21.78 KB, patch)
2011-02-24 17:21 PST, Mounir Lamouri (:mounir)
no flags Details | Diff | Splinter Review
Part 2 - Constraint validation (21.87 KB, patch)
2011-02-24 17:36 PST, Mounir Lamouri (:mounir)
no flags Details | Diff | Splinter Review
Part 2 - Constraint validation (22.00 KB, patch)
2011-02-28 08:44 PST, Mounir Lamouri (:mounir)
jonas: review+
Details | Diff | Splinter Review
Review comments (2.86 KB, patch)
2011-04-21 02:31 PDT, Mounir Lamouri (:mounir)
no flags Details | Diff | Splinter Review

Description User image Mounir Lamouri (:mounir) 2010-03-30 09:37:44 PDT
"The step  attribute indicates the granularity that is expected (and required) of the value, by limiting the allowed values. The section that defines the type attribute's current state also defines the default step and the step scale factor, which are used in processing the attribute as described below."
Comment 1 User image Mounir Lamouri (:mounir) 2011-02-21 16:17:45 PST
I'm going to use this bug for <input type='number'> implementation of the step attribute.
Comment 2 User image Mounir Lamouri (:mounir) 2011-02-24 17:19:11 PST
Created attachment 514959 [details] [diff] [review]
Part 1 - Add the attribute
Comment 3 User image Mounir Lamouri (:mounir) 2011-02-24 17:21:04 PST
Created attachment 514960 [details] [diff] [review]
Part 2 - Constraint validation

Some refactoring could be done by adding GetMin() and GetMax() but it's not really trivial given that we sometimes already have the string representation. I might do that in a separate bug.
Comment 4 User image Mounir Lamouri (:mounir) 2011-02-24 17:36:47 PST
Created attachment 514962 [details] [diff] [review]
Part 2 - Constraint validation

Oups, I missed that 'any' comparaison had to be case-insensitive...
Comment 5 User image Mounir Lamouri (:mounir) 2011-02-24 18:01:59 PST
(In reply to comment #3)
> Created attachment 514960 [details] [diff] [review]
> Part 2 - Constraint validation
> 
> Some refactoring could be done by adding GetMin() and GetMax() but it's not
> really trivial given that we sometimes already have the string representation.
> I might do that in a separate bug.

I've open bug 636634.
Comment 6 User image Mounir Lamouri (:mounir) 2011-02-28 08:44:01 PST
Created attachment 515637 [details] [diff] [review]
Part 2 - Constraint validation

Use double instead of float.
Comment 7 User image Jonas Sicking (:sicking) No longer reading bugmail consistently 2011-04-18 19:43:36 PDT
Comment on attachment 515637 [details] [diff] [review]
Part 2 - Constraint validation

Get rid of GetDefaultStep and just use 1 for now, also get rid of GetDefaultStepScaleFactor. We can always add them later if they make sense then.
Comment 8 User image Mounir Lamouri (:mounir) 2011-04-21 02:31:49 PDT
Created attachment 527502 [details] [diff] [review]
Review comments

Attaching the changes I've made to apply the review comments. Just for information. I'm not asking a review on them given (sounds useless).
Comment 10 User image Florian Scholz [:fscholz] (MDN) 2013-04-27 15:05:55 PDT
See bug 866457 for documentation.

Note You need to log in before you can comment on or make changes to this bug.