|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet
public class CSSStyleSheet
A JavaScript object for a Stylesheet.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary |
|---|
| 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 | |
|---|---|
CSSStyleSheet()
Creates a new empty stylesheet. |
|
CSSStyleSheet(HTMLElement element,
org.w3c.dom.css.CSSStyleSheet wrapped,
String uri)
Creates a new stylesheet representing the specified CSS stylesheet. |
|
CSSStyleSheet(HTMLElement element,
org.w3c.css.sac.InputSource source,
String uri)
Creates a new stylesheet representing the CSS stylesheet for the specified input source. |
|
| Method Summary | |
|---|---|
String |
getUri()
Returns this stylesheet's URI (used to resolved contained @import rules). |
org.w3c.dom.css.CSSStyleSheet |
getWrappedSheet()
Returns the wrapped stylesheet. |
boolean |
isActive()
Returns true if this stylesheet is active, based on the media types it is associated with (if any). |
int |
jsxFunction_addRule(String selector,
String rule)
Adds a new rule. |
int |
jsxFunction_insertRule(String rule,
int position)
Inserts a new rule. |
CSSRuleList |
jsxGet_cssRules()
Returns the collection of rules defined in this style sheet. |
String |
jsxGet_href()
Returns the URL of the stylesheet. |
HTMLElement |
jsxGet_ownerNode()
For Firefox. |
HTMLElement |
jsxGet_owningElement()
For Internet Explorer. |
CSSRuleList |
jsxGet_rules()
Retrieves the collection of rules defined in this style sheet. |
static CSSStyleSheet |
loadStylesheet(Window window,
HTMLElement element,
HtmlLink link,
String url)
Loads the stylesheet at the specified link or href. |
void |
modifyIfNecessary(ComputedCSSStyleDeclaration style,
HTMLElement element)
Modifies the specified style object by adding any style rules which apply to the specified element. |
org.w3c.css.sac.SelectorList |
parseSelectors(org.w3c.css.sac.InputSource source)
Parses the selectors at the specified input source. |
static boolean |
selects(BrowserVersion browserVersion,
org.w3c.css.sac.Selector selector,
HtmlElement element)
Returns true if the specified selector selects the specified element. |
| 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 |
| Constructor Detail |
|---|
public CSSStyleSheet()
public CSSStyleSheet(HTMLElement element,
org.w3c.css.sac.InputSource source,
String uri)
element - the owning nodesource - the input source which contains the CSS stylesheet which this stylesheet host object representsuri - this stylesheet's URI (used to resolved contained @import rules)
public CSSStyleSheet(HTMLElement element,
org.w3c.dom.css.CSSStyleSheet wrapped,
String uri)
element - the owning nodewrapped - the CSS stylesheet which this stylesheet host object representsuri - this stylesheet's URI (used to resolved contained @import rules)| Method Detail |
|---|
public org.w3c.dom.css.CSSStyleSheet getWrappedSheet()
public void modifyIfNecessary(ComputedCSSStyleDeclaration style,
HTMLElement element)
style - the style to modifyelement - the element to which style rules must apply in order for them to be added to
the specified style
public static CSSStyleSheet loadStylesheet(Window window,
HTMLElement element,
HtmlLink link,
String url)
window - the current windowelement - the parent DOM elementlink - the stylesheet's link (may be null if an href is specified)url - the stylesheet's url (may be null if a link is specified)
public static boolean selects(BrowserVersion browserVersion,
org.w3c.css.sac.Selector selector,
HtmlElement element)
browserVersion - the browser versionselector - the selector to testelement - the element to test
public org.w3c.css.sac.SelectorList parseSelectors(org.w3c.css.sac.InputSource source)
source - the source from which to retrieve the selectors to be parsed
public HTMLElement jsxGet_ownerNode()
public HTMLElement jsxGet_owningElement()
public CSSRuleList jsxGet_rules()
public CSSRuleList jsxGet_cssRules()
public String jsxGet_href()
public int jsxFunction_insertRule(String rule,
int position)
rule - the CSS ruleposition - the position at which to insert the rule
public int jsxFunction_addRule(String selector,
String rule)
selector - the selector namerule - the rule
public String getUri()
public boolean isActive()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||