@@ -771,8 +771,8 @@ When asked to <dfn>evaluate media queries and report changes</dfn> for a {{Docum
771
771
interface MediaQueryList : EventTarget {
772
772
readonly attribute CSSOMString media;
773
773
readonly attribute boolean matches;
774
- void addListener(EventListener? listener );
775
- void removeListener(EventListener? listener );
774
+ void addListener(EventListener? callback );
775
+ void removeListener(EventListener? callback );
776
776
attribute EventHandler onchange;
777
777
};
778
778
</pre>
@@ -783,22 +783,24 @@ the associated <a>media</a>.
783
783
The <dfn attribute for=MediaQueryList>matches</dfn> attribute must return
784
784
the associated <a>matches state</a> . <!--fingerprint-->
785
785
786
- The <dfn method for=MediaQueryList>addListener(<var>listener</var>)</dfn> method must run these steps:
786
+ The <dfn method for=MediaQueryList>addListener(<var>callback</var>)</dfn> method,
787
+ when invoked, must run these steps:
787
788
788
- 1. If <var> listener</var> is null, terminate these steps.
789
- 1. Append an <a>event listener</a> to the associated list of <a>event listeners</a>
790
- with <b> type</b> set to <code> change</code> ,
791
- <b> callback</b> set to <var> listener</var> ,
792
- and <b> capture</b> set to false,
793
- unless there already is an <a>event listener</a> in that list
794
- with the same <b> type</b> , <b> callback</b> , and <b> capture</b> .
789
+ 1. <a spec=dom>Add an event listener</a> with the <a spec=dom>context object</a>
790
+ and an <a spec=dom>event listener</a> whose
791
+ <a spec=dom for="event listener">type</a> is <code> change</code> ,
792
+ and <a spec=dom for="event listener">callback</a> is |callback|.
795
793
796
- The <dfn method for=MediaQueryList>removeListener(<var>listener</var>)</dfn> method must run these steps:
794
+ The <dfn method for=MediaQueryList>removeListener(<var>callback</var>)</dfn> method,
795
+ when invoked, must run these steps:
797
796
798
- 1. Remove an <a>event listener</a> from the associated list of <a>event listeners</a> ,
799
- whose <b> type</b> is <code> change</code> ,
800
- <b> callback</b> is <var> listener</var> ,
801
- and <b> capture</b> is false.
797
+ 1. If the <a spec=dom>context object</a> ’s <a spec=dom for=EventTarget>event listener list</a>
798
+ <a for=list>contains</a> an <a>event listener</a> whose
799
+ <a spec=dom for="event listener">type</a> is <code> change</code> ,
800
+ <a spec=dom for="event listener">callback</a> is |callback|,
801
+ and <a spec=dom for="event listener">capture</a> is false,
802
+ then <a spec=dom>remove an event listener</a> with
803
+ the <a spec=dom>context object</a> and that <a spec=dom>event listener</a> .
802
804
803
805
Note: This specification initially had a custom callback mechanism with {{addListener()}} and
804
806
{{removeListener()}} , and the callback was invoked with the associated media query list as argument.
0 commit comments