mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
LibWeb: Support :active pseudo-class for hyperlinks, :focus possibly
Adds support for the :active pseudo-class for hyperlinks (<a> tags only). Also, since it was very similar to :focus and an element having a focused state was already implemented, I went ahead and implemented that pseudo-class too, although I cannot come up with a working example to validate it.
This commit is contained in:
parent
457edaa4d2
commit
5eb65286b6
10 changed files with 39 additions and 2 deletions
|
@ -237,6 +237,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
|
|||
auto anchor = href.substring_view(1, href.length() - 1);
|
||||
m_frame.scroll_to_anchor(anchor);
|
||||
} else {
|
||||
document->set_active_element(link);
|
||||
if (m_frame.is_top_level()) {
|
||||
if (auto* page = m_frame.page())
|
||||
page->client().page_did_click_link(url, link->target(), modifiers);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue