Bug 1080352 - Update the rendering for <input type=range> after it was reset. r=jwatt

This commit is contained in:
Mats Palmgren 2014-10-13 11:48:33 +00:00
parent beb08bd4f1
commit c3b2f7f0d5
4 changed files with 34 additions and 8 deletions

View File

@ -1833,13 +1833,6 @@ HTMLInputElement::SetValue(const nsAString& aValue, ErrorResult& aRv)
SetValueInternal(aValue, false, true);
if (mType == NS_FORM_INPUT_RANGE) {
nsRangeFrame* frame = do_QueryFrame(GetPrimaryFrame());
if (frame) {
frame->UpdateForValueChange();
}
}
if (mFocusedValue.Equals(currentValue)) {
GetValue(mFocusedValue);
}
@ -2848,6 +2841,11 @@ HTMLInputElement::SetValueInternal(const nsAString& aValue,
if (numberControlFrame) {
numberControlFrame->SetValueOfAnonTextControl(value);
}
} else if (mType == NS_FORM_INPUT_RANGE) {
nsRangeFrame* frame = do_QueryFrame(GetPrimaryFrame());
if (frame) {
frame->UpdateForValueChange();
}
}
if (!mParserCreating) {
OnValueChanged(true);

View File

@ -22,6 +22,7 @@ fuzzy-if(B2G,1,1) == stepDown.html 75pct-common-ref.html
== stepUp-unthemed.html 75pct-unthemed-common-ref.html
== stepUp.html 75pct-common-ref.html
fuzzy-if(B2G,1,1) == max-prop.html 100pct-common-ref.html
== reset-value.html reset-value-ref.html
# 'direction' property:
== direction-unthemed-1.html direction-unthemed-1-ref.html
@ -30,4 +31,3 @@ fuzzy-if(B2G,1,1) == max-prop.html 100pct-common-ref.html
fails-if(B2G||Android) == moz-range-progress-1.html moz-range-progress-1-ref.html
== moz-range-progress-2.html moz-range-progress-2-ref.html
== moz-range-progress-3.html moz-range-progress-3-ref.html

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>1080352</title>
</head>
<body>
<form id="form">
<input id='inputRange' type='range' step='10' min='0' max='50' value='20'><br>
<input id='inputNumber' type='number' step='10' min='0' max='500' value='30'><br>
<input type='reset'><br>
</form>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en-us">
<head>
<title>1080352</title>
</head>
<body onload="inputRange.value=40;inputNumber.value=40; form.reset()">
<form id="form">
<input id='inputRange' type='range' step='10' min='0' max='50' value='20'><br>
<input id='inputNumber' type='number' step='10' min='0' max='500' value='30'><br>
<input type='reset'><br>
</form>
</body>
</html>