summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-05 14:50:38 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-05 15:57:07 +0200
commit56d14d57013af3d1f7efbf957b2632b0390d2e0f (patch)
tree24ac0c98b6dc234c9256a0e62e767f7d7df042a4 /Applications
parent2b80a45f82fa1203c1c2ab013c154116f6f2b2f6 (diff)
downloadserenity-56d14d57013af3d1f7efbf957b2632b0390d2e0f.zip
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.
Diffstat (limited to 'Applications')
-rw-r--r--Applications/Browser/Tab.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/Applications/Browser/Tab.cpp b/Applications/Browser/Tab.cpp
index 7c56f4ad7d..66888a8625 100644
--- a/Applications/Browser/Tab.cpp
+++ b/Applications/Browser/Tab.cpp
@@ -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);
}
};