mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 12:42:54 +00:00
LibWeb: Wait for initial navigation to complete before modifying iframe
If initial src of an iframe is "about:blank", it does synchronous navigation that is not supposed to be interleaved by other navigation or usage of Document.open(). Fixes crashing in navigation on https://twinings.co.uk/
This commit is contained in:
parent
aada06757b
commit
a3149c1ce9
Notes:
sideshowbarker
2024-07-17 03:05:16 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: a3149c1ce9
Pull-request: https://github.com/SerenityOS/serenity/pull/23889
Reviewed-by: https://github.com/awesomekling
5 changed files with 40 additions and 0 deletions
|
@ -76,6 +76,12 @@ void HTMLIFrameElement::process_the_iframe_attributes(bool initial_insertion)
|
|||
if (!content_navigable())
|
||||
return;
|
||||
|
||||
// Make sure applying of history step caused by potential sync navigation to "about:blank"
|
||||
// is finished. Otherwise, it might interrupt navigation caused by changing src or srcdoc.
|
||||
if (!initial_insertion && !content_navigable_initialized()) {
|
||||
main_thread_event_loop().spin_processing_tasks_with_source_until(Task::Source::NavigationAndTraversal, [this] { return content_navigable_initialized(); });
|
||||
}
|
||||
|
||||
// 1. If element's srcdoc attribute is specified, then:
|
||||
if (has_attribute(HTML::AttributeNames::srcdoc)) {
|
||||
// 1. Set element's current navigation was lazy loaded boolean to false.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue