LibWeb: Implement ::file-selector-button pseudo element

The button for a file input now matches `::file-selector-button`.
This commit is contained in:
Luke Warlow 2024-11-30 22:41:00 +00:00 committed by Sam Atkins
commit fdee82d203
Notes: github-actions[bot] 2024-12-05 10:50:48 +00:00
8 changed files with 48 additions and 1 deletions

View file

@ -986,6 +986,8 @@ void HTMLInputElement::create_file_input_shadow_tree()
auto shadow_root = realm.create<DOM::ShadowRoot>(document(), *this, Bindings::ShadowRootMode::Closed);
m_file_button = DOM::create_element(document(), HTML::TagNames::button, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
m_file_button->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::FileSelectorButton);
m_file_label = DOM::create_element(document(), HTML::TagNames::label, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
MUST(m_file_label->set_attribute(HTML::AttributeNames::style, "padding-left: 4px;"_string));