mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibWeb/HTML: Scroll to the fragment before loading the document
Otherwise nowhere ends up scrolling to the fragment specified by the fragment in document's URL. This fixes ladybird scrolling to the correct location in the document when navigating to a link that has a fragment, e.g: https://html.spec.whatwg.org/multipage/browsing-the-web.html#try-to-scroll-to-the-fragment As well as use of the :target selector.
This commit is contained in:
committed by
Sam Atkins
parent
e74ca82083
commit
51102254b5
@@ -310,6 +310,9 @@ void HTMLParser::the_end(GC::Ref<DOM::Document> document, GC::Ptr<HTMLParser> pa
|
||||
(void)document->scripts_to_execute_when_parsing_has_finished().take_first();
|
||||
}
|
||||
|
||||
// FIXME: Spec bug: https://github.com/whatwg/html/issues/10914
|
||||
document->scroll_to_the_fragment();
|
||||
|
||||
// 6. Queue a global task on the DOM manipulation task source given the Document's relevant global object to run the following substeps:
|
||||
queue_global_task(HTML::Task::Source::DOMManipulation, *document, GC::create_function(heap, [document] {
|
||||
// 1. Set the Document's load timing info's DOM content loaded event start time to the current high resolution time given the Document's relevant global object.
|
||||
|
||||
Reference in New Issue
Block a user