- All Implemented Interfaces:
CSSComputedProperties,CSSStyleDeclaration,NodeStyleDeclaration,Serializable,Cloneable,CSS2Properties
- Direct Known Subclasses:
DOMComputedStyle
See section 6.1 of the Document Object Model CSS spec.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedComputedCSSStyle(BaseDocumentCSSStyleSheet docSheet) protectedComputedCSSStyle(ComputedCSSStyle copiedObject) -
Method Summary
Modifier and TypeMethodDescriptionabstract ComputedCSSStyleclone()String[]Gets the computed value(s) for the 'background-image' property.getBoxValues(short unitType) Get the box values from a simple box model.getCascadedValue(String property) floatGets the computed value of the font-size property.floatGets the computed line height with the default 'normal' value of 1.16em.floatgetComputedLineHeight(float defval) Gets the computed line height, in typographic points.Gets the primitive, computed value for the 'background-color' property.Gets the primitive, computed value for the 'color' property.Retrieves the parsable textual representation of the declaration block (excluding the surrounding curly braces).getCSSValue(String property) Gets the absolute, primitive "computed" value for the given property.protected TypedValueprotected StringgetHref(CSSTypedValue cssVal, String baseHref) Attempts to get the absolute Href from the string value of a (uri) property.Retrieves a minified textual representation of the declaration block (excluding the surrounding curly braces).The node that owns this declaration.protected BaseDocumentCSSStyleSheetabstract ComputedCSSStyleGets the computed style for the parent element.getPropertyValue(String propertyName) Gets the text value of a CSS property if it has been explicitly set within this declaration block.getRevertStyle(Condition pseudoElt) Get the error handler for this style declaration.getText()Gets the (whitespace-trimmed) text content of the node associated to this style.Gets the used value of the font-family property.protected voidsetOwnerNode(CSSElement node) protected voidsetPropertyCSSValue(String propertyName, StyleValue value, String hrefcontext) voidwriteCssText(SimpleWriter wri, StyleFormattingContext context) Writes a textual representation of the declaration block (excluding the surrounding curly braces) to aSimpleWriter, and according to aStyleFormattingContext.Methods inherited from class io.sf.carte.doc.style.css.om.BaseCSSStyleDeclaration
addOverrideProperty, addProperty, addStyle, appendLonghandMinifiedCssText, appendShorthandMinifiedCssText, compatLonghand, computeBoundProperty, diff, equals, getAzimuth, getBackground, getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBorderBottom, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderCollapse, getBorderColor, getBorderLeft, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRight, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderSpacing, getBorderStyle, getBorderTop, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBorderWidth, getBottom, getCaptionSide, getClear, getClip, getColor, getContent, getCounterIncrement, getCounterReset, getCssFloat, getCue, getCueAfter, getCueBefore, getCursor, getDeclaredCSSValue, getDirection, getDisplay, getElevation, getEmptyCells, getFont, getFontFamily, getFontSize, getFontSizeAdjust, getFontStretch, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLength, getLetterSpacing, getLineHeight, getListStyle, getListStyleImage, getListStylePosition, getListStyleType, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMarkerOffset, getMarks, getMaxHeight, getMaxWidth, getMinHeight, getMinifiedPropertyValue, getMinWidth, getOrphans, getOutline, getOutlineColor, getOutlineStyle, getOutlineWidth, getOverflow, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPage, getPageBreakAfter, getPageBreakBefore, getPageBreakInside, getParentRule, getPause, getPauseAfter, getPauseBefore, getPitch, getPitchRange, getPlayDuring, getPosition, getPropertyCSSValue, getPropertyPriority, getQuotes, getRichness, getRight, getSize, getSpeak, getSpeakHeader, getSpeakNumeral, getSpeakPunctuation, getSpeechRate, getStress, getStyleDatabase, getStyleSheetFactory, getTableLayout, getTextAlign, getTextDecoration, getTextIndent, getTextShadow, getTextTransform, getTop, getUnicodeBidi, getValueFactory, getVerticalAlign, getVisibility, getVoiceFamily, getVolume, getWhiteSpace, getWidows, getWidth, getWordSpacing, getZIndex, hashCode, isEmpty, item, prioritySplit, removeProperty, setAzimuth, setBackground, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorderBottom, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderCollapse, setBorderColor, setBorderLeft, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRight, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderSpacing, setBorderStyle, setBorderTop, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setCaptionSide, setClear, setClip, setColor, setContent, setCounterIncrement, setCounterReset, setCssFloat, setCssText, setCue, setCueAfter, setCueBefore, setCursor, setDirection, setDisplay, setElevation, setEmptyCells, setFont, setFontFamily, setFontSize, setFontSizeAdjust, setFontStretch, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLetterSpacing, setLexicalProperty, setLineHeight, setListStyle, setListStyleImage, setListStylePosition, setListStyleType, setLonghandProperty, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMarkerOffset, setMarks, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOrphans, setOutline, setOutlineColor, setOutlineStyle, setOutlineWidth, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPage, setPageBreakAfter, setPageBreakBefore, setPageBreakInside, setPause, setPauseAfter, setPauseBefore, setPitch, setPitchRange, setPlayDuring, setPosition, setProperty, setProperty, setQuotes, setRichness, setRight, setSize, setSpeak, setSpeakHeader, setSpeakNumeral, setSpeakPunctuation, setSpeechRate, setStress, setTableLayout, setTextAlign, setTextDecoration, setTextIndent, setTextShadow, setTextTransform, setTop, setUnicodeBidi, setVerticalAlign, setVisibility, setVoiceFamily, setVolume, setWhiteSpace, setWidows, setWidth, setWordSpacing, setZIndex, shorthandError, toString, writeLonghandCssText, writeShorthandCssTextMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.css.CSS2Properties
getAzimuth, getBackground, getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorder, getBorderBottom, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderCollapse, getBorderColor, getBorderLeft, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRight, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderSpacing, getBorderStyle, getBorderTop, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBorderWidth, getBottom, getCaptionSide, getClear, getClip, getColor, getContent, getCounterIncrement, getCounterReset, getCssFloat, getCue, getCueAfter, getCueBefore, getCursor, getDirection, getDisplay, getElevation, getEmptyCells, getFont, getFontFamily, getFontSize, getFontSizeAdjust, getFontStretch, getFontStyle, getFontVariant, getHeight, getLeft, getLetterSpacing, getLineHeight, getListStyle, getListStyleImage, getListStylePosition, getListStyleType, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMarkerOffset, getMarks, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOrphans, getOutline, getOutlineColor, getOutlineStyle, getOutlineWidth, getOverflow, getPadding, getPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPage, getPageBreakAfter, getPageBreakBefore, getPageBreakInside, getPause, getPauseAfter, getPauseBefore, getPitch, getPitchRange, getPlayDuring, getPosition, getQuotes, getRichness, getRight, getSize, getSpeak, getSpeakHeader, getSpeakNumeral, getSpeakPunctuation, getSpeechRate, getStress, getTableLayout, getTextAlign, getTextDecoration, getTextIndent, getTextShadow, getTextTransform, getTop, getUnicodeBidi, getVerticalAlign, getVisibility, getVoiceFamily, getVolume, getWhiteSpace, getWidows, getWidth, getWordSpacing, getZIndex, setAzimuth, setBackground, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorderBottom, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderCollapse, setBorderColor, setBorderLeft, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRight, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderSpacing, setBorderStyle, setBorderTop, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setCaptionSide, setClear, setClip, setColor, setContent, setCounterIncrement, setCounterReset, setCssFloat, setCue, setCueAfter, setCueBefore, setCursor, setDirection, setDisplay, setElevation, setEmptyCells, setFont, setFontFamily, setFontSize, setFontSizeAdjust, setFontStretch, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLetterSpacing, setLineHeight, setListStyle, setListStyleImage, setListStylePosition, setListStyleType, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMarkerOffset, setMarks, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOrphans, setOutline, setOutlineColor, setOutlineStyle, setOutlineWidth, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPage, setPageBreakAfter, setPageBreakBefore, setPageBreakInside, setPause, setPauseAfter, setPauseBefore, setPitch, setPitchRange, setPlayDuring, setPosition, setQuotes, setRichness, setRight, setSize, setSpeak, setSpeakHeader, setSpeakNumeral, setSpeakPunctuation, setSpeechRate, setStress, setTableLayout, setTextAlign, setTextDecoration, setTextIndent, setTextShadow, setTextTransform, setTop, setUnicodeBidi, setVerticalAlign, setVisibility, setVoiceFamily, setVolume, setWhiteSpace, setWidows, setWidth, setWordSpacing, setZIndexMethods inherited from interface io.sf.carte.doc.style.css.CSSComputedProperties
getFontWeight, getPropertyCSSValue, getStyleDatabaseMethods inherited from interface io.sf.carte.doc.style.css.CSSStyleDeclaration
getLength, getParentRule, getPropertyPriority, item, removeProperty, setCssText, setProperty
-
Constructor Details
-
ComputedCSSStyle
-
ComputedCSSStyle
-
-
Method Details
-
setOwnerNode
-
getOwnerNode
Description copied from class:BaseCSSStyleDeclarationThe node that owns this declaration.For computed styles, the owner is always the element for which the style was computed.
- Specified by:
getOwnerNodein interfaceCSSComputedProperties- Specified by:
getOwnerNodein interfaceNodeStyleDeclaration- Overrides:
getOwnerNodein classBaseCSSStyleDeclaration- Returns:
- the node that owns this declaration, or null if none.
-
getOwnerSheet
-
getStyleDeclarationErrorHandler
Description copied from class:AbstractCSSStyleDeclarationGet the error handler for this style declaration.- Overrides:
getStyleDeclarationErrorHandlerin classBaseCSSStyleDeclaration- Returns:
- the error handler, or
nullif this is an anonymous style declaration.
-
getPropertyValue
Description copied from interface:CSSStyleDeclarationGets the text value of a CSS property if it has been explicitly set within this declaration block.If the declaration was created by a factory with the
IEVALUESflag enabled, the compatibility values shall appear in the cssText serializations, but its value won't be returned by this method unless no other valid value was previously specified for the property.- Specified by:
getPropertyValuein interfaceCSSComputedProperties- Specified by:
getPropertyValuein interfaceCSSStyleDeclaration- Overrides:
getPropertyValuein classBaseCSSStyleDeclaration- Parameters:
propertyName- The name of the CSS property.- Returns:
- the value of the property if it has been explicitly set for this declaration block, or the empty string if the property has not been set or is a shorthand that could not be serialized.
-
setPropertyCSSValue
- Overrides:
setPropertyCSSValuein classBaseCSSStyleDeclaration
-
getCascadedValue
- Throws:
StyleDatabaseRequiredException
-
getCSSValue
Gets the absolute, primitive "computed" value for the given property.The rendering context is not taken into account for this method.
See paragraph 6.1.2 of the Document Object Model CSS specification for the definition of "computed" values.
- Overrides:
getCSSValuein classBaseCSSStyleDeclaration- Parameters:
property- the property that we want to evaluate.- Returns:
- the primitive value of the property, a CSSShorthandValue if the property is a shorthand, or null if the property is not known.
- Throws:
StyleDatabaseRequiredException- when a computation that requires a style database is attempted, but no style database has been set.
-
getComputedFontSize
public float getComputedFontSize()Gets the computed value of the font-size property.May require a style database to give accurate results.
- Specified by:
getComputedFontSizein interfaceCSSComputedProperties- Returns:
- the value of the font-size property, in typographic points.
-
getComputedLineHeight
public float getComputedLineHeight()Gets the computed line height with the default 'normal' value of 1.16em.- Specified by:
getComputedLineHeightin interfaceCSSComputedProperties- Returns:
- the default computed line height, in typographic points.
-
getComputedLineHeight
public float getComputedLineHeight(float defval) Gets the computed line height, in typographic points.- Parameters:
defval- the default value in EMs.- Returns:
- the computed line height, or the default value if the computed value could not be found.
-
getCurrentColor
- Overrides:
getCurrentColorin classBaseCSSStyleDeclaration
-
getCSSColor
Description copied from interface:CSSComputedPropertiesGets the primitive, computed value for the 'color' property.- Specified by:
getCSSColorin interfaceCSSComputedProperties- Overrides:
getCSSColorin classBaseCSSStyleDeclaration- Returns:
- the value for the 'color' property.
-
getCSSBackgroundColor
Description copied from interface:CSSComputedPropertiesGets the primitive, computed value for the 'background-color' property.- Specified by:
getCSSBackgroundColorin interfaceCSSComputedProperties- Returns:
- the value for the 'background-color' property.
-
getBackgroundImages
Description copied from interface:CSSComputedPropertiesGets the computed value(s) for the 'background-image' property.- Specified by:
getBackgroundImagesin interfaceCSSComputedProperties- Returns:
- an array with the values for the layered 'background-image' property, or null if no background image was set for the element.
-
getHref
Attempts to get the absolute Href from the string value of a (uri) property.- Parameters:
cssVal- the uri value.baseHref- the base href context. Cannot be null.- Returns:
- the base URL, or null if could not be determined.
-
getUsedFontFamily
Gets the used value of the font-family property.If the computed value is a list, it returns the first item. If a style database is available, it returns the 'used' value.
If no font family is set, a default value of
Serifis used.- Specified by:
getUsedFontFamilyin interfaceCSSComputedProperties- Returns:
- the value of the font-family property.
-
getBoxValues
Get the box values from a simple box model.- Specified by:
getBoxValuesin interfaceCSSComputedProperties- Parameters:
unitType- the desired unit type.- Returns:
- the box values, in the specified unit.
- Throws:
DOMException- if the document contains features that are not supported by the simple model.StyleDatabaseRequiredException- when a computation that requires a style database is attempted, but no style database has been set.
-
getCssText
Description copied from class:BaseCSSStyleDeclarationRetrieves the parsable textual representation of the declaration block (excluding the surrounding curly braces).- Specified by:
getCssTextin interfaceCSSStyleDeclaration- Overrides:
getCssTextin classBaseCSSStyleDeclaration- Returns:
- the textual representation of the declaration block.
-
writeCssText
Description copied from class:AbstractCSSStyleDeclarationWrites a textual representation of the declaration block (excluding the surrounding curly braces) to aSimpleWriter, and according to aStyleFormattingContext.- Specified by:
writeCssTextin interfaceCSSStyleDeclaration- Overrides:
writeCssTextin classBaseCSSStyleDeclaration- Parameters:
wri- the simple writer to write to.context- the style formatting context.- Throws:
IOException- if a problem occurs while writing the text.
-
getMinifiedCssText
Description copied from class:AbstractCSSStyleDeclarationRetrieves a minified textual representation of the declaration block (excluding the surrounding curly braces).- Specified by:
getMinifiedCssTextin interfaceCSSStyleDeclaration- Overrides:
getMinifiedCssTextin classBaseCSSStyleDeclaration- Returns:
- the minified representation of this style declaration.
-
getRevertStyle
-
getParentComputedStyle
Gets the computed style for the parent element.- Specified by:
getParentComputedStylein interfaceCSSComputedProperties- Returns:
- the computed style for the parent element, or null if there is no parent element, or has no style associated.
-
getText
Gets the (whitespace-trimmed) text content of the node associated to this style.- Returns:
- the text content, or the empty string if the box has no text.
-
clone
- Overrides:
clonein classBaseCSSStyleDeclaration
-