From e8e4cb726b0d6f990265b5740476ba062c6df085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=BClker?= Date: Mon, 13 Jan 2025 17:27:31 +0100 Subject: [PATCH] Remove incorrect TODO comment in htmlinputelement.rs (#34970) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add doc comments to InputType Signed-off-by: Simon Wülker * Add doc comment to HtmlInputElement::checked_changed Signed-off-by: Simon Wülker * Remove incorrect TODO comment The comment indicated that we should fire a change event at a radio input when changed the checkedness. This is incorrect, as events should only be fired as part of the input element's activation behaviour. Signed-off-by: Simon Wülker --------- Signed-off-by: Simon Wülker --- components/script/dom/htmlinputelement.rs | 47 ++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index f1c60627082..7c4a1a626cd 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -85,32 +85,76 @@ const DEFAULT_SUBMIT_VALUE: &str = "Submit"; const DEFAULT_RESET_VALUE: &str = "Reset"; const PASSWORD_REPLACEMENT_CHAR: char = '●'; +/// #[derive(Clone, Copy, Default, JSTraceable, PartialEq)] #[allow(dead_code)] #[derive(MallocSizeOf)] pub(crate) enum InputType { + /// Button, + + /// Checkbox, + + /// Color, + + /// Date, + + /// DatetimeLocal, + + /// Email, + + /// File, + + /// Hidden, + + /// Image, + + /// Month, + + /// Number, + + /// Password, + + /// Radio, + + /// Range, + + /// Reset, + + /// Search, + + /// Submit, + + /// Tel, + + /// #[default] Text, + + /// Time, + + /// Url, + + /// Week, } @@ -242,6 +286,8 @@ enum StepDirection { pub(crate) struct HTMLInputElement { htmlelement: HTMLElement, input_type: Cell, + + /// checked_changed: Cell, placeholder: DomRefCell, size: Cell, @@ -1801,7 +1847,6 @@ impl HTMLInputElement { } self.upcast::().dirty(NodeDamage::OtherNodeDamage); - //TODO: dispatch change event } // https://html.spec.whatwg.org/multipage/#concept-fe-mutable