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:
Zaggy1024
2026-03-07 12:47:47 -06:00
committed by Gregory Bertilson
parent 2c2ad598a0
commit 44ed698d4f
Notes: github-actions[bot] 2026-03-17 09:04:00 +00:00
29 changed files with 166 additions and 272 deletions

View File

@@ -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)