/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use std::cell::{Cell, Ref, RefCell}; use std::default::Default; use dom_struct::dom_struct; use embedder_traits::{EmbedderControlRequest, InputMethodRequest, InputMethodType}; use fonts::{ByteIndex, TextByteRange}; use html5ever::{LocalName, Prefix, local_name, ns}; use js::context::JSContext; use js::rust::HandleObject; use layout_api::{ScriptSelection, SharedSelection}; use servo_base::text::Utf16CodeUnitLength; use style::attr::AttrValue; use stylo_dom::ElementState; use crate::clipboard_provider::EmbedderClipboardProvider; use crate::dom::attr::Attr; use crate::dom::bindings::cell::DomRefCell; use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods; use crate::dom::bindings::codegen::Bindings::HTMLFormElementBinding::SelectionMode; use crate::dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods; use crate::dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use crate::dom::bindings::error::ErrorResult; use crate::dom::bindings::inheritance::Castable; use crate::dom::bindings::refcounted::Trusted; use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom}; use crate::dom::bindings::str::DOMString; use crate::dom::clipboardevent::{ClipboardEvent, ClipboardEventType}; use crate::dom::compositionevent::CompositionEvent; use crate::dom::document::Document; use crate::dom::document_embedder_controls::ControlElement; use crate::dom::element::{AttributeMutation, Element}; use crate::dom::event::Event; use crate::dom::event::event::{EventBubbles, EventCancelable, EventComposed}; use crate::dom::eventtarget::EventTarget; use crate::dom::html::htmlelement::HTMLElement; use crate::dom::html::htmlfieldsetelement::HTMLFieldSetElement; use crate::dom::html::htmlformelement::{FormControl, HTMLFormElement}; use crate::dom::html::input_element::HTMLInputElement; use crate::dom::htmlinputelement::text_input_widget::TextInputWidget; use crate::dom::keyboardevent::KeyboardEvent; use crate::dom::node::{ BindContext, ChildrenMutation, CloneChildrenFlag, Node, NodeDamage, NodeTraits, UnbindContext, }; use crate::dom::nodelist::NodeList; use crate::dom::textcontrol::{TextControlElement, TextControlSelection}; use crate::dom::types::{FocusEvent, MouseEvent}; 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, TextInput}; #[dom_struct] pub(crate) struct HTMLTextAreaElement { htmlelement: HTMLElement, #[no_trace] textinput: DomRefCell>, placeholder: RefCell, // https://html.spec.whatwg.org/multipage/#concept-textarea-dirty value_dirty: Cell, form_owner: MutNullableDom, labels_node_list: MutNullableDom, validity_state: MutNullableDom, /// A [`TextInputWidget`] that manages the shadow DOM for this `