mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-08 16:12:23 +02:00
LibWeb/HTML: Implement and use "optional value"
Corresponds to f3444c23ff
Also import a test.
This commit is contained in:
committed by
Tim Ledbetter
parent
22cc36eeaa
commit
af17f38bbf
Notes:
github-actions[bot]
2025-07-08 16:10:58 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/af17f38bbf6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5353 Reviewed-by: https://github.com/tcl3 ✅
@@ -119,9 +119,17 @@ bool HTMLButtonElement::is_submit_button() const
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element:concept-fe-value
|
||||
String HTMLButtonElement::value() const
|
||||
{
|
||||
// The element's value is the value of the element's value attribute, if there is one; otherwise the empty string.
|
||||
return attribute(AttributeNames::value).value_or(String {});
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element:concept-fe-optional-value
|
||||
Optional<String> HTMLButtonElement::optional_value() const
|
||||
{
|
||||
// The element's optional value is the value of the element's value attribute, if there is one; otherwise null.
|
||||
return attribute(AttributeNames::value);
|
||||
}
|
||||
|
||||
bool HTMLButtonElement::has_activation_behavior() const
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user