Search in sources :

Example 1 with MediaList

use of com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList in project htmlunit by HtmlUnit.

the class CSSMediaRule method getMedia.

/**
 * Returns the media types that the imported CSS style sheet applies to.
 * @return the media types that the imported CSS style sheet applies to
 */
@JsxGetter
public MediaList getMedia() {
    if (media_ == null) {
        final CSSStyleSheet parent = getParentStyleSheet();
        final MediaListImpl ml = getMediaRule().getMediaList();
        media_ = new MediaList(parent, ml);
    }
    return media_;
}
Also used : MediaList(com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList) MediaListImpl(com.gargoylesoftware.css.dom.MediaListImpl) JsxGetter(com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter)

Example 2 with MediaList

use of com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList in project htmlunit by HtmlUnit.

the class CSSImportRule method getMedia.

/**
 * Returns the media types that the imported CSS style sheet applies to.
 * @return the media types that the imported CSS style sheet applies to
 */
@JsxGetter
public MediaList getMedia() {
    if (media_ == null) {
        final CSSStyleSheet parent = getParentStyleSheet();
        final MediaListImpl ml = getImportRule().getMedia();
        media_ = new MediaList(parent, ml);
    }
    return media_;
}
Also used : MediaList(com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList) MediaListImpl(com.gargoylesoftware.css.dom.MediaListImpl) JsxGetter(com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter)

Aggregations

MediaListImpl (com.gargoylesoftware.css.dom.MediaListImpl)2 JsxGetter (com.gargoylesoftware.htmlunit.javascript.configuration.JsxGetter)2 MediaList (com.gargoylesoftware.htmlunit.javascript.host.dom.MediaList)2