Closed Bug 813936 Opened 13 years ago Closed 13 years ago

Update nsHTMLInputElement::GetStepBase() to return the default value if there is no min

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: mounir, Assigned: mounir)

Details

(Keywords: doc-bug-filed)

Attachments

(1 file)

See http://html5.org/tools/web-apps-tracker?from=7516&to=7517 It makes this valid: <input type='number' value='1' step='2'> otherwise, '1' wouldn't be a valid value because the step base is 0 and all pair values would have been allowed. The developer would have had to set @min to an odd number to have the expected behaviour.
Attached patch PatchSplinter Review
More work with the tests than the patch :'(
Assignee: nobody → mounir
Status: NEW → ASSIGNED
Attachment #684739 - Flags: review?(bugs)
(In reply to Mounir Lamouri (:mounir) from comment #1) > More work with the tests than the patch :'( Isn't that the norm.
Comment on attachment 684739 [details] [diff] [review] Patch > nsHTMLInputElement::GetStepBase() const > { > double stepBase = GetMinAsDouble(); > >+ // If @min is not a double, we should use defaultValue. >+ if (MOZ_DOUBLE_IS_NaN(stepBase)) { >+ nsAutoString stringValue; >+ nsresult ec; >+ >+ GetAttr(kNameSpaceID_None, nsGkAtoms::value, stringValue); >+ stepBase = stringValue.ToDouble(&ec); nsresult ec; should be right before stepBase = stringValue.ToDouble(&ec) >-var input = document.createElement("input"); >-document.getElementById('content').appendChild(input); >+function getFreshElement(data) { >+ var elmt = document.createElement('input'); >+ elmt.type = data[0]; >+ return elmt; >+} This is somewhat odd. Don't pass array to this function, but just type.
Attachment #684739 - Flags: review?(bugs) → review+
Flags: in-testsuite+
Target Milestone: --- → mozilla20
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
See bug 866457 #c1 for documentation.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: