Search in sources :

Example 1 with MediaQueryList

use of com.gargoylesoftware.htmlunit.javascript.host.css.MediaQueryList in project htmlunit by HtmlUnit.

the class HTMLCollectionFrames method matchMedia.

/**
 * Returns a new MediaQueryList object representing the parsed results of the specified media query string.
 *
 * @param mediaQueryString the media query
 * @return a new MediaQueryList object
 */
@JsxFunction
public MediaQueryList matchMedia(final String mediaQueryString) {
    final MediaQueryList mediaQueryList = new MediaQueryList(mediaQueryString);
    mediaQueryList.setParentScope(this);
    mediaQueryList.setPrototype(getPrototype(mediaQueryList.getClass()));
    return mediaQueryList;
}
Also used : MediaQueryList(com.gargoylesoftware.htmlunit.javascript.host.css.MediaQueryList) JsxFunction(com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction)

Aggregations

JsxFunction (com.gargoylesoftware.htmlunit.javascript.configuration.JsxFunction)1 MediaQueryList (com.gargoylesoftware.htmlunit.javascript.host.css.MediaQueryList)1