mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
LibWeb/DOM: Update "inner invoke" to current spec
Two differences: 1. An extra step inserted to record timing info, which we don't yet implement. 2. The last step in the loop breaks instead of returning the value directly. (But this is functionally the same, as the following step does return that value.) (Also removed the duplicated part of the comment in step 11 née 10.) So, there's no actual change in behavior.
This commit is contained in:
parent
f2c19f96f8
commit
bdabc9b70d
Notes:
github-actions[bot]
2024-11-25 12:35:39 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/bdabc9b70dd Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2565 Reviewed-by: https://github.com/gmta ✅
1 changed files with 7 additions and 5 deletions
|
@ -84,7 +84,9 @@ bool EventDispatcher::inner_invoke(Event& event, Vector<GC::Root<DOM::DOMEventLi
|
|||
if (listener->passive)
|
||||
event.set_in_passive_listener(true);
|
||||
|
||||
// 10. Call a user object’s operation with listener’s callback, "handleEvent", « event », and event’s currentTarget attribute value. If this throws an exception, then:
|
||||
// FIXME: 10. If global is a Window object, then record timing info for event listener given event and listener.
|
||||
|
||||
// 11. Call a user object’s operation with listener’s callback, "handleEvent", « event », and event’s currentTarget attribute value.
|
||||
// FIXME: These should be wrapped for us in call_user_object_operation, but it currently doesn't do that.
|
||||
auto* this_value = event.current_target().ptr();
|
||||
auto* wrapped_event = &event;
|
||||
|
@ -100,18 +102,18 @@ bool EventDispatcher::inner_invoke(Event& event, Vector<GC::Root<DOM::DOMEventLi
|
|||
// FIXME: 2. Set legacyOutputDidListenersThrowFlag if given. (Only used by IndexedDB currently)
|
||||
}
|
||||
|
||||
// 11. Unset event’s in passive listener flag.
|
||||
// 12. Unset event’s in passive listener flag.
|
||||
event.set_in_passive_listener(false);
|
||||
|
||||
// 12. If global is a Window object, then set global’s current event to currentEvent.
|
||||
// 13. If global is a Window object, then set global’s current event to currentEvent.
|
||||
if (is<HTML::Window>(global)) {
|
||||
auto& window = verify_cast<HTML::Window>(global);
|
||||
window.set_current_event(current_event);
|
||||
}
|
||||
|
||||
// 13. If event’s stop immediate propagation flag is set, then return found.
|
||||
// 14. If event’s stop immediate propagation flag is set, then break.
|
||||
if (event.should_stop_immediate_propagation())
|
||||
return found;
|
||||
break;
|
||||
}
|
||||
|
||||
// 3. Return found.
|
||||
|
|
Loading…
Reference in a new issue