Closed Bug 1080352 Opened 5 years ago Closed 5 years ago

input type of reset does not reset input type range if input type number is present

Categories

(Core :: Layout: Form Controls, defect)

32 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: mr_andrew_d_rowe, Assigned: mats)

References

Details

(Keywords: testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36

Steps to reproduce:

<!DOCTYPE html>
<html lang="en-us">
    <head>
        <title>input type test</title>
		</head>
		<body>
			<form>
			<label for='inputRange'>Range</label><input id='inputRange' type='range' step='10' min='0' max='50' value='20'><br>
			<label for='inputNumber'>Number</label><input id='inputNumber' type='number' step='10' min='0' max='500' value='30'><br>
				
			<input type='reset'><br>
			</form>
		</body>
</html>


Actual results:

number input will reset but not the range.  When the number input is removed the range value will reset.


Expected results:

 number input will reset and the range value will reset to default values
Testcase 1:
<input type='range'>
<input type='number'>
<input type='reset'>
Only <input type='number'> is reset.

Testcase 2:
<input type='number'>
<input type='range'>
<input type='reset'>
Both 'input' are reset.
Component: Untriaged → Layout: Form Controls
Product: Firefox → Core
Attached patch fix+reftestSplinter Review
This just moves the code that updates the range frame from
SetValue to SetValueInternal.  (Reset calls SetDefaultValueAsValue
which calls SetValueInternal directly.)

Try is closed atm, I'll push it when it opens.
Assignee: nobody → mats
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8502521 - Flags: review?(jwatt)
Keywords: testcase
OS: Windows 7 → All
Hardware: x86 → All
Attachment #8502521 - Flags: review?(jwatt) → review+
Keywords: checkin-needed
Hi Mats,
seems this patch didn't apply cleanly:

applying 1080352
patching file layout/reftests/forms/input/range/reftest.list
Hunk #1 FAILED at 16
1 out of 1 hunks FAILED -- saving rejects to file layout/reftests/forms/input/range/reftest.list.rej

could you take a look, thanks!
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/89e6d7a08fcd
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Duplicate of this bug: 1106148
You need to log in before you can comment on or make changes to this bug.