Closed Bug 771561 Opened 9 years ago Closed 7 years ago

stepUp() and stepDown() shouldn't be a no-op when value is NaN

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: mounir, Assigned: jwatt)

References

()

Details

(Whiteboard: [qa-])

Attachments

(1 file)

I think we could do:
1. for stepDown(), we set the value to max if it exists, to stepbase otherwise;
   for stepUp(), we set the value to min if it exists, to stepbase otherwise.
2. for stepDown() we set the value to stepabase - step;
   for stepUp() we set the value to stepbase + step.
3. for stepDown and stepUp() we set the value to stepBase.

Chrome's behavior is a mix between 2 and 3.
Opera's behavior is 1.

Maybe UX should be involved there.
I think this is too low-level for UX, based on past experience.

I would vote for 1.
Attached patch patchSplinter Review
Assignee: nobody → jwatt
Attachment #8334065 - Flags: review?(bugs)
Note that the spec now defines the behavior here:

http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#dom-input-stepup

Where it says:

  If applying the algorithm to convert a string to a number to
  the string given by the element's value does not result in an
  error, then let value be the result of that algorithm.
  Otherwise, let value be zero.

So we should use zero.
Attachment #8334065 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/4660efcc53f9
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.