mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
LibHTML: Implement basic :hover pseudo-class support
This is currently very aggressive. Whenever the Document's hovered node changes, we invalidate all style and do a full relayout. It does look cool though. So cool that I'm adding it to the default stylesheet. :^)
This commit is contained in:
parent
605a225b53
commit
61ef17b87a
6 changed files with 52 additions and 1 deletions
|
@ -195,3 +195,13 @@ const LayoutDocument* Document::layout_node() const
|
|||
{
|
||||
return static_cast<const LayoutDocument*>(Node::layout_node());
|
||||
}
|
||||
|
||||
void Document::set_hovered_node(Node* node)
|
||||
{
|
||||
if (m_hovered_node == node)
|
||||
return;
|
||||
|
||||
m_hovered_node = node;
|
||||
invalidate_style();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue