mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Return a representation of an 'Agent' in 'relevant agent'
This makes it more convenient to use the 'relvant agent' concept, instead of the awkward dynamic casts we needed to do for every call site. mutation_observers is also changed to hold a GC::Root instead of raw GC::Ptr. Somehow this was not causing problems before, but trips up CI after these changes.
This commit is contained in:
@@ -118,6 +118,7 @@
|
||||
#include <LibWeb/HTML/Numbers.h>
|
||||
#include <LibWeb/HTML/Parser/HTMLParser.h>
|
||||
#include <LibWeb/HTML/PopStateEvent.h>
|
||||
#include <LibWeb/HTML/Scripting/Agent.h>
|
||||
#include <LibWeb/HTML/Scripting/ClassicScript.h>
|
||||
#include <LibWeb/HTML/Scripting/ExceptionReporter.h>
|
||||
#include <LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h>
|
||||
@@ -3949,7 +3950,7 @@ void Document::unload(GC::Ptr<Document>)
|
||||
auto intend_to_store_in_bfcache = false;
|
||||
|
||||
// 6. Let eventLoop be oldDocument's relevant agent's event loop.
|
||||
auto& event_loop = *verify_cast<Bindings::WebEngineCustomData>(*HTML::relevant_agent(*this).custom_data()).event_loop;
|
||||
auto& event_loop = *HTML::relevant_agent(*this).event_loop;
|
||||
|
||||
// 7. Increase eventLoop's termination nesting level by 1.
|
||||
event_loop.increment_termination_nesting_level();
|
||||
@@ -6096,7 +6097,7 @@ Document::StepsToFireBeforeunloadResult Document::steps_to_fire_beforeunload(boo
|
||||
m_unload_counter++;
|
||||
|
||||
// 3. Increase document's relevant agent's event loop's termination nesting level by 1.
|
||||
auto& event_loop = *verify_cast<Bindings::WebEngineCustomData>(*HTML::relevant_agent(*this).custom_data()).event_loop;
|
||||
auto& event_loop = *HTML::relevant_agent(*this).event_loop;
|
||||
event_loop.increment_termination_nesting_level();
|
||||
|
||||
// 4. Let eventFiringResult be the result of firing an event named beforeunload at document's relevant global object,
|
||||
|
||||
Reference in New Issue
Block a user