mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-14 11:54:53 +03: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
Notes:
sideshowbarker
2024-07-19 06:13:39 +09:00
Author: https://github.com/FalseHonesty Commit: https://github.com/SerenityOS/serenity/commit/e5c2e53739d Pull-request: https://github.com/SerenityOS/serenity/pull/2338
@ -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());
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user