Open Bug 835773 Opened 11 years ago Updated 2 years ago

Align stepUp() and stepDown() implementation to HTML spec

Categories

(Core :: DOM: Forms, defect, P5)

defect

Tracking

()

People

(Reporter: mounir, Unassigned)

References

()

Details

(Keywords: dev-doc-needed)

For the moment, the difference I see with the specs are:
- http://html5.org/tools/web-apps-tracker?from=7644&to=7645 (we leave if we have no value instead of using value=0);
- we tend to clamp very often (value < min or value > man), I think the speak is less aggressive than us regarding clamping.

I'm fine with fixing the first part to follow the specs. I believe our behaviour regarding clamping is better though.
Looking a bit more, I see three things that I would like to change in the specs:
- point 6: I think we should use the lower value if we go up and the higher if we go down. The idea is that value=3, min=0 step=2, stepUp() should go to 4 and stepDown() to 2;
- point 7: we should not leave but do value = minimum;
- point 8: we should not leave but do value = maximum.
Actually, the issue in point 6 is that it doesn't take into account stepUp(n) and stepDown(n) with n>1. In that case, it will do a stepUp(1) and stepDown(1) (with th expected behaviour). To fix that, we should simply round the opposite way (not like the spec say, but as my previous comment say) and then run the steps that are in "Otherwise".
Priority: -- → P5
Component: DOM: Core & HTML → DOM: Forms
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.