mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb: Add method HTMLInputElement::is_single_line()
This commit is contained in:
parent
df7f7268db
commit
b36a78a798
Notes:
sideshowbarker
2024-07-16 22:26:05 +09:00
Author: https://github.com/rmg-x
Commit: b36a78a798
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/496
2 changed files with 17 additions and 0 deletions
|
@ -2116,6 +2116,21 @@ bool HTMLInputElement::is_submit_button() const
|
||||||
|| type_state() == TypeAttributeState::ImageButton;
|
|| type_state() == TypeAttributeState::ImageButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/input.html#text-(type=text)-state-and-search-state-(type=search)
|
||||||
|
// https://html.spec.whatwg.org/multipage/input.html#password-state-(type=password)
|
||||||
|
// "one line plain text edit control"
|
||||||
|
bool HTMLInputElement::is_single_line() const
|
||||||
|
{
|
||||||
|
// NOTE: For web compatibility reasons, we consider other types
|
||||||
|
// in addition to Text, Search, and Password as single line inputs.
|
||||||
|
return type_state() == TypeAttributeState::Text
|
||||||
|
|| type_state() == TypeAttributeState::Search
|
||||||
|
|| type_state() == TypeAttributeState::Password
|
||||||
|
|| type_state() == TypeAttributeState::Email
|
||||||
|
|| type_state() == TypeAttributeState::Telephone
|
||||||
|
|| type_state() == TypeAttributeState::Number;
|
||||||
|
}
|
||||||
|
|
||||||
bool HTMLInputElement::has_activation_behavior() const
|
bool HTMLInputElement::has_activation_behavior() const
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -168,6 +168,8 @@ public:
|
||||||
// https://html.spec.whatwg.org/multipage/forms.html#concept-submit-button
|
// https://html.spec.whatwg.org/multipage/forms.html#concept-submit-button
|
||||||
virtual bool is_submit_button() const override;
|
virtual bool is_submit_button() const override;
|
||||||
|
|
||||||
|
bool is_single_line() const;
|
||||||
|
|
||||||
virtual void reset_algorithm() override;
|
virtual void reset_algorithm() override;
|
||||||
|
|
||||||
virtual void form_associated_element_was_inserted() override;
|
virtual void form_associated_element_was_inserted() override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue