Bug 1386222 - Ensure that we always respect the undo/redo transaction history when modifying the <xul:textbox>.value dynamically through script; r=bzbarsky

This commit is contained in:
Ehsan Akhgari
2017-08-01 12:47:07 -04:00
parent 0c63334040
commit 0503c1edbd
5 changed files with 50 additions and 1 deletions

View File

@@ -3001,6 +3001,14 @@ HTMLInputElement::SetValueInternal(const nsAString& aValue,
NS_PRECONDITION(GetValueMode() != VALUE_MODE_FILENAME,
"Don't call SetValueInternal for file inputs");
// We want to remember if the SetValueInternal() call is being made for a XUL
// element. We do that by looking at the parent node here, and if that node
// is a XUL node, we consider our control a XUL control.
nsIContent* parent = GetParent();
if (parent && parent->IsXULElement()) {
aFlags |= nsTextEditorState::eSetValue_ForXUL;
}
switch (GetValueMode()) {
case VALUE_MODE_VALUE:
{