mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 03:27:15 +02:00
LibWeb: Separate the active element and the element being activated
We were conflating elements being the active element and elements being activated. The :active pseudo class is supposed to be based on whether an element will have its activation behavior run upon a button being released. Store whether an element is being activated as a flag that is set/reset by EventHandler. Doing this allows label elements to visually activate their control without doing a weird paintable hack, so the Labelable classes have been yeeted.
This commit is contained in:
committed by
Gregory Bertilson
parent
2c2ad598a0
commit
44ed698d4f
Notes:
github-actions[bot]
2026-03-17 09:04:00 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/44ed698d4f8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8392
@@ -121,6 +121,13 @@ void HTMLInputElement::visit_edges(Cell::Visitor& visitor)
|
||||
visitor.visit(m_resource_request);
|
||||
}
|
||||
|
||||
void HTMLInputElement::set_being_activated(bool activated)
|
||||
{
|
||||
Base::set_being_activated(activated);
|
||||
if (first_is_one_of(type_state(), TypeAttributeState::Checkbox, TypeAttributeState::RadioButton))
|
||||
set_needs_repaint();
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::Node> HTMLInputElement::create_layout_node(GC::Ref<CSS::ComputedProperties> style)
|
||||
{
|
||||
if (type_state() == TypeAttributeState::Hidden)
|
||||
|
||||
Reference in New Issue
Block a user