script: Simplify TextInput::new (#41975)

This constructors takes more arguments than it needs to. The three
arguments removed are almost always the default values. The exception is
in the unit tests. In this change those calls are modified to use
`set_max_length` like is done in the actual script code.

Testing: This is just a simplification of the code, so should be covered
by existing tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson
2026-01-17 15:04:28 +01:00
committed by GitHub
parent 37cef428de
commit 1a92d62a97
4 changed files with 20 additions and 71 deletions

View File

@@ -49,9 +49,7 @@ use crate::dom::validation::{Validatable, is_barred_by_datalist_ancestor};
use crate::dom::validitystate::{ValidationFlags, ValidityState};
use crate::dom::virtualmethods::VirtualMethods;
use crate::script_runtime::CanGc;
use crate::textinput::{
ClipboardEventFlags, IsComposing, KeyReaction, Lines, SelectionDirection, TextInput,
};
use crate::textinput::{ClipboardEventFlags, IsComposing, KeyReaction, Lines, TextInput};
#[dom_struct]
pub(crate) struct HTMLTextAreaElement {
@@ -145,9 +143,6 @@ impl HTMLTextAreaElement {
embedder_sender,
webview_id: document.webview_id(),
},
None,
None,
SelectionDirection::None,
)),
value_dirty: Cell::new(false),
form_owner: Default::default(),