mirror of
https://github.com/servo/servo
synced 2026-04-28 10:27:40 +02:00
script: Use TextInputWidget to implement <textarea> shadow DOM (#43770)
In addition to making it so that textual `<input>` and `<textarea>` share a common shadow DOM structure, this allows styling the `<textarea>` placeholder. It is now properly shown in grey. Testing: This fixes a few WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
@@ -905,10 +905,6 @@ impl HTMLInputElement {
|
||||
fn textinput_mut(&self) -> RefMut<'_, TextInput<EmbedderClipboardProvider>> {
|
||||
self.textinput.borrow_mut()
|
||||
}
|
||||
|
||||
fn placeholder(&self) -> Ref<'_, DOMString> {
|
||||
self.placeholder.borrow()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) trait LayoutHTMLInputElementHelpers<'dom> {
|
||||
@@ -993,6 +989,18 @@ impl TextControlElement for HTMLInputElement {
|
||||
};
|
||||
self.owner_window().layout().set_needs_new_display_list();
|
||||
}
|
||||
|
||||
fn is_password_field(&self) -> bool {
|
||||
matches!(*self.input_type(), InputType::Password(_))
|
||||
}
|
||||
|
||||
fn placeholder_text<'a>(&'a self) -> Ref<'a, DOMString> {
|
||||
self.placeholder.borrow()
|
||||
}
|
||||
|
||||
fn value_text(&self) -> DOMString {
|
||||
self.Value()
|
||||
}
|
||||
}
|
||||
|
||||
impl HTMLInputElementMethods<crate::DomTypeHolder> for HTMLInputElement {
|
||||
|
||||
Reference in New Issue
Block a user