Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/css/CSSMediaRule.java
86410 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* This file is available under and governed by the GNU General Public26* License version 2 only, as published by the Free Software Foundation.27* However, the following notice accompanied the original version of this28* file and, per its terms, should not be removed:29*30* Copyright (c) 2000 World Wide Web Consortium,31* (Massachusetts Institute of Technology, Institut National de32* Recherche en Informatique et en Automatique, Keio University). All33* Rights Reserved. This program is distributed under the W3C's Software34* Intellectual Property License. This program is distributed in the35* hope that it will be useful, but WITHOUT ANY WARRANTY; without even36* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR37* PURPOSE.38* See W3C License http://www.w3.org/Consortium/Legal/ for more details.39*/4041package org.w3c.dom.css;4243import org.w3c.dom.DOMException;44import org.w3c.dom.stylesheets.MediaList;4546/**47* The <code>CSSMediaRule</code> interface represents a @media rule in a CSS48* style sheet. A <code>@media</code> rule can be used to delimit style49* rules for specific media types.50* <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113'>Document Object Model (DOM) Level 2 Style Specification</a>.51* @since DOM Level 252*/53public interface CSSMediaRule extends CSSRule {54/**55* A list of media types for this rule.56*/57public MediaList getMedia();5859/**60* A list of all CSS rules contained within the media block.61*/62public CSSRuleList getCssRules();6364/**65* Used to insert a new rule into the media block.66* @param rule The parsable text representing the rule. For rule sets67* this contains both the selector and the style declaration. For68* at-rules, this specifies both the at-identifier and the rule69* content.70* @param index The index within the media block's rule collection of71* the rule before which to insert the specified rule. If the72* specified index is equal to the length of the media blocks's rule73* collection, the rule will be added to the end of the media block.74* @return The index within the media block's rule collection of the75* newly inserted rule.76* @exception DOMException77* HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the78* specified index, e.g., if an <code>@import</code> rule is inserted79* after a standard rule set or other at-rule.80* <br>INDEX_SIZE_ERR: Raised if the specified index is not a valid81* insertion point.82* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is83* readonly.84* <br>SYNTAX_ERR: Raised if the specified rule has a syntax error and85* is unparsable.86*/87public int insertRule(String rule,88int index)89throws DOMException;9091/**92* Used to delete a rule from the media block.93* @param index The index within the media block's rule collection of94* the rule to remove.95* @exception DOMException96* INDEX_SIZE_ERR: Raised if the specified index does not correspond to97* a rule in the media rule list.98* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is99* readonly.100*/101public void deleteRule(int index)102throws DOMException;103104}105106107