Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxp/src/org/w3c/dom/css/CSSStyleSheet.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.StyleSheet;4546/**47* The <code>CSSStyleSheet</code> interface is a concrete interface used to48* represent a CSS style sheet i.e., a style sheet whose content type is49* "text/css".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 CSSStyleSheet extends StyleSheet {54/**55* If this style sheet comes from an <code>@import</code> rule, the56* <code>ownerRule</code> attribute will contain the57* <code>CSSImportRule</code>. In that case, the <code>ownerNode</code>58* attribute in the <code>StyleSheet</code> interface will be59* <code>null</code>. If the style sheet comes from an element or a60* processing instruction, the <code>ownerRule</code> attribute will be61* <code>null</code> and the <code>ownerNode</code> attribute will62* contain the <code>Node</code>.63*/64public CSSRule getOwnerRule();6566/**67* The list of all CSS rules contained within the style sheet. This68* includes both rule sets and at-rules.69*/70public CSSRuleList getCssRules();7172/**73* Used to insert a new rule into the style sheet. The new rule now74* becomes part of the cascade.75* @param rule The parsable text representing the rule. For rule sets76* this contains both the selector and the style declaration. For77* at-rules, this specifies both the at-identifier and the rule78* content.79* @param index The index within the style sheet's rule list of the rule80* before which to insert the specified rule. If the specified index81* is equal to the length of the style sheet's rule collection, the82* rule will be added to the end of the style sheet.83* @return The index within the style sheet's rule collection of the84* newly inserted rule.85* @exception DOMException86* HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at the87* specified index e.g. if an <code>@import</code> rule is inserted88* after a standard rule set or other at-rule.89* <br>INDEX_SIZE_ERR: Raised if the specified index is not a valid90* insertion point.91* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is92* readonly.93* <br>SYNTAX_ERR: Raised if the specified rule has a syntax error and94* is unparsable.95*/96public int insertRule(String rule,97int index)98throws DOMException;99100/**101* Used to delete a rule from the style sheet.102* @param index The index within the style sheet's rule list of the rule103* to remove.104* @exception DOMException105* INDEX_SIZE_ERR: Raised if the specified index does not correspond to106* a rule in the style sheet's rule list.107* <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is108* readonly.109*/110public void deleteRule(int index)111throws DOMException;112113}114115116