1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 21:38:11 +00:00

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

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());
},