mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Implement the :default pseudo-class
This commit is contained in:
parent
7acc0f4a42
commit
3fe148f2d4
Notes:
github-actions[bot]
2025-05-24 09:32:32 +00:00
Author: https://github.com/Gingeh
Commit: 3fe148f2d4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4838
Reviewed-by: https://github.com/AtkinsSJ ✅
9 changed files with 115 additions and 3 deletions
|
|
@ -1176,13 +1176,13 @@ JS::Value HTMLFormElement::named_item_value(FlyString const& name) const
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#default-button
|
||||
FormAssociatedElement* HTMLFormElement::default_button()
|
||||
FormAssociatedElement* HTMLFormElement::default_button() const
|
||||
{
|
||||
// A form element's default button is the first submit button in tree order whose form owner is that form element.
|
||||
FormAssociatedElement* default_button = nullptr;
|
||||
|
||||
root().for_each_in_subtree([&](auto& node) {
|
||||
auto* form_associated_element = dynamic_cast<FormAssociatedElement*>(&node);
|
||||
auto* form_associated_element = const_cast<FormAssociatedElement*>(dynamic_cast<FormAssociatedElement const*>(&node));
|
||||
if (!form_associated_element)
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue