From 9cfb17ca5c0f7bbf65c40e4832e1628938b0aa6e Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Fri, 13 Dec 2019 00:17:20 +0000 Subject: [PATCH] Bug 1603160 - Allow MediaQueryList::AddListener to receive untrusted events. r=bzbarsky I was looking into MediaQueryList tests in the context of: https://github.com/w3c/csswg-drafts/issues/4531 And this seemed reasonably easy to fix. I don't see anything in: https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-addlistener Which doesn't mention anything about untrusted listeners. I haven't investigated the remaining failure, it seems we call the capture listener after the regular one... Differential Revision: https://phabricator.services.mozilla.com/D56771 UltraBlame original commit: 1941e31f3d21880bb2c073e0247a041e7cbf00e3 --- layout/style/MediaQueryList.cpp | 7 ++++- ...yList-extends-EventTarget-interop.html.ini | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 testing/web-platform/meta/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html.ini diff --git a/layout/style/MediaQueryList.cpp b/layout/style/MediaQueryList.cpp index b5207afce24ee..1a5e6bfdf34d8 100644 --- a/layout/style/MediaQueryList.cpp +++ b/layout/style/MediaQueryList.cpp @@ -325,7 +325,12 @@ AddEventListener ONCHANGE_STRING aListener options -false +Nullable +< +bool +> +( +) aRv ) ; diff --git a/testing/web-platform/meta/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html.ini b/testing/web-platform/meta/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html.ini new file mode 100644 index 0000000000000..a651ae930dbc6 --- /dev/null +++ b/testing/web-platform/meta/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html.ini @@ -0,0 +1,27 @@ +[ +MediaQueryList +- +extends +- +EventTarget +- +interop +. +html +] +[ +listeners +are +called +in +order +they +were +added +ignoring +capture +parameter +] +expected +: +FAIL