Bug 1287321 - Don't fire input event on type=range when value hasn't changed. r=baku
This commit is contained in:
@@ -3902,6 +3902,8 @@ HTMLInputElement::SetValueOfRangeForUserEvent(Decimal aValue)
|
||||
{
|
||||
MOZ_ASSERT(aValue.isFinite());
|
||||
|
||||
Decimal oldValue = GetValueAsDecimal();
|
||||
|
||||
nsAutoString val;
|
||||
ConvertNumberToString(aValue, val);
|
||||
// TODO: What should we do if SetValueInternal fails? (The allocation
|
||||
@@ -3912,10 +3914,13 @@ HTMLInputElement::SetValueOfRangeForUserEvent(Decimal aValue)
|
||||
if (frame) {
|
||||
frame->UpdateForValueChange();
|
||||
}
|
||||
nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
|
||||
static_cast<nsIDOMHTMLInputElement*>(this),
|
||||
NS_LITERAL_STRING("input"), true,
|
||||
false);
|
||||
|
||||
if (GetValueAsDecimal() != oldValue) {
|
||||
nsContentUtils::DispatchTrustedEvent(OwnerDoc(),
|
||||
static_cast<nsIDOMHTMLInputElement*>(this),
|
||||
NS_LITERAL_STRING("input"), true,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user