- All Superinterfaces:
EventTarget,MediaList
Based on W3C's MediaQueryList interface.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddEventListener(String type, EventListener listener, boolean useCapture) default voidaddListener(MediaQueryListListener listener) Deprecated.default booleandispatchEvent(Event evt) Get the exceptions found while parsing the query, if any.getMedia()Get the serialized form of this media query list.getMediaQuery(int index) Get the media query atindex.Get a minified serialized form of this media query list.booleanDid this media query list produce errors when being parsed ?booleanIs this an all-media list?booleanDetermine if this list is composed only of queries that evaluate tonot all.booleanmatches(MediaQueryList otherMedia) Does the given media list contain any media present in this list?booleanDoes the associated media query list match the state of the rendered Document?default voidremoveEventListener(String type, EventListener listener, boolean useCapture) default voidremoveListener(MediaQueryListListener listener) Deprecated.useremoveEventListener(String, EventListener, boolean)instead.Methods inherited from interface org.w3c.dom.stylesheets.MediaList
appendMedium, deleteMedium, getLength, getMediaText, item, setMediaText
-
Method Details
-
getMediaQuery
Get the media query atindex.- Parameters:
index- the index.- Returns:
- the media query at the
index-th position in this list, ornullif that is not a valid index or the query list is invalid.
-
getMedia
String getMedia()Get the serialized form of this media query list.- Returns:
- the serialized form of this media query list.
-
getMinifiedMedia
String getMinifiedMedia()Get a minified serialized form of this media query list.- Returns:
- the minified serialized form of this media query list.
-
isAllMedia
boolean isAllMedia()Is this an all-media list?- Returns:
trueif this list matches all media,falseotherwise.
-
isNotAllMedia
boolean isNotAllMedia()Determine if this list is composed only of queries that evaluate tonot all.- Returns:
trueif this list matches no media,falseotherwise.
-
matches
Does the associated media query list match the state of the rendered Document?- Parameters:
medium- the lowercase name of the medium to test for,nullorallif all media.canvas- the canvas where the document is to be rendered.- Returns:
trueif the associated media query list matches the state of the rendered Document andfalseif it does not.
-
matches
Does the given media list contain any media present in this list?If query A matches B, then if a medium matches B it will also match A. The opposite may not be true.
- Parameters:
otherMedia- the other media list to test.- Returns:
trueif the other media contains any media which applies to this list,falseotherwise.
-
hasErrors
boolean hasErrors()Did this media query list produce errors when being parsed ?- Returns:
trueif this list come from a media string that produced errors when parsed,falseotherwise.
-
getExceptions
List<CSSParseException> getExceptions()Get the exceptions found while parsing the query, if any.- Returns:
- the exceptions found while parsing the query, or
nullif no errors were found while parsing the media query.
-
addListener
Deprecated.useaddEventListener(String, EventListener, boolean)instead.Appends a listener to the list of media query list listeners, unless it is already in that list.- Parameters:
listener- the listener to be appended.
-
removeListener
Deprecated.useremoveEventListener(String, EventListener, boolean)instead.Removes a listener from the list of media query list listeners.- Parameters:
listener- the listener to be removed.
-
addEventListener
- Specified by:
addEventListenerin interfaceEventTarget
-
removeEventListener
- Specified by:
removeEventListenerin interfaceEventTarget
-
dispatchEvent
- Specified by:
dispatchEventin interfaceEventTarget- Throws:
EventException
-
addEventListener(String, EventListener, boolean)instead.