Truly independent web browser
LibWeb: Mark generated CSS animation events as trusted
Andreas Klinge196b0e31d18
diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cppindex b31090f624b..6e159aa0dc4 100644--- a/Libraries/LibWeb/DOM/Document.cpp+++ b/Libraries/LibWeb/DOM/Document.cpp@@ -4707,11 +4707,14 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An}event_init.animation = css_animation;+ auto event = CSS::AnimationEvent::create(+ name,+ event_init,+ HighResolutionTime::current_high_resolution_time(HTML::relevant_global_object(owning_element->element())));+ event->set_is_trusted(true);+append_pending_animation_event({- .event = CSS::AnimationEvent::create(- name,- event_init,- HighResolutionTime::current_high_resolution_time(HTML::relevant_global_object(owning_element->element()))),+ .event = event,.animation = css_animation,.target = owning_element->element(),.scheduled_event_time = timeline && timeline->can_convert_a_timeline_time_to_an_origin_relative_time()diff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-end-event.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-end-event.txtindex dc9dcae4a0f..444ea2b9f87 100644--- a/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-end-event.txt+++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-end-event.txt@@ -2,18 +2,17 @@ Harness status: OKFound 13 tests-9 Pass-4 Fail+13 PassPass onanimationend and onwebkitanimationend are not aliasesPass dispatchEvent of a webkitAnimationEnd event does trigger a prefixed event handler or listenerPass dispatchEvent of a webkitAnimationEnd event does not trigger an unprefixed event handler or listenerPass dispatchEvent of an animationend event does not trigger a prefixed event handler or listener-Fail onwebkitanimationend event handler should trigger for an animation+Pass onwebkitanimationend event handler should trigger for an animationPass onwebkitanimationend event handler should not trigger if an unprefixed event handler also existsPass onwebkitanimationend event handler should not trigger if an unprefixed listener also exists-Fail event types for prefixed and unprefixed animationend event handlers should be named appropriately-Fail webkitAnimationEnd event listener should trigger for an animation+Pass event types for prefixed and unprefixed animationend event handlers should be named appropriately+Pass webkitAnimationEnd event listener should trigger for an animationPass webkitAnimationEnd event listener should not trigger if an unprefixed listener also existsPass webkitAnimationEnd event listener should not trigger if an unprefixed event handler also exists-Fail event types for prefixed and unprefixed animationend event listeners should be named appropriately+Pass event types for prefixed and unprefixed animationend event listeners should be named appropriatelyPass webkitAnimationEnd event listener is case sensitive\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-iteration-event.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-iteration-event.txtindex df11d53b7e7..19fad847b3d 100644--- a/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-iteration-event.txt+++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-iteration-event.txt@@ -2,18 +2,17 @@ Harness status: OKFound 13 tests-9 Pass-4 Fail+13 PassPass onanimationiteration and onwebkitanimationiteration are not aliasesPass dispatchEvent of a webkitAnimationIteration event does trigger a prefixed event handler or listenerPass dispatchEvent of a webkitAnimationIteration event does not trigger an unprefixed event handler or listenerPass dispatchEvent of an animationiteration event does not trigger a prefixed event handler or listener-Fail onwebkitanimationiteration event handler should trigger for an animation+Pass onwebkitanimationiteration event handler should trigger for an animationPass onwebkitanimationiteration event handler should not trigger if an unprefixed event handler also existsPass onwebkitanimationiteration event handler should not trigger if an unprefixed listener also exists-Fail event types for prefixed and unprefixed animationiteration event handlers should be named appropriately-Fail webkitAnimationIteration event listener should trigger for an animation+Pass event types for prefixed and unprefixed animationiteration event handlers should be named appropriately+Pass webkitAnimationIteration event listener should trigger for an animationPass webkitAnimationIteration event listener should not trigger if an unprefixed listener also existsPass webkitAnimationIteration event listener should not trigger if an unprefixed event handler also exists-Fail event types for prefixed and unprefixed animationiteration event listeners should be named appropriately+Pass event types for prefixed and unprefixed animationiteration event listeners should be named appropriatelyPass webkitAnimationIteration event listener is case sensitive\ No newline at end of filediff --git a/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-start-event.txt b/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-start-event.txtindex 1dfc8dbb766..82487fa1fd6 100644--- a/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-start-event.txt+++ b/Tests/LibWeb/Text/expected/wpt-import/dom/events/webkit-animation-start-event.txt@@ -2,18 +2,17 @@ Harness status: OKFound 13 tests-9 Pass-4 Fail+13 PassPass onanimationstart and onwebkitanimationstart are not aliasesPass dispatchEvent of a webkitAnimationStart event does trigger a prefixed event handler or listenerPass dispatchEvent of a webkitAnimationStart event does not trigger an unprefixed event handler or listenerPass dispatchEvent of an animationstart event does not trigger a prefixed event handler or listener-Fail onwebkitanimationstart event handler should trigger for an animation+Pass onwebkitanimationstart event handler should trigger for an animationPass onwebkitanimationstart event handler should not trigger if an unprefixed event handler also existsPass onwebkitanimationstart event handler should not trigger if an unprefixed listener also exists-Fail event types for prefixed and unprefixed animationstart event handlers should be named appropriately-Fail webkitAnimationStart event listener should trigger for an animation+Pass event types for prefixed and unprefixed animationstart event handlers should be named appropriately+Pass webkitAnimationStart event listener should trigger for an animationPass webkitAnimationStart event listener should not trigger if an unprefixed listener also existsPass webkitAnimationStart event listener should not trigger if an unprefixed event handler also exists-Fail event types for prefixed and unprefixed animationstart event listeners should be named appropriately+Pass event types for prefixed and unprefixed animationstart event listeners should be named appropriatelyPass webkitAnimationStart event listener is case sensitive\ No newline at end of file