mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +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:
parent
b1e4f70173
commit
e5c2e53739
1 changed files with 4 additions and 0 deletions
|
@ -488,6 +488,10 @@ void HtmlView::load(const URL& url)
|
||||||
auto document = create_document_from_mime_type(data, url, mime_type, encoding);
|
auto document = create_document_from_mime_type(data, url, mime_type, encoding);
|
||||||
ASSERT(document);
|
ASSERT(document);
|
||||||
set_document(document);
|
set_document(document);
|
||||||
|
|
||||||
|
if (!url.fragment().is_empty())
|
||||||
|
scroll_to_anchor(url.fragment());
|
||||||
|
|
||||||
if (on_title_change)
|
if (on_title_change)
|
||||||
on_title_change(document->title());
|
on_title_change(document->title());
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue