html_sys/edits/
del.rs

1/// The HTML `<del>` element
2///
3/// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del)
4#[doc(alias = "del")]
5#[non_exhaustive]
6#[derive(Debug, Clone, PartialEq, Default)]
7pub struct DeletedText {
8    pub data_map: crate::DataMap,
9    global_attrs: crate::GlobalAttributes,
10    /// Link to the source of the quotation or more information about the edit
11    pub cite: std::option::Option<std::borrow::Cow<'static, str>>,
12    /// Date and (optionally) time of the change
13    pub date_time: std::option::Option<std::borrow::Cow<'static, str>>,
14    /// Describes the role(s) the current element plays in the context of the document.
15    pub role: std::option::Option<std::borrow::Cow<'static, str>>,
16    /// Identifies the currently active element when DOM focus is on a composite widget, combobox, textbox, group, or application.
17    pub aria_active_descendant_element: std::option::Option<
18        std::borrow::Cow<'static, str>,
19    >,
20    /// Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
21    pub aria_atomic: bool,
22    /// Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for a combobox, searchbox, or textbox and specifies how predictions would be presented if they were made.
23    pub aria_auto_complete: std::option::Option<std::borrow::Cow<'static, str>>,
24    /// Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille. See related aria-roledescription.
25    pub aria_braille_role_description: std::option::Option<
26        std::borrow::Cow<'static, str>,
27    >,
28    /// Indicates an element is being modified and that assistive technologies could wait until the modifications are complete before exposing them to the user.
29    pub aria_busy: bool,
30    /// Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. See related aria-pressed and aria-selected.
31    pub aria_checked: std::option::Option<std::borrow::Cow<'static, str>>,
32    /// Defines the total number of columns in a table, grid, or treegrid. See related aria-colindex.
33    pub aria_col_count: std::option::Option<i64>,
34    /// Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. See related aria-colindextext, aria-colcount, and aria-colspan.
35    pub aria_col_index: std::option::Option<i64>,
36    /// Defines a human readable text alternative of aria-colindex. See related aria-rowindextext.
37    pub aria_col_index_text: std::option::Option<std::borrow::Cow<'static, str>>,
38    /// Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. See related aria-colindex and aria-rowspan.
39    pub aria_col_span: std::option::Option<i64>,
40    /// Identifies the element (or elements) whose contents or presence are controlled by the current element. See related aria-owns.
41    pub aria_controls_elements: std::option::Option<std::borrow::Cow<'static, str>>,
42    /// Indicates the element that represents the current item within a container or set of related elements.
43    pub aria_current: std::option::Option<std::borrow::Cow<'static, str>>,
44    /// Identifies the element (or elements) that describes the object. See related aria-labelledby and aria-description.
45    pub aria_described_by_elements: std::option::Option<std::borrow::Cow<'static, str>>,
46    /// Defines a string value that describes or annotates the current element. See related aria-describedby.
47    pub aria_description: std::option::Option<std::borrow::Cow<'static, str>>,
48    /// Identifies the element (or elements) that provide additional information related to the object. See related aria-describedby.
49    pub aria_details_elements: std::option::Option<std::borrow::Cow<'static, str>>,
50    /// Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. See related aria-hidden and aria-readonly.
51    pub aria_disabled: bool,
52    /// [Deprecated in ARIA 1.1] Indicates what functions can be performed when a dragged object is released on the drop target.
53    pub aria_drop_effect: std::option::Option<std::borrow::Cow<'static, str>>,
54    /// Identifies the element (or elements) that provides an error message for an object. See related aria-invalid and aria-describedby.
55    pub aria_error_message_elements: std::option::Option<std::borrow::Cow<'static, str>>,
56    /// Indicates whether a grouping element owned or controlled by this element is expanded or collapsed.
57    pub aria_expanded: bool,
58    /// Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
59    pub aria_flow_to_elements: std::option::Option<std::borrow::Cow<'static, str>>,
60    /// [Deprecated in ARIA 1.1] Indicates an element's "grabbed" state in a drag-and-drop operation.
61    pub aria_grabbed: bool,
62    /// Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
63    pub aria_has_popup: std::option::Option<std::borrow::Cow<'static, str>>,
64    /// Indicates whether the element is exposed to an accessibility API. See related aria-disabled.
65    pub aria_hidden: bool,
66    /// Indicates the entered value does not conform to the format expected by the application. See related aria-errormessage.
67    pub aria_invalid: std::option::Option<std::borrow::Cow<'static, str>>,
68    /// Defines keyboard shortcuts that an author has implemented to activate or give focus to an element.
69    pub aria_key_shortcuts: std::option::Option<std::borrow::Cow<'static, str>>,
70    /// Defines the hierarchical level of an element within a structure.
71    pub aria_level: std::option::Option<i64>,
72    /// Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
73    pub aria_live: std::option::Option<std::borrow::Cow<'static, str>>,
74    /// Indicates whether an element is modal when displayed.
75    pub aria_modal: bool,
76    /// Indicates whether a text box accepts multiple lines of input or only a single line.
77    pub aria_multi_line: bool,
78    /// Indicates that the user can select more than one item from the current selectable descendants.
79    pub aria_multi_selectable: bool,
80    /// Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
81    pub aria_orientation: std::option::Option<std::borrow::Cow<'static, str>>,
82    /// Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship. See related aria-controls.
83    pub aria_owns_elements: std::option::Option<std::borrow::Cow<'static, str>>,
84    /// Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
85    pub aria_placeholder: std::option::Option<std::borrow::Cow<'static, str>>,
86    /// Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-setsize.
87    pub aria_pos_in_set: std::option::Option<i64>,
88    /// Indicates the current "pressed" state of toggle buttons. See related aria-checked and aria-selected.
89    pub aria_pressed: std::option::Option<std::borrow::Cow<'static, str>>,
90    ///  Indicates that the element is not editable, but is otherwise operable. See related aria-disabled.
91    pub aria_read_only: bool,
92    /// Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. See related aria-atomic.
93    pub aria_relevant: std::option::Option<std::borrow::Cow<'static, str>>,
94    /// Indicates that user input is required on the element before a form can be submitted.
95    pub aria_required: bool,
96    /// Defines a human-readable, author-localized description for the role of an element.
97    pub aria_role_description: std::option::Option<std::borrow::Cow<'static, str>>,
98    /// Defines the total number of rows in a table, grid, or treegrid. See related aria-rowindex.
99    pub aria_row_count: std::option::Option<i64>,
100    /// Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. See related aria-rowindextext, aria-rowcount, and aria-rowspan.
101    pub aria_row_index: std::option::Option<i64>,
102    /// Defines a human readable text alternative of aria-rowindex. See related aria-colindextext.
103    pub aria_row_index_text: std::option::Option<std::borrow::Cow<'static, str>>,
104    /// Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. See related aria-rowindex and aria-colspan.
105    pub aria_row_span: std::option::Option<i64>,
106    /// Indicates the current "selected" state of various widgets. See related aria-checked and aria-pressed.
107    pub aria_selected: bool,
108    /// Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. See related aria-posinset.
109    pub aria_set_size: std::option::Option<i64>,
110    /// Indicates if items in a table or grid are sorted in ascending or descending order.
111    pub aria_sort: std::option::Option<std::borrow::Cow<'static, str>>,
112    /// Defines the maximum allowed value for a range widget.
113    pub aria_value_max: std::option::Option<f64>,
114    /// Defines the minimum allowed value for a range widget.
115    pub aria_value_min: std::option::Option<f64>,
116    /// Defines the current value for a range widget. See related aria-valuetext.
117    pub aria_value_now: std::option::Option<f64>,
118    /// Defines the human readable text alternative of aria-valuenow for a range widget.
119    pub aria_value_text: std::option::Option<std::borrow::Cow<'static, str>>,
120}
121impl crate::RenderElement for DeletedText {
122    fn write_opening_tag<W: std::fmt::Write>(&self, writer: &mut W) -> std::fmt::Result {
123        write!(writer, "<del")?;
124        if let Some(field) = self.cite.as_ref() {
125            write!(writer, r#" cite="{field}""#)?;
126        }
127        if let Some(field) = self.date_time.as_ref() {
128            write!(writer, r#" datetime="{field}""#)?;
129        }
130        if let Some(field) = self.role.as_ref() {
131            write!(writer, r#" role="{field}""#)?;
132        }
133        if let Some(field) = self.aria_active_descendant_element.as_ref() {
134            write!(writer, r#" aria-activedescendant="{field}""#)?;
135        }
136        if self.aria_atomic {
137            write!(writer, r#" aria-atomic"#)?;
138        }
139        if let Some(field) = self.aria_auto_complete.as_ref() {
140            write!(writer, r#" aria-autocomplete="{field}""#)?;
141        }
142        if let Some(field) = self.aria_braille_role_description.as_ref() {
143            write!(writer, r#" aria-brailleroledescription="{field}""#)?;
144        }
145        if self.aria_busy {
146            write!(writer, r#" aria-busy"#)?;
147        }
148        if let Some(field) = self.aria_checked.as_ref() {
149            write!(writer, r#" aria-checked="{field}""#)?;
150        }
151        if let Some(field) = self.aria_col_count.as_ref() {
152            write!(writer, r#" aria-colcount="{field}""#)?;
153        }
154        if let Some(field) = self.aria_col_index.as_ref() {
155            write!(writer, r#" aria-colindex="{field}""#)?;
156        }
157        if let Some(field) = self.aria_col_index_text.as_ref() {
158            write!(writer, r#" aria-colindextext="{field}""#)?;
159        }
160        if let Some(field) = self.aria_col_span.as_ref() {
161            write!(writer, r#" aria-colspan="{field}""#)?;
162        }
163        if let Some(field) = self.aria_controls_elements.as_ref() {
164            write!(writer, r#" aria-controls="{field}""#)?;
165        }
166        if let Some(field) = self.aria_current.as_ref() {
167            write!(writer, r#" aria-current="{field}""#)?;
168        }
169        if let Some(field) = self.aria_described_by_elements.as_ref() {
170            write!(writer, r#" aria-describedby="{field}""#)?;
171        }
172        if let Some(field) = self.aria_description.as_ref() {
173            write!(writer, r#" aria-description="{field}""#)?;
174        }
175        if let Some(field) = self.aria_details_elements.as_ref() {
176            write!(writer, r#" aria-details="{field}""#)?;
177        }
178        if self.aria_disabled {
179            write!(writer, r#" aria-disabled"#)?;
180        }
181        if let Some(field) = self.aria_drop_effect.as_ref() {
182            write!(writer, r#" aria-dropeffect="{field}""#)?;
183        }
184        if let Some(field) = self.aria_error_message_elements.as_ref() {
185            write!(writer, r#" aria-errormessage="{field}""#)?;
186        }
187        if self.aria_expanded {
188            write!(writer, r#" aria-expanded"#)?;
189        }
190        if let Some(field) = self.aria_flow_to_elements.as_ref() {
191            write!(writer, r#" aria-flowto="{field}""#)?;
192        }
193        if self.aria_grabbed {
194            write!(writer, r#" aria-grabbed"#)?;
195        }
196        if let Some(field) = self.aria_has_popup.as_ref() {
197            write!(writer, r#" aria-haspopup="{field}""#)?;
198        }
199        if self.aria_hidden {
200            write!(writer, r#" aria-hidden"#)?;
201        }
202        if let Some(field) = self.aria_invalid.as_ref() {
203            write!(writer, r#" aria-invalid="{field}""#)?;
204        }
205        if let Some(field) = self.aria_key_shortcuts.as_ref() {
206            write!(writer, r#" aria-keyshortcuts="{field}""#)?;
207        }
208        if let Some(field) = self.aria_level.as_ref() {
209            write!(writer, r#" aria-level="{field}""#)?;
210        }
211        if let Some(field) = self.aria_live.as_ref() {
212            write!(writer, r#" aria-live="{field}""#)?;
213        }
214        if self.aria_modal {
215            write!(writer, r#" aria-modal"#)?;
216        }
217        if self.aria_multi_line {
218            write!(writer, r#" aria-multiline"#)?;
219        }
220        if self.aria_multi_selectable {
221            write!(writer, r#" aria-multiselectable"#)?;
222        }
223        if let Some(field) = self.aria_orientation.as_ref() {
224            write!(writer, r#" aria-orientation="{field}""#)?;
225        }
226        if let Some(field) = self.aria_owns_elements.as_ref() {
227            write!(writer, r#" aria-owns="{field}""#)?;
228        }
229        if let Some(field) = self.aria_placeholder.as_ref() {
230            write!(writer, r#" aria-placeholder="{field}""#)?;
231        }
232        if let Some(field) = self.aria_pos_in_set.as_ref() {
233            write!(writer, r#" aria-posinset="{field}""#)?;
234        }
235        if let Some(field) = self.aria_pressed.as_ref() {
236            write!(writer, r#" aria-pressed="{field}""#)?;
237        }
238        if self.aria_read_only {
239            write!(writer, r#" aria-readonly"#)?;
240        }
241        if let Some(field) = self.aria_relevant.as_ref() {
242            write!(writer, r#" aria-relevant="{field}""#)?;
243        }
244        if self.aria_required {
245            write!(writer, r#" aria-required"#)?;
246        }
247        if let Some(field) = self.aria_role_description.as_ref() {
248            write!(writer, r#" aria-roledescription="{field}""#)?;
249        }
250        if let Some(field) = self.aria_row_count.as_ref() {
251            write!(writer, r#" aria-rowcount="{field}""#)?;
252        }
253        if let Some(field) = self.aria_row_index.as_ref() {
254            write!(writer, r#" aria-rowindex="{field}""#)?;
255        }
256        if let Some(field) = self.aria_row_index_text.as_ref() {
257            write!(writer, r#" aria-rowindextext="{field}""#)?;
258        }
259        if let Some(field) = self.aria_row_span.as_ref() {
260            write!(writer, r#" aria-rowspan="{field}""#)?;
261        }
262        if self.aria_selected {
263            write!(writer, r#" aria-selected"#)?;
264        }
265        if let Some(field) = self.aria_set_size.as_ref() {
266            write!(writer, r#" aria-setsize="{field}""#)?;
267        }
268        if let Some(field) = self.aria_sort.as_ref() {
269            write!(writer, r#" aria-sort="{field}""#)?;
270        }
271        if let Some(field) = self.aria_value_max.as_ref() {
272            write!(writer, r#" aria-valuemax="{field}""#)?;
273        }
274        if let Some(field) = self.aria_value_min.as_ref() {
275            write!(writer, r#" aria-valuemin="{field}""#)?;
276        }
277        if let Some(field) = self.aria_value_now.as_ref() {
278            write!(writer, r#" aria-valuenow="{field}""#)?;
279        }
280        if let Some(field) = self.aria_value_text.as_ref() {
281            write!(writer, r#" aria-valuetext="{field}""#)?;
282        }
283        write!(writer, "{}", self.global_attrs)?;
284        write!(writer, "{}", self.data_map)?;
285        write!(writer, ">")?;
286        Ok(())
287    }
288    #[allow(unused_variables)]
289    fn write_closing_tag<W: std::fmt::Write>(&self, writer: &mut W) -> std::fmt::Result {
290        write!(writer, "</del>")?;
291        Ok(())
292    }
293}
294impl std::fmt::Display for DeletedText {
295    fn fmt(&self, writer: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
296        use crate::RenderElement;
297        self.write_opening_tag(writer)?;
298        self.write_closing_tag(writer)?;
299        Ok(())
300    }
301}
302impl std::ops::Deref for DeletedText {
303    type Target = crate::GlobalAttributes;
304    fn deref(&self) -> &Self::Target {
305        &self.global_attrs
306    }
307}
308impl std::ops::DerefMut for DeletedText {
309    fn deref_mut(&mut self) -> &mut Self::Target {
310        &mut self.global_attrs
311    }
312}