java.lang.Object
org.xhtmlrenderer.css.style.CalculatedStyle
- Direct Known Subclasses:
EmptyStyle
A set of properties that apply to a single Element, derived from all matched
properties following the rules for CSS cascade, inheritance, importance,
specificity and sequence. A derived style is just like a style but
(presumably) has additional information that allows relative properties to be
assigned values, e.g. font attributes. Property values are fully resolved
when this style is created. A property retrieved by name should always have
only one value in this class (e.g. one-one map). Any methods to retrieve
property values from an instance of this class require a valid
CssContext be given to it, for some cases of property
resolution. Generally, a programmer will not use this class directly, but
will retrieve properties using a StyleReference
implementation.- Author:
- Torbjoern Gannholm, Patrick Wright
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor; as the instance is immutable after use, don't use this for class instantiation externally. -
Method Summary
Modifier and TypeMethodDescriptionfloatasLength(CssContext c, CSSName cssName) String[]asStringArray(CSSName cssName) createAnonymousStyle(IdentValue display) @NonNull CalculatedStylederiveStyle(CascadedStyle matched) derives a child style from this style.boolean@Nullable FSColorConvenience property accessor; returns a Color initialized with the background color value; Uses the actual value (computed actual value) for this element.getBorder(@Nullable CssContext ctx) intintgetColor()Convenience property accessor; returns a Color initialized with the foreground color Uses the actual value (computed actual value) for this element.int@Nullable List<CounterData>@Nullable List<CounterData>@Nullable CursorfloatgetFloatPropertyProportionalHeight(CSSName cssName, float parentHeight, CssContext ctx) floatgetFloatPropertyProportionalTo(CSSName cssName, float baseValue, CssContext ctx) floatgetFloatPropertyProportionalWidth(CSSName cssName, float parentWidth, CssContext ctx) getFont(CssContext ctx) @Nullable FontSpecificationgetFSFont(CssContext cssContext) Gets the ident attribute of the CalculatedStyle objectintgetIntPropertyProportionalTo(CSSName cssName, float baseValue, CssContext ctx) floatgetLineHeight(CssContext ctx) intgetMarginBorderPadding(CssContext cssCtx, int cbWidth, CalculatedStyle.Edge edge) getMarginRect(float cbWidth, CssContext ctx) Convenience property accessor; returns a Border initialized with the four-sided margin width.getMarginRect(float cbWidth, CssContext ctx, boolean useCache) intgetMaxHeight(CssContext c, int cbHeight) intgetMaxWidth(CssContext c, int cbWidth) intgetMinHeight(CssContext c, int cbHeight) intgetMinWidth(CssContext c, int cbWidth) getPaddingRect(float cbWidth, CssContext ctx) getPaddingRect(float cbWidth, CssContext ctx, boolean useCache) Convenience property accessor; returns a Border initialized with the four-sided padding width.@Nullable CalculatedStyleintgetStringProperty(CSSName cssName) @Nullable List<FSDerivedValue>booleanhasAbsoluteUnit(CSSName cssName) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisFixed()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisIdent(CSSName cssName, IdentValue val) Gets the ident attribute of the CalculatedStyle objectbooleanisInline()booleanbooleanbooleanbooleanbooleanbooleanisLengthOrNumber(CSSName cssName) booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanisTable()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetDefaultValue(CSSName cssName, FSDerivedValue fsDerivedValue) toString()valueByName(CSSName cssName) Returns aFSDerivedValueby name.
-
Constructor Details
-
CalculatedStyle
protected CalculatedStyle()Default constructor; as the instance is immutable after use, don't use this for class instantiation externally.
-
-
Method Details
-
deriveStyle
derives a child style from this style.depends on the ability to return the identical CascadedStyle each time a child style is needed
- Parameters:
matched- the CascadedStyle to apply- Returns:
- The derived child style
-
getParent
-
toString
-
asColor
-
asFloat
-
asString
-
asStringArray
-
setDefaultValue
-
hasAbsoluteUnit
-
isIdent
Gets the ident attribute of the CalculatedStyle object -
getIdent
Gets the ident attribute of the CalculatedStyle object -
getDisplay
-
getColor
Convenience property accessor; returns a Color initialized with the foreground color Uses the actual value (computed actual value) for this element.- Returns:
- The color value
-
getBackgroundColor
Convenience property accessor; returns a Color initialized with the background color value; Uses the actual value (computed actual value) for this element.- Returns:
- The backgroundColor value
-
getBackgroundSize
-
getBackgroundPosition
-
getCounterReset
-
getCounterIncrement
-
getBorder
-
getFont
-
getFontSpecification
-
getIntPropertyProportionalTo
-
getFloatPropertyProportionalTo
-
getFloatPropertyProportionalWidth
-
getFloatPropertyProportionalHeight
public float getFloatPropertyProportionalHeight(CSSName cssName, float parentHeight, CssContext ctx) -
getLineHeight
-
getMarginRect
Convenience property accessor; returns a Border initialized with the four-sided margin width. Uses the actual value (computed actual value) for this element.- Returns:
- The marginWidth value
-
getMarginRect
-
getPaddingRect
Convenience property accessor; returns a Border initialized with the four-sided padding width. Uses the actual value (computed actual value) for this element.- Returns:
- The paddingWidth value
-
getPaddingRect
-
getStringProperty
-
isLength
-
isLengthOrNumber
-
valueByName
Returns aFSDerivedValueby name. Because we are a derived style, the property will already be resolved at this point.- Parameters:
cssName- The CSS property name, e.g. "font-family"
-
getCachedPadding
-
getMarginBorderPadding
-
getWhitespace
-
getFSFont
-
getFSFontMetrics
-
getWordWrap
-
getHyphens
-
isClearLeft
public boolean isClearLeft() -
isClearRight
public boolean isClearRight() -
isCleared
public boolean isCleared() -
getBackgroundRepeat
-
getBackgroundAttachment
-
isFixedBackground
public boolean isFixedBackground() -
isInline
public boolean isInline() -
isInlineBlock
public boolean isInlineBlock() -
isTable
public boolean isTable() -
isInlineTable
public boolean isInlineTable() -
isUnderTableLayout
public boolean isUnderTableLayout() -
isTableCell
public boolean isTableCell() -
isTableSection
public boolean isTableSection() -
isTableCaption
public boolean isTableCaption() -
isTableHeader
public boolean isTableHeader() -
isTableRow
public boolean isTableRow() -
isDisplayNone
public boolean isDisplayNone() -
isSpecifiedAsBlock
public boolean isSpecifiedAsBlock() -
isBlockEquivalent
public boolean isBlockEquivalent() -
isLaidOutInInlineContext
public boolean isLaidOutInInlineContext() -
isNeedAutoMarginResolution
public boolean isNeedAutoMarginResolution() -
isAbsolute
public boolean isAbsolute() -
isFixed
public boolean isFixed() -
isFloated
public boolean isFloated() -
isFloatedLeft
public boolean isFloatedLeft() -
isFloatedRight
public boolean isFloatedRight() -
isRelative
public boolean isRelative() -
isPositionedOrFloated
public boolean isPositionedOrFloated() -
isPositioned
public boolean isPositioned() -
isAutoWidth
public boolean isAutoWidth() -
isAbsoluteWidth
public boolean isAbsoluteWidth() -
isAutoHeight
public boolean isAutoHeight() -
isAutoLeftMargin
public boolean isAutoLeftMargin() -
isAutoRightMargin
public boolean isAutoRightMargin() -
isAutoZIndex
public boolean isAutoZIndex() -
establishesBFC
public boolean establishesBFC() -
requiresLayer
public boolean requiresLayer() -
isRunning
public boolean isRunning() -
getRunningName
-
isOverflowApplies
public boolean isOverflowApplies() -
isOverflowVisible
public boolean isOverflowVisible() -
isHorizontalBackgroundRepeat
public boolean isHorizontalBackgroundRepeat() -
isVerticalBackgroundRepeat
public boolean isVerticalBackgroundRepeat() -
isTopAuto
public boolean isTopAuto() -
isBottomAuto
public boolean isBottomAuto() -
isListItem
public boolean isListItem() -
isVisible
public boolean isVisible() -
isForcePageBreakBefore
public boolean isForcePageBreakBefore() -
isForcePageBreakAfter
public boolean isForcePageBreakAfter() -
isAvoidPageBreakInside
public boolean isAvoidPageBreakInside() -
createAnonymousStyle
-
mayHaveFirstLine
public boolean mayHaveFirstLine() -
mayHaveFirstLetter
public boolean mayHaveFirstLetter() -
isNonFlowContent
public boolean isNonFlowContent() -
isMayCollapseMarginsWithChildren
public boolean isMayCollapseMarginsWithChildren() -
isAbsFixedOrInlineBlockEquiv
public boolean isAbsFixedOrInlineBlockEquiv() -
isMaxWidthNone
public boolean isMaxWidthNone() -
isMaxHeightNone
public boolean isMaxHeightNone() -
isBorderBox
public boolean isBorderBox() -
getMinWidth
-
getMaxWidth
-
getMinHeight
-
getMaxHeight
-
isCollapseBorders
public boolean isCollapseBorders() -
getBorderHSpacing
-
getBorderVSpacing
-
getRowSpan
public int getRowSpan() -
getColSpan
public int getColSpan() -
asLength
-
isShowEmptyCells
public boolean isShowEmptyCells() -
isHasBackground
public boolean isHasBackground() -
getTextDecorations
-
getCursor
-
isPaginateTable
public boolean isPaginateTable() -
isTextJustify
public boolean isTextJustify() -
isListMarkerInside
public boolean isListMarkerInside() -
isKeepWithInline
public boolean isKeepWithInline() -
isDynamicAutoWidth
public boolean isDynamicAutoWidth() -
isDynamicAutoWidthApplicable
public boolean isDynamicAutoWidthApplicable() -
isCanBeShrunkToFit
public boolean isCanBeShrunkToFit()
-