Skip to content

Commit

Permalink
Bug 1603160 - Allow MediaQueryList::AddListener to receive untrusted …
Browse files Browse the repository at this point in the history
…events. r=bzbarsky

I was looking into MediaQueryList tests in the context of:

  w3c/csswg-drafts#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
  • Loading branch information
emilio committed Dec 11, 2019
1 parent eeb7f42 commit c5481ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion layout/style/MediaQueryList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void MediaQueryList::AddListener(EventListener* aListener, ErrorResult& aRv) {
AddEventListenerOptionsOrBoolean options;
options.SetAsBoolean() = false;

AddEventListener(ONCHANGE_STRING, aListener, options, false, aRv);
AddEventListener(ONCHANGE_STRING, aListener, options, Nullable<bool>(), aRv);
}

void MediaQueryList::EventListenerAdded(nsAtom* aType) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
[MediaQueryList-extends-EventTarget-interop.html]
[removeEventListener (capture) doesn't remove listener added with addListener]
expected: FAIL
[listener added with addListener and addEventListener (capture) is called twice]
expected: FAIL
[listener added with addListener and addEventListener is called once]
expected: FAIL
[listeners are called in order they were added, ignoring capture parameter]
expected: FAIL
[dispatchEvent triggers listener added with addListener]
expected: FAIL
[removeListener doesn't remove listener added with addEventListener (capture)]
expected:
if (os == "linux") and webrender and not debug and fission: ["PASS", "FAIL"]
if (os == "linux") and webrender and not debug and not fission: ["PASS", "FAIL"]

0 comments on commit c5481ba

Please sign in to comment.