Bug 1676785 - Simplify XUL special code-path for <input> value setter. r=masayuki
This allows us to remove nsISelectionController.selectAll() and related code too, and should not change behavior. Differential Revision: https://phabricator.services.mozilla.com/D97011
This commit is contained in:
@@ -2641,10 +2641,14 @@ nsresult HTMLInputElement::SetValueInternal(const nsAString& aValue,
|
||||
|
||||
// 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 |= TextControlState::eSetValue_ForXUL;
|
||||
// is a XUL node, we consider our control a XUL control. XUL controls preserve
|
||||
// edit history across value setters.
|
||||
//
|
||||
// TODO(emilio): Rather than doing this maybe add an attribute instead and
|
||||
// read it only on chrome docs or something? That'd allow front-end code to
|
||||
// move away from xul without weird side-effects.
|
||||
if (mParent && mParent->IsXULElement()) {
|
||||
aFlags |= TextControlState::eSetValue_PreserveHistory;
|
||||
}
|
||||
|
||||
switch (GetValueMode()) {
|
||||
|
||||
Reference in New Issue
Block a user