mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 16:14:23 +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:
committed by
Andreas Kling
parent
aada06757b
commit
a3149c1ce9
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user