LibWeb: Fix HtmlView not scrolling to a url's anchor on page load

Previously, when HtmlView loaded a url, the url's fragment was ignored,
but now it will be automatically scrolled to.
This commit is contained in:
FalseHonesty 2020-05-22 21:28:12 -04:00 committed by Andreas Kling
parent b1e4f70173
commit e5c2e53739
Notes: sideshowbarker 2024-07-19 06:13:39 +09:00

View File

@ -488,6 +488,10 @@ void HtmlView::load(const URL& url)
auto document = create_document_from_mime_type(data, url, mime_type, encoding);
ASSERT(document);
set_document(document);
if (!url.fragment().is_empty())
scroll_to_anchor(url.fragment());
if (on_title_change)
on_title_change(document->title());
},