public class ComputedCSSStyleDeclaration extends CSSStyleDeclaration
Window.getComputedStyle(Element, String),
Serialized FormCSSStyleDeclaration.CssValue, CSSStyleDeclaration.StyleElementPRIORITY_IMPORTANT, WIDTH| Constructor and Description |
|---|
ComputedCSSStyleDeclaration()
Creates an instance.
|
ComputedCSSStyleDeclaration(CSSStyleDeclaration style)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyStyleFromSelector(org.w3c.dom.css.CSSStyleDeclaration declaration,
org.w3c.css.sac.Selector selector)
Makes a local, "computed", modification to this CSS style.
|
String |
getAccelerator()
Gets the
accelerator style attribute. |
String |
getBackgroundAttachment()
Gets the
backgroundAttachment style attribute. |
String |
getBackgroundColor()
Gets the
backgroundColor style attribute. |
String |
getBackgroundImage()
Gets the
backgroundImage style attribute. |
String |
getBackgroundPosition()
Gets the
backgroundPosition style attribute. |
String |
getBackgroundRepeat()
Gets the
backgroundRepeat style attribute. |
String |
getBorder()
Gets the
border style attribute. |
String |
getBorderBottomColor()
Gets the
borderBottomColor style attribute. |
String |
getBorderBottomStyle()
Gets the
borderBottomStyle style attribute. |
int |
getBorderBottomValue()
Gets the size of the bottom border of the element.
|
String |
getBorderBottomWidth()
Gets the
borderBottomWidth style attribute. |
String |
getBorderLeftColor()
Gets the
borderLeftColor style attribute. |
String |
getBorderLeftStyle()
Gets the
borderLeftStyle style attribute. |
int |
getBorderLeftValue()
Gets the size of the left border of the element.
|
String |
getBorderLeftWidth()
Gets the
borderLeftWidth style attribute. |
String |
getBorderRightColor()
Gets the
borderRightColor style attribute. |
String |
getBorderRightStyle()
Gets the
borderRightStyle style attribute. |
int |
getBorderRightValue()
Gets the size of the right border of the element.
|
String |
getBorderRightWidth()
Gets the
borderRightWidth style attribute. |
String |
getBorderTopColor()
Gets the
borderTopColor style attribute. |
String |
getBorderTopStyle()
Gets the
borderTopStyle style attribute. |
int |
getBorderTopValue()
Gets the size of the top border of the element.
|
String |
getBorderTopWidth()
Gets the
borderTopWidth style attribute. |
String |
getBottom()
Gets the
bottom style attribute. |
String |
getBottomWithInheritance()
Returns the CSS
bottom attribute, replacing inherited values with the actual parent values. |
int |
getCalculatedHeight(boolean includeBorder,
boolean includePadding)
Returns the element's height, possibly including its padding and border.
|
int |
getCalculatedWidth(boolean includeBorder,
boolean includePadding)
Returns the element's width in pixels, possibly including its padding and border.
|
String |
getColor()
Gets the
color style attribute. |
int |
getContentHeight()
Returns the total height of the element's children.
|
int |
getContentWidth()
Returns the total width of the element's children.
|
String |
getCssFloat()
Gets the
cssFloat style attribute. |
String |
getDisplay()
Gets the
display style attribute. |
String |
getFontSize()
Gets the
fontSize style attribute. |
String |
getHeight()
Gets the
height style attribute. |
String |
getLeft()
Gets the
left style attribute. |
int |
getLeft(boolean includeMargin,
boolean includeBorder,
boolean includePadding)
Returns the computed left (X coordinate), relative to the node's parent's left edge.
|
String |
getLeftWithInheritance()
Returns the CSS
left attribute, replacing inherited values with the actual parent values. |
String |
getLetterSpacing()
Gets the
letterSpacing style attribute. |
String |
getMargin()
Gets the
margin style attribute. |
String |
getMarginBottom()
Gets the
marginBottom style attribute. |
int |
getMarginBottomValue()
Gets the bottom margin of the element.
|
String |
getMarginLeft()
Gets the
marginLeft style attribute. |
int |
getMarginLeftValue()
Gets the left margin of the element.
|
String |
getMarginRight()
Gets the
marginRight style attribute. |
int |
getMarginRightValue()
Gets the right margin of the element.
|
String |
getMarginTop()
Gets the
marginTop style attribute. |
int |
getMarginTopValue()
Gets the top margin of the element.
|
String |
getMaxHeight()
Gets the
maxHeight style attribute. |
String |
getMaxWidth()
Gets the
maxWidth style attribute. |
String |
getMinHeight()
Gets the
minHeight style attribute. |
String |
getMinWidth()
Gets the
minWidth style attribute. |
String |
getOpacity()
Gets the
opacity style attribute. |
String |
getOutlineWidth()
Gets the
outlineWidth style attribute. |
String |
getPadding()
Gets the
padding style attribute. |
String |
getPaddingBottom()
Gets the
paddingBottom style attribute. |
int |
getPaddingBottomValue()
Gets the bottom padding of the element.
|
String |
getPaddingLeft()
Gets the
paddingLeft style attribute. |
int |
getPaddingLeftValue()
Gets the left padding of the element.
|
String |
getPaddingRight()
Gets the
paddingRight style attribute. |
int |
getPaddingRightValue()
Gets the right padding of the element.
|
String |
getPaddingTop()
Gets the
paddingTop style attribute. |
int |
getPaddingTopValue()
Gets the top padding of the element.
|
String |
getPositionWithInheritance()
Returns the CSS
position attribute, replacing inherited values with the actual parent values. |
String |
getPropertyValue(String name)
Gets the value of the specified property of the style.
|
String |
getRight()
Gets the
right style attribute. |
String |
getRightWithInheritance()
Returns the CSS
right attribute, replacing inherited values with the actual parent values. |
protected String |
getStyleAttribute(String name)
Returns the value of the named style attribute, or an empty string if it is not found.
|
String |
getStyleAttribute(StyleAttributes.Definition style)
Get the value for the style attribute.
|
protected CSSStyleDeclaration.StyleElement |
getStyleElement(String name)
Determines the StyleElement for the given name.
|
String |
getTextIndent()
Gets the
textIndent style attribute. |
String |
getTop()
Gets the
top style attribute. |
int |
getTop(boolean includeMargin,
boolean includeBorder,
boolean includePadding)
Returns the computed top (Y coordinate), relative to the node's parent's top edge.
|
String |
getTopWithInheritance()
Returns the CSS
top attribute, replacing inherited values with the actual parent values. |
String |
getVerticalAlign()
Gets the
verticalAlign style attribute. |
String |
getWidth()
Gets the
width style attribute. |
String |
getWordSpacing()
Gets the
wordSpacing style attribute. |
Object |
getZIndex()
Gets the
zIndex style attribute. |
boolean |
isScrollable(boolean horizontal)
Returns
true if the element is scrollable along the specified axis. |
protected String |
pixelString(Element element,
CSSStyleDeclaration.CssValue value)
Returns the specified length CSS attribute value value as a pixel length value, as long as
we're not emulating IE.
|
protected String |
pixelString(String value)
Returns the specified length value as a pixel length value, as long as we're not emulating IE.
|
void |
setDefaultLocalStyleAttribute(String name,
String newValue)
Makes a local, "computed", modification to this CSS style that won't override other
style attributes of the same name.
|
protected void |
setStyleAttribute(String name,
String newValue)
Sets the specified style attribute.
|
camelize, get, get, getAttribute, getCssText, getCurrentElementIndex, getElement, getIds, getLength, getMarks, getOutline, getPage, getPixelBottom, getPixelHeight, getPixelLeft, getPixelRight, getPixelTop, getPixelWidth, getPosBottom, getPosHeight, getPosLeft, getPosRight, getPosTop, getPosWidth, getPropertyCSSValue, getPropertyPriority, getRubyAlign, getSize, getStylePriority, getTextDecorationBlink, getTextDecorationLineThrough, getTextDecorationNone, getTextDecorationOverline, getTextDecorationUnderline, getWithFallback, has, pixelValue, pixelValue, put, removeAttribute, removeProperty, setAccelerator, setAttribute, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderTop, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBottom, setColor, setCssFloat, setCssText, setDisplay, setFontSize, setHeight, setLeft, setLetterSpacing, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMarks, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setMsImeAlign, setOpacity, setOutline, setOutlineWidth, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPage, setPixelBottom, setPixelHeight, setPixelLeft, setPixelRight, setPixelTop, setPixelWidth, setPosBottom, setPosHeight, setPosLeft, setPosRight, setPosTop, setPosWidth, setProperty, setRight, setRubyAlign, setSize, setStyleAttribute, setStyleAttributePixel, setTextDecorationBlink, setTextDecorationLineThrough, setTextDecorationNone, setTextDecorationOverline, setTextDecorationUnderline, setTextIndent, setTop, setVerticalAlign, setWidth, setWordSpacing, setZIndex, toRGBColor, toStringclone, equivalentValues, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElementdefineFunctionProperties, defineProperty, getClassName, setClassName, setParentScopeapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, sizepublic ComputedCSSStyleDeclaration()
public ComputedCSSStyleDeclaration(CSSStyleDeclaration style)
style - the original Styleprotected String getStyleAttribute(String name)
getStyleAttribute in class CSSStyleDeclarationname - the name of the style attribute whose value is to be retrievedprotected void setStyleAttribute(String name, String newValue)
setStyleAttribute in class CSSStyleDeclarationname - the attribute name (camel-cased)newValue - the attribute valuepublic void applyStyleFromSelector(org.w3c.dom.css.CSSStyleDeclaration declaration, org.w3c.css.sac.Selector selector)
declaration - the style declarationselector - the selector determining that the style applies to this elementpublic void setDefaultLocalStyleAttribute(String name, String newValue)
name - the name of the style attribute to setnewValue - the value of the style attribute to setprotected CSSStyleDeclaration.StyleElement getStyleElement(String name)
CSSStyleDeclarationgetStyleElement in class CSSStyleDeclarationname - the name of the requested StyleElementpublic String getAccelerator()
accelerator style attribute.getAccelerator in class CSSStyleDeclarationpublic String getBackgroundAttachment()
backgroundAttachment style attribute.getBackgroundAttachment in class CSSStyleDeclarationpublic String getBackgroundColor()
backgroundColor style attribute.getBackgroundColor in class CSSStyleDeclarationpublic String getBackgroundImage()
backgroundImage style attribute.getBackgroundImage in class CSSStyleDeclarationpublic String getBackgroundPosition()
backgroundPosition style attribute.getBackgroundPosition in class CSSStyleDeclarationpublic String getBackgroundRepeat()
backgroundRepeat style attribute.getBackgroundRepeat in class CSSStyleDeclarationpublic String getBorder()
border style attribute.getBorder in class CSSStyleDeclarationpublic String getBorderBottomColor()
borderBottomColor style attribute.getBorderBottomColor in class CSSStyleDeclarationpublic String getBorderBottomStyle()
borderBottomStyle style attribute.getBorderBottomStyle in class CSSStyleDeclarationpublic String getBorderBottomWidth()
borderBottomWidth style attribute.getBorderBottomWidth in class CSSStyleDeclarationpublic String getBorderLeftColor()
borderLeftColor style attribute.getBorderLeftColor in class CSSStyleDeclarationpublic String getBorderLeftStyle()
borderLeftStyle style attribute.getBorderLeftStyle in class CSSStyleDeclarationpublic String getBorderLeftWidth()
borderLeftWidth style attribute.getBorderLeftWidth in class CSSStyleDeclarationpublic String getBorderRightColor()
borderRightColor style attribute.getBorderRightColor in class CSSStyleDeclarationpublic String getBorderRightStyle()
borderRightStyle style attribute.getBorderRightStyle in class CSSStyleDeclarationpublic String getBorderRightWidth()
borderRightWidth style attribute.getBorderRightWidth in class CSSStyleDeclarationpublic String getBorderTopColor()
borderTopColor style attribute.getBorderTopColor in class CSSStyleDeclarationpublic String getBorderTopStyle()
borderTopStyle style attribute.getBorderTopStyle in class CSSStyleDeclarationpublic String getBorderTopWidth()
borderTopWidth style attribute.getBorderTopWidth in class CSSStyleDeclarationpublic String getBottom()
bottom style attribute.getBottom in class CSSStyleDeclarationpublic String getColor()
color style attribute.getColor in class CSSStyleDeclarationpublic String getCssFloat()
cssFloat style attribute.getCssFloat in class CSSStyleDeclarationpublic String getDisplay()
display style attribute.getDisplay in class CSSStyleDeclarationpublic String getFontSize()
fontSize style attribute.getFontSize in class CSSStyleDeclarationpublic String getHeight()
height style attribute.getHeight in class CSSStyleDeclarationpublic String getLeft()
left style attribute.getLeft in class CSSStyleDeclarationpublic String getLetterSpacing()
letterSpacing style attribute.getLetterSpacing in class CSSStyleDeclarationpublic String getMargin()
margin style attribute.getMargin in class CSSStyleDeclarationpublic String getMarginBottom()
marginBottom style attribute.getMarginBottom in class CSSStyleDeclarationpublic String getMarginLeft()
marginLeft style attribute.getMarginLeft in class CSSStyleDeclarationpublic String getMarginRight()
marginRight style attribute.getMarginRight in class CSSStyleDeclarationpublic String getMarginTop()
marginTop style attribute.getMarginTop in class CSSStyleDeclarationpublic String getMaxHeight()
maxHeight style attribute.getMaxHeight in class CSSStyleDeclarationpublic String getMaxWidth()
maxWidth style attribute.getMaxWidth in class CSSStyleDeclarationpublic String getMinHeight()
minHeight style attribute.getMinHeight in class CSSStyleDeclarationpublic String getMinWidth()
minWidth style attribute.getMinWidth in class CSSStyleDeclarationpublic String getOpacity()
opacity style attribute.getOpacity in class CSSStyleDeclarationpublic String getOutlineWidth()
outlineWidth style attribute.getOutlineWidth in class CSSStyleDeclarationpublic String getPadding()
padding style attribute.getPadding in class CSSStyleDeclarationpublic String getPaddingBottom()
paddingBottom style attribute.getPaddingBottom in class CSSStyleDeclarationpublic String getPaddingLeft()
paddingLeft style attribute.getPaddingLeft in class CSSStyleDeclarationpublic String getPaddingRight()
paddingRight style attribute.getPaddingRight in class CSSStyleDeclarationpublic String getPaddingTop()
paddingTop style attribute.getPaddingTop in class CSSStyleDeclarationpublic String getRight()
right style attribute.getRight in class CSSStyleDeclarationpublic String getTextIndent()
textIndent style attribute.getTextIndent in class CSSStyleDeclarationpublic String getTop()
top style attribute.getTop in class CSSStyleDeclarationpublic String getVerticalAlign()
verticalAlign style attribute.getVerticalAlign in class CSSStyleDeclarationpublic String getWidth()
width style attribute.getWidth in class CSSStyleDeclarationpublic int getCalculatedWidth(boolean includeBorder,
boolean includePadding)
includeBorder - whether or not to include the border width in the returned valueincludePadding - whether or not to include the padding width in the returned valuepublic int getContentWidth()
public int getCalculatedHeight(boolean includeBorder,
boolean includePadding)
includeBorder - whether or not to include the border height in the returned valueincludePadding - whether or not to include the padding height in the returned valuepublic int getContentHeight()
public boolean isScrollable(boolean horizontal)
true if the element is scrollable along the specified axis.horizontal - if true, the caller is interested in scrollability along the x-axis;
if false, the caller is interested in scrollability along the y-axistrue if the element is scrollable along the specified axispublic int getTop(boolean includeMargin,
boolean includeBorder,
boolean includePadding)
includeMargin - whether or not to take the margin into account in the calculationincludeBorder - whether or not to take the border into account in the calculationincludePadding - whether or not to take the padding into account in the calculationpublic int getLeft(boolean includeMargin,
boolean includeBorder,
boolean includePadding)
includeMargin - whether or not to take the margin into account in the calculationincludeBorder - whether or not to take the border into account in the calculationincludePadding - whether or not to take the padding into account in the calculationpublic String getPositionWithInheritance()
position attribute, replacing inherited values with the actual parent values.position attribute, replacing inherited values with the actual parent valuespublic String getLeftWithInheritance()
left attribute, replacing inherited values with the actual parent values.left attribute, replacing inherited values with the actual parent valuespublic String getRightWithInheritance()
right attribute, replacing inherited values with the actual parent values.right attribute, replacing inherited values with the actual parent valuespublic String getTopWithInheritance()
top attribute, replacing inherited values with the actual parent values.top attribute, replacing inherited values with the actual parent valuespublic String getBottomWithInheritance()
bottom attribute, replacing inherited values with the actual parent values.bottom attribute, replacing inherited values with the actual parent valuespublic int getMarginLeftValue()
public int getMarginRightValue()
public int getMarginTopValue()
public int getMarginBottomValue()
public int getPaddingLeftValue()
public int getPaddingRightValue()
public int getPaddingTopValue()
public int getPaddingBottomValue()
public int getBorderLeftValue()
public int getBorderRightValue()
public int getBorderTopValue()
public int getBorderBottomValue()
public String getWordSpacing()
wordSpacing style attribute.getWordSpacing in class CSSStyleDeclarationpublic String getStyleAttribute(StyleAttributes.Definition style)
getStyleAttribute in class CSSStyleDeclarationstyle - the stylepublic Object getZIndex()
zIndex style attribute.getZIndex in class CSSStyleDeclarationpublic String getPropertyValue(String name)
getPropertyValue in class CSSStyleDeclarationname - the style property nameprotected String pixelString(String value)
CSSStyleDeclaration.pixelValue(Element, CssValue)
if you need percentage support).value - the length value to convert to a pixel length valuepixelString(Element, CSSStyleDeclaration.CssValue)protected String pixelString(Element element, CSSStyleDeclaration.CssValue value)
element - the element for which the CSS attribute value is to be retrievedvalue - the CSS attribute value which is to be retrievedpixelString(String)Copyright © 2002–2016 Gargoyle Software Inc.. All rights reserved.