Interface MediaQueryList

All Superinterfaces:
org.w3c.dom.stylesheets.MediaList

public interface MediaQueryList extends org.w3c.dom.stylesheets.MediaList
Based on W3C's MediaQueryList interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Appends a listener to the list of media query list listeners, unless it is already in that list.
    Get the exceptions found while parsing the query, if any.
    Get the serialized form of this media query list.
    getMediaQuery(int index)
    Get the media query at index.
    Get a minified serialized form of this media query list.
    boolean
    Did this media query list produce errors when being parsed ?
    boolean
    Is this an all-media list?
    boolean
    Determine if this list is composed only of queries that evaluate to not all.
    boolean
    matches(MediaQueryList otherMedia)
    Does the given media list contain any media present in this list?
    boolean
    matches(String medium, CSSCanvas canvas)
    Does the associated media query list match the state of the rendered Document?
    void
    Removes a listener from the list of media query list listeners.

    Methods inherited from interface org.w3c.dom.stylesheets.MediaList

    appendMedium, deleteMedium, getLength, getMediaText, item, setMediaText
  • Method Details

    • getMediaQuery

      MediaQuery getMediaQuery(int index)
      Get the media query at index.
      Parameters:
      index - the index.
      Returns:
      the media query at the index-th position in this list, or null if 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:
      true if this list matches all media, false otherwise.
    • isNotAllMedia

      boolean isNotAllMedia()
      Determine if this list is composed only of queries that evaluate to not all.
      Returns:
      true if this list matches no media, false otherwise.
    • matches

      boolean matches(String medium, CSSCanvas canvas)
      Does the associated media query list match the state of the rendered Document?
      Parameters:
      medium - the lowercase name of the medium to test for.
      canvas - the canvas where the document is to be rendered.
      Returns:
      true if the associated media query list matches the state of the rendered Document and false if it does not.
    • matches

      boolean matches(MediaQueryList otherMedia)
      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:
      true if the other media contains any media which applies to this list, false otherwise.
    • hasErrors

      boolean hasErrors()
      Did this media query list produce errors when being parsed ?
      Returns:
      true if this list come from a media string that produced errors when parsed, false otherwise.
    • getExceptions

      List<CSSParseException> getExceptions()
      Get the exceptions found while parsing the query, if any.
      Returns:
      the exceptions found while parsing the query, or null if no errors were found while parsing the media query.
    • addListener

      void addListener(MediaQueryListListener listener)
      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

      void removeListener(MediaQueryListListener listener)
      Removes a listener from the list of media query list listeners.
      Parameters:
      listener - the listener to be removed.