public class ComputedCSSStyleDeclaration extends CSSStyleDeclaration
Window.getComputedStyle(Object, String)
,
Serialized FormCSSStyleDeclaration.CssValue
Constructor and Description |
---|
ComputedCSSStyleDeclaration()
Creates an instance.
|
ComputedCSSStyleDeclaration(CSSStyleDeclaration style)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
applyStyleFromSelector(com.gargoylesoftware.css.dom.CSSStyleDeclarationImpl declaration,
com.gargoylesoftware.css.parser.selector.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 |
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 |
getFont()
Gets the
font style attribute. |
String |
getFontFamily()
Gets the
fontFamily 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 |
getLineHeight()
Gets the
lineHeight 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 |
getOrphans()
Gets the
orphans 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 |
getPosition()
Gets the
position style attribute. |
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. |
String |
getStyleAttribute(StyleAttributes.Definition style,
boolean getDefaultValueIfEmpty)
Get the value for the style attribute.
|
protected 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 |
getWidows()
Gets the
widows 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, getBorderTop, getCssText, getElement, getIds, getLength, getMsImeAlign, getOutline, getPixelBottom, getPixelHeight, getPixelLeft, getPixelRight, getPixelTop, getPixelWidth, getPosBottom, getPosHeight, getPosLeft, getPosRight, getPosTop, getPosWidth, getPropertyPriority, getRubyAlign, getSize, getStyleAttribute, getStylePriority, getTextDecorationUnderline, getWithPreemption, has, isTextDecorationBlink, isTextDecorationLineThrough, isTextDecorationNone, isTextDecorationOverline, pixelValue, pixelValue, put, removeAttribute, removeProperty, setAccelerator, setAttribute, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderTop, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBottom, setColor, setCssFloat, setCssText, setDisplay, setFont, setFontFamily, setFontSize, setHeight, setLeft, setLetterSpacing, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setMsImeAlign, setOpacity, setOrphans, setOutline, setOutlineWidth, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPixelBottom, setPixelHeight, setPixelLeft, setPixelRight, setPixelTop, setPixelWidth, setPosBottom, setPosHeight, setPosition, setPosLeft, setPosRight, setPosTop, setPosWidth, setProperty, setRight, setRubyAlign, setSize, setStyleAttribute, setTextDecorationBlink, setTextDecorationLineThrough, setTextDecorationNone, setTextDecorationOverline, setTextDecorationUnderline, setTextIndent, setTop, setVerticalAlign, setWidows, setWidth, setWordSpacing, setZIndex, toRGBColor, toString
clone, equivalentValues, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, has, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
defineFunctionProperties, defineProperty, getClassName, setClassName, setParentScope
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public ComputedCSSStyleDeclaration()
public ComputedCSSStyleDeclaration(CSSStyleDeclaration style)
style
- the original Styleprotected void setStyleAttribute(String name, String newValue)
setStyleAttribute
in class CSSStyleDeclaration
name
- the attribute name (camel-cased)newValue
- the attribute valuepublic void applyStyleFromSelector(com.gargoylesoftware.css.dom.CSSStyleDeclarationImpl declaration, com.gargoylesoftware.css.parser.selector.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 StyleElement getStyleElement(String name)
CSSStyleDeclaration
getStyleElement
in class CSSStyleDeclaration
name
- the name of the requested StyleElementpublic String getAccelerator()
accelerator
style attribute.getAccelerator
in class CSSStyleDeclaration
public String getBackgroundAttachment()
backgroundAttachment
style attribute.getBackgroundAttachment
in class CSSStyleDeclaration
public String getBackgroundColor()
backgroundColor
style attribute.getBackgroundColor
in class CSSStyleDeclaration
public String getBackgroundImage()
backgroundImage
style attribute.getBackgroundImage
in class CSSStyleDeclaration
public String getBackgroundPosition()
backgroundPosition
style attribute.getBackgroundPosition
in class CSSStyleDeclaration
public String getBackgroundRepeat()
backgroundRepeat
style attribute.getBackgroundRepeat
in class CSSStyleDeclaration
public String getBorderBottomColor()
borderBottomColor
style attribute.getBorderBottomColor
in class CSSStyleDeclaration
public String getBorderBottomStyle()
borderBottomStyle
style attribute.getBorderBottomStyle
in class CSSStyleDeclaration
public String getBorderBottomWidth()
borderBottomWidth
style attribute.getBorderBottomWidth
in class CSSStyleDeclaration
public String getBorderLeftColor()
borderLeftColor
style attribute.getBorderLeftColor
in class CSSStyleDeclaration
public String getBorderLeftStyle()
borderLeftStyle
style attribute.getBorderLeftStyle
in class CSSStyleDeclaration
public String getBorderLeftWidth()
borderLeftWidth
style attribute.getBorderLeftWidth
in class CSSStyleDeclaration
public String getBorderRightColor()
borderRightColor
style attribute.getBorderRightColor
in class CSSStyleDeclaration
public String getBorderRightStyle()
borderRightStyle
style attribute.getBorderRightStyle
in class CSSStyleDeclaration
public String getBorderRightWidth()
borderRightWidth
style attribute.getBorderRightWidth
in class CSSStyleDeclaration
public String getBorderTopColor()
borderTopColor
style attribute.getBorderTopColor
in class CSSStyleDeclaration
public String getBorderTopStyle()
borderTopStyle
style attribute.getBorderTopStyle
in class CSSStyleDeclaration
public String getBorderTopWidth()
borderTopWidth
style attribute.getBorderTopWidth
in class CSSStyleDeclaration
public String getBottom()
bottom
style attribute.getBottom
in class CSSStyleDeclaration
public String getColor()
color
style attribute.getColor
in class CSSStyleDeclaration
public String getCssFloat()
cssFloat
style attribute.getCssFloat
in class CSSStyleDeclaration
public String getDisplay()
display
style attribute.getDisplay
in class CSSStyleDeclaration
public String getFont()
font
style attribute.getFont
in class CSSStyleDeclaration
public String getFontSize()
fontSize
style attribute.getFontSize
in class CSSStyleDeclaration
public String getLineHeight()
lineHeight
style attribute.getLineHeight
in class CSSStyleDeclaration
public String getFontFamily()
fontFamily
style attribute.getFontFamily
in class CSSStyleDeclaration
public String getHeight()
height
style attribute.getHeight
in class CSSStyleDeclaration
public String getLeft()
left
style attribute.getLeft
in class CSSStyleDeclaration
public String getLetterSpacing()
letterSpacing
style attribute.getLetterSpacing
in class CSSStyleDeclaration
public String getMargin()
margin
style attribute.getMargin
in class CSSStyleDeclaration
public String getMarginBottom()
marginBottom
style attribute.getMarginBottom
in class CSSStyleDeclaration
public String getMarginLeft()
marginLeft
style attribute.getMarginLeft
in class CSSStyleDeclaration
public String getMarginRight()
marginRight
style attribute.getMarginRight
in class CSSStyleDeclaration
public String getMarginTop()
marginTop
style attribute.getMarginTop
in class CSSStyleDeclaration
public String getMaxHeight()
maxHeight
style attribute.getMaxHeight
in class CSSStyleDeclaration
public String getMaxWidth()
maxWidth
style attribute.getMaxWidth
in class CSSStyleDeclaration
public String getMinHeight()
minHeight
style attribute.getMinHeight
in class CSSStyleDeclaration
public String getMinWidth()
minWidth
style attribute.getMinWidth
in class CSSStyleDeclaration
public String getOpacity()
opacity
style attribute.getOpacity
in class CSSStyleDeclaration
public String getOutlineWidth()
outlineWidth
style attribute.getOutlineWidth
in class CSSStyleDeclaration
public String getPadding()
padding
style attribute.getPadding
in class CSSStyleDeclaration
public String getPaddingBottom()
paddingBottom
style attribute.getPaddingBottom
in class CSSStyleDeclaration
public String getPaddingLeft()
paddingLeft
style attribute.getPaddingLeft
in class CSSStyleDeclaration
public String getPaddingRight()
paddingRight
style attribute.getPaddingRight
in class CSSStyleDeclaration
public String getPaddingTop()
paddingTop
style attribute.getPaddingTop
in class CSSStyleDeclaration
public String getRight()
right
style attribute.getRight
in class CSSStyleDeclaration
public String getTextIndent()
textIndent
style attribute.getTextIndent
in class CSSStyleDeclaration
public String getTop()
top
style attribute.getTop
in class CSSStyleDeclaration
public String getVerticalAlign()
verticalAlign
style attribute.getVerticalAlign
in class CSSStyleDeclaration
public String getWidows()
widows
style attribute.getWidows
in class CSSStyleDeclaration
public String getOrphans()
orphans
style attribute.getOrphans
in class CSSStyleDeclaration
public String getPosition()
position
style attribute.getPosition
in class CSSStyleDeclaration
public String getWidth()
width
style attribute.getWidth
in class CSSStyleDeclaration
public 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 CSSStyleDeclaration
public String getStyleAttribute(StyleAttributes.Definition style, boolean getDefaultValueIfEmpty)
getStyleAttribute
in class CSSStyleDeclaration
style
- the definitiongetDefaultValueIfEmpty
- whether to get the default value if empty or notpublic Object getZIndex()
zIndex
style attribute.getZIndex
in class CSSStyleDeclaration
public String getPropertyValue(String name)
getPropertyValue
in class CSSStyleDeclaration
name
- 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–2021 Gargoyle Software Inc.. All rights reserved.