mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +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:
parent
e74ca82083
commit
51102254b5
Notes:
github-actions[bot]
2025-01-15 12:44:49 +00:00
Author: https://github.com/shannonbooth
Commit: 51102254b5
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3258
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/gmta
4 changed files with 49 additions and 6 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue