com.gargoylesoftware.htmlunit.javascript.host.css
Class CSSRule

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.css.CSSRule
All Implemented Interfaces:
Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable
Direct Known Subclasses:
CSSImportRule, CSSStyleRule

public class CSSRule
extends SimpleScriptable

A JavaScript object for a CSSRule.

Version:
$Revision: 5618 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static short CHARSET_RULE
          The rule is a CSSCharsetRule.
static short FONT_FACE_RULE
          The rule is a CSSFontFaceRule.
static short IMPORT_RULE
          The rule is a CSSImportRule.
static short MEDIA_RULE
          The rule is a CSSMediaRule.
static short PAGE_RULE
          The rule is a CSSPageRule.
static short STYLE_RULE
          The rule is a CSSStyleRule.
static short UNKNOWN_RULE
          The rule is a CSSUnknownRule.
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
  CSSRule()
          Deprecated. 
protected CSSRule(CSSStyleSheet stylesheet, org.w3c.dom.css.CSSRule rule)
          Creates a new instance.
 
Method Summary
static CSSRule create(CSSStyleSheet stylesheet, org.w3c.dom.css.CSSRule rule)
          Creates a CSSRule according to the specified rule type.
protected  org.w3c.dom.css.CSSRule getRule()
          Returns the wrapped rule.
 String jsxGet_cssText()
          Returns the parsable textual representation of the rule.
 CSSRule jsxGet_parentRule()
          If this rule is contained inside another rule (e.g.
 CSSStyleSheet jsxGet_parentStyleSheet()
          Returns the style sheet that contains this rule.
 short jsxGet_type()
          Returns the type of the rule.
 void jsxSet_cssText(String cssText)
          Sets the parsable textual representation of the rule.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

UNKNOWN_RULE

public static final short UNKNOWN_RULE
The rule is a CSSUnknownRule.

See Also:
Constant Field Values

STYLE_RULE

public static final short STYLE_RULE
The rule is a CSSStyleRule.

See Also:
Constant Field Values

CHARSET_RULE

public static final short CHARSET_RULE
The rule is a CSSCharsetRule.

See Also:
Constant Field Values

IMPORT_RULE

public static final short IMPORT_RULE
The rule is a CSSImportRule.

See Also:
Constant Field Values

MEDIA_RULE

public static final short MEDIA_RULE
The rule is a CSSMediaRule.

See Also:
Constant Field Values

FONT_FACE_RULE

public static final short FONT_FACE_RULE
The rule is a CSSFontFaceRule.

See Also:
Constant Field Values

PAGE_RULE

public static final short PAGE_RULE
The rule is a CSSPageRule.

See Also:
Constant Field Values
Constructor Detail

CSSRule

@Deprecated
public CSSRule()
Deprecated. 

Creates a new instance. JavaScript objects must have a default constructor.


CSSRule

protected CSSRule(CSSStyleSheet stylesheet,
                  org.w3c.dom.css.CSSRule rule)
Creates a new instance.

Parameters:
stylesheet - the Stylesheet of this rule.
rule - the wrapped rule
Method Detail

create

public static CSSRule create(CSSStyleSheet stylesheet,
                             org.w3c.dom.css.CSSRule rule)
Creates a CSSRule according to the specified rule type.

Parameters:
stylesheet - the Stylesheet of this rule
rule - the wrapped rule
Returns:
a CSSRule subclass according to the rule type

jsxGet_type

public short jsxGet_type()
Returns the type of the rule.

Returns:
the type of the rule.

jsxGet_cssText

public String jsxGet_cssText()
Returns the parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.

Returns:
the parsable textual representation of the rule.

jsxSet_cssText

public void jsxSet_cssText(String cssText)
Sets the parsable textual representation of the rule.

Parameters:
cssText - the parsable textual representation of the rule

jsxGet_parentStyleSheet

public CSSStyleSheet jsxGet_parentStyleSheet()
Returns the style sheet that contains this rule.

Returns:
the style sheet that contains this rule.

jsxGet_parentRule

public CSSRule jsxGet_parentRule()
If this rule is contained inside another rule (e.g. a style rule inside an @media block), this is the containing rule. If this rule is not nested inside any other rules, this returns null.

Returns:
the parent rule

getRule

protected org.w3c.dom.css.CSSRule getRule()
Returns the wrapped rule.

Returns:
the wrapped rule.


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.