mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-14 10:56:35 +02:00
LibWeb: Do not spin the event loop on processing iframe attributes
Partially reverting a3149c1ce9
Spinning the event loop was causing a crash on:
https://wpt.live/url/percent-encoding.window.html
As it was turning what is meant to be a synchronous operation into an
asynchronous one.
The sequence demonstrated by the reproducing test is as follows:
* A src attribute is changed for the iframe
* process_the_iframe_attributes entered with valid content navigable
* Event loop is spun, allowing the queued iframe removal to execute
* process_the_iframe_attributes continues with null content navigable
* 💥
(cherry picked from commit 30377e6e3500049c5442fac9d242d3b795861116)
This commit is contained in:
committed by
Nico Weber
parent
7feff7ff87
commit
d1c0fa3245
@@ -86,12 +86,6 @@ 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