зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1345606. setRangeText should mark the text control as dirty. r=ehsan
MozReview-Commit-ID: 9le2PoelGei
This commit is contained in:
Родитель
ef2cceb1d9
Коммит
0bf4f56f8c
|
@ -6320,7 +6320,9 @@ HTMLInputElement::GetValueFromSetRangeText(nsAString& aValue)
|
|||
nsresult
|
||||
HTMLInputElement::SetValueFromSetRangeText(const nsAString& aValue)
|
||||
{
|
||||
return SetValueInternal(aValue, nsTextEditorState::eSetValue_ByContent);
|
||||
return SetValueInternal(aValue,
|
||||
nsTextEditorState::eSetValue_ByContent |
|
||||
nsTextEditorState::eSetValue_Notify);
|
||||
}
|
||||
|
||||
Nullable<uint32_t>
|
||||
|
|
|
@ -784,7 +784,9 @@ HTMLTextAreaElement::GetValueFromSetRangeText(nsAString& aValue)
|
|||
nsresult
|
||||
HTMLTextAreaElement::SetValueFromSetRangeText(const nsAString& aValue)
|
||||
{
|
||||
return SetValueInternal(aValue, nsTextEditorState::eSetValue_ByContent);
|
||||
return SetValueInternal(aValue,
|
||||
nsTextEditorState::eSetValue_ByContent |
|
||||
nsTextEditorState::eSetValue_Notify);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -200,4 +200,20 @@ for (var data of elemData) {
|
|||
}, `selection location after defaultValue set to shorter than selectionStart of ${data.desc}`);
|
||||
}
|
||||
|
||||
for (var data of elemData) {
|
||||
test(function() {
|
||||
var el = data.factory();
|
||||
this.add_cleanup(() => el.remove());
|
||||
el.defaultValue = sometext;
|
||||
assert_true(sometext.length > 8,
|
||||
"sometext too short, test won't work right");
|
||||
el.selectionStart = 4;
|
||||
el.selectionEnd = 6;
|
||||
el.setRangeText("xyz");
|
||||
el.defaultValue = "set range text";
|
||||
assert_equals(el.value, sometext.slice(0, 4) + "xyz" + sometext.slice(6),
|
||||
"Calling setRangeText should set the value dirty flag");
|
||||
}, `value dirty flag behavior after setRangeText on ${data.desc}`);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
Загрузка…
Ссылка в новой задаче