@Override
    public void setCssText(final String cssText) throws DOMException {
        try {
            final CSSOMParser parser = new CSSOMParser();
            final AbstractCSSRuleImpl r = parser.parseRule(cssText);

            // The rule must be a media rule
            if (r instanceof CSSMediaRuleImpl) {
                mediaList_ = ((CSSMediaRuleImpl) r).mediaList_;
                cssRules_ = ((CSSMediaRuleImpl) r).cssRules_;
            }
            else {
                throw new DOMExceptionImpl(
                    DOMException.INVALID_MODIFICATION_ERR,
                    DOMExceptionImpl.EXPECTING_MEDIA_RULE);
            }
        }
        catch (final CSSException e) {
            throw new DOMExceptionImpl(
                DOMException.SYNTAX_ERR,
                DOMExceptionImpl.SYNTAX_ERROR,
                e.getMessage());
        }
        catch (final IOException e) {
            throw new DOMExceptionImpl(
                DOMException.SYNTAX_ERR,
                DOMExceptionImpl.SYNTAX_ERROR,
                e.getMessage());
        }
    }
@ Override public void setCssText ( final String cssText ) throws DOMException { try { final CSSOMParser parser = new CSSOMParser ( ) ; final AbstractCSSRuleImpl r = parser . parseRule ( cssText ) ; if ( r instanceof CSSMediaRuleImpl ) { mediaList_ = ( ( CSSMediaRuleImpl ) r ) . mediaList_ ; cssRules_ = ( ( CSSMediaRuleImpl ) r ) . cssRules_ ; } else { throw new DOMExceptionImpl ( DOMException . INVALID_MODIFICATION_ERR , DOMExceptionImpl . EXPECTING_MEDIA_RULE ) ; } } catch ( final CSSException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e . getMessage ( ) ) ; } catch ( final IOException e ) { throw new DOMExceptionImpl ( DOMException . SYNTAX_ERR , DOMExceptionImpl . SYNTAX_ERROR , e . getMessage ( ) ) ; } }
{@inheritDoc}