mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
LibWeb: Move fragment link handling to Frame
Activating a "#foo" fragment link will now be handled internally by the Frame instead of involving the widget layer. If the viewport needs to be scrolled as a result, we will simply ask the PageClient to scroll a new rect into view.
This commit is contained in:
parent
2b80a45f82
commit
56d14d5701
7 changed files with 39 additions and 49 deletions
|
@ -159,13 +159,8 @@ Tab::Tab()
|
|||
auto url = m_page_view->document()->complete_url(href);
|
||||
on_tab_open_request(url);
|
||||
} else {
|
||||
if (href.starts_with("#")) {
|
||||
auto anchor = href.substring_view(1, href.length() - 1);
|
||||
m_page_view->scroll_to_anchor(anchor);
|
||||
} else {
|
||||
auto url = m_page_view->document()->complete_url(href);
|
||||
m_page_view->load(url);
|
||||
}
|
||||
auto url = m_page_view->document()->complete_url(href);
|
||||
m_page_view->load(url);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue