Package org.xhtmlrenderer.render
Class BlockBox
java.lang.Object
org.xhtmlrenderer.render.Box
org.xhtmlrenderer.render.BlockBox
- All Implemented Interfaces:
InlinePaintable
,Styleable
- Direct Known Subclasses:
AnonymousBlockBox
,MarginBox
,TableBox
,TableCellBox
,TableRowBox
,TableSectionBox
,ViewportBox
A block box as defined in the CSS spec. It also provides a base class for
other kinds of block content (for example table rows or cells).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
protected static final int
static final int
static final int
static final int
Fields inherited from class org.xhtmlrenderer.render.Box
CHILDREN_FLUX, DONE, DUMP_LAYOUT, DUMP_RENDER, FLUX, NOTHING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendPositioningInfo
(StringBuilder result) int
void
void
protected void
calcChildPaintingInfo
(CssContext c, PaintingInfo result, boolean useCache) void
protected void
calcDimensions
(LayoutContext c, int cssWidth) protected int
void
int
protected void
calcLayoutHeight
(LayoutContext c, BorderPropertySet border, RectPropertySet margin, RectPropertySet padding) void
boolean
copyOf()
void
dump
(LayoutContext c, String indent, int which) void
findLastNthLineBox
(int count) int
findOffset
(Box box) protected int
int
int
protected int
protected int
protected int
protected int
getCSSWidth
(CssContext c, boolean shrinkingToFit) protected String
int
int
int
protected int
getPaintingClipEdge
(CssContext cssCtx) void
initStaticPos
(LayoutContext c, BlockBox parent, int childOffset) protected boolean
boolean
boolean
boolean
boolean
protected boolean
boolean
boolean
boolean
isInline()
protected boolean
boolean
protected boolean
protected boolean
boolean
boolean
boolean
boolean
protected boolean
boolean
void
void
layout
(LayoutContext c, int contentStart) protected void
layoutChildren
(LayoutContext c, int contentStart) protected void
layoutInlineChildren
(LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain) void
void
void
void
positionAbsolute
(CssContext cssCtx, int direction) void
protected void
propagateExtraSpace
(LayoutContext c, ContentLimitContainer parentContainer, ContentLimitContainer currentContainer, int extraTop, int extraBottom) void
protected void
resolveAutoMargins
(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border) void
setBottomMarginCalculated
(boolean bottomMarginCalculated) void
setChildrenContentType
(int contentType) protected void
setChildrenHeight
(int childrenHeight) protected void
setDimensionsCalculated
(boolean dimensionsCalculated) void
setFirstLetterStyle
(CascadedStyle firstLetterStyle) void
setFirstLineStyle
(CascadedStyle firstLineStyle) void
setFloatedBoxData
(FloatedBoxData floatedBoxData) void
setFromCaptionedTable
(boolean fromTable) void
setInlineContent
(List<Styleable> inlineContent) void
setListCounter
(int listCounter) void
setMarkerData
(MarkerData markerData) protected void
setMaxWidth
(int maxWidth) protected void
setMinMaxCalculated
(boolean minMaxCalculated) protected void
setMinWidth
(int minWidth) void
setNeedPageClear
(boolean needPageClear) protected void
setNeedShrinkToFitCalculation
(boolean needShrinkToFitCalculation) void
setPersistentBFC
(PersistentBFC persistentBFC) void
setReplacedElement
(ReplacedElement replacedElement) void
setStaticEquivalent
(Box staticEquivalent) void
setTopMarginCalculated
(boolean topMarginCalculated) void
void
styleText
(LayoutContext c, CalculatedStyle style) toString()
Methods inherited from class org.xhtmlrenderer.render.Box
addAllChildren, addChild, addChildForLayout, analyzePageBreaks, calcPaintingInfo, clearSelection, collectText, connectChildrenToCurrentLayer, crossesPageBreak, detach, dumpBoxes, exportPageBoxText, exportText, find, forcePageBreakAfter, forcePageBreakBefore, getAbsX, getAbsY, getBorder, getBorderEdge, getBorderSides, getBoxDimensions, getChild, getChildCount, getChildIterator, getChildren, getChildrenClipEdge, getContainingBlock, getContainingBlockWidth, getContainingLayer, getContentAreaEdge, getContentWidth, getEffBackgroundColor, getEffectiveWidth, getElement, getElementBoxes, getHeight, getIndex, getLayer, getLeftMBP, getMargin, getMarginBorderPadding, getMarginEdge, getMarginEdge, getNext, getNextSibling, getPadding, getPaddingEdge, getPaddingWidth, getPaintingBorderEdge, getPaintingInfo, getPaintingPaddingEdge, getParent, getPrevious, getPreviousSibling, getPseudoElementOrClass, getRelativeOffset, getRestyleTarget, getRightMBP, getState, getStyle, getStyleMargin, getStyleMargin, getTx, getTy, getWidth, getX, getY, initContainingLayer, intersects, isAnonymous, isBody, isContainedInMarginBox, isInDocumentFlow, isInitialContainingBlock, isMarginAreaRoot, isRoot, isStyled, moveIfGreater, paintBackground, paintBorder, paintRootElementBackground, positionRelative, removeAllChildren, removeChild, removeChild, resetChildren, resetChildren, resetTopMargin, restyle, restyleChildren, selectAll, setAbsX, setAbsY, setAnonymous, setBoxDimensions, setContainingBlock, setContainingLayer, setContentWidth, setElement, setHeight, setIndex, setLayer, setLeftMBP, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setParent, setPseudoElementOrClass, setRelativeOffset, setRightMBP, setState, setStyle, setTx, setTy, setX, setY, stateToString
-
Field Details
-
POSITION_VERTICALLY
public static final int POSITION_VERTICALLY- See Also:
-
POSITION_HORIZONTALLY
public static final int POSITION_HORIZONTALLY- See Also:
-
POSITION_BOTH
public static final int POSITION_BOTH- See Also:
-
CONTENT_UNKNOWN
public static final int CONTENT_UNKNOWN- See Also:
-
CONTENT_INLINE
public static final int CONTENT_INLINE- See Also:
-
CONTENT_BLOCK
public static final int CONTENT_BLOCK- See Also:
-
CONTENT_EMPTY
public static final int CONTENT_EMPTY- See Also:
-
NO_BASELINE
protected static final int NO_BASELINE- See Also:
-
-
Constructor Details
-
BlockBox
public BlockBox()
-
-
Method Details
-
copyOf
-
getExtraBoxDescription
-
toString
-
appendPositioningInfo
-
dump
-
paintListMarker
-
getPaintingClipEdge
- Overrides:
getPaintingClipEdge
in classBox
-
paintInline
- Specified by:
paintInline
in interfaceInlinePaintable
-
isInline
public boolean isInline() -
getLineBox
-
paintDebugOutline
-
getMarkerData
-
setMarkerData
-
createMarkerData
-
getListCounter
public int getListCounter() -
setListCounter
public void setListCounter(int listCounter) -
getPersistentBFC
-
setPersistentBFC
-
getStaticEquivalent
-
setStaticEquivalent
-
isReplaced
public boolean isReplaced() -
calcCanvasLocation
public void calcCanvasLocation()- Specified by:
calcCanvasLocation
in classBox
-
calcInitialFloatedCanvasLocation
-
calcChildLocations
public void calcChildLocations()- Overrides:
calcChildLocations
in classBox
-
isNeedPageClear
public boolean isNeedPageClear() -
setNeedPageClear
public void setNeedPageClear(boolean needPageClear) -
positionAbsolute
-
positionAbsoluteOnPage
-
getReplacedElement
-
setReplacedElement
-
reset
-
resolveAutoMargins
protected void resolveAutoMargins(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border) -
calcDimensions
-
calcDimensions
-
layout
-
layout
-
isAllowHeightToShrink
protected boolean isAllowHeightToShrink() -
getPageClearance
protected int getPageClearance() -
calcLayoutHeight
protected void calcLayoutHeight(LayoutContext c, BorderPropertySet border, RectPropertySet margin, RectPropertySet padding) -
ensureChildren
-
layoutChildren
-
layoutInlineChildren
protected void layoutInlineChildren(LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain) -
getChildrenContentType
public int getChildrenContentType() -
setChildrenContentType
public void setChildrenContentType(int contentType) -
getInlineContent
-
setInlineContent
-
isSkipWhenCollapsingMargins
protected boolean isSkipWhenCollapsingMargins() -
isMayCollapseMarginsWithChildren
protected boolean isMayCollapseMarginsWithChildren() -
isTopMarginCalculated
public boolean isTopMarginCalculated() -
setTopMarginCalculated
public void setTopMarginCalculated(boolean topMarginCalculated) -
isBottomMarginCalculated
public boolean isBottomMarginCalculated() -
setBottomMarginCalculated
public void setBottomMarginCalculated(boolean bottomMarginCalculated) -
getCSSWidth
-
getCSSWidth
-
getCSSFitToWidth
-
getCSSHeight
-
isAutoHeight
public boolean isAutoHeight() -
getAvailableWidth
-
isFixedWidthAdvisoryOnly
protected boolean isFixedWidthAdvisoryOnly() -
calcMinMaxWidth
-
getMaxWidth
public int getMaxWidth() -
setMaxWidth
protected void setMaxWidth(int maxWidth) -
getMinWidth
public int getMinWidth() -
setMinWidth
protected void setMinWidth(int minWidth) -
styleText
-
styleText
-
calcChildPaintingInfo
- Overrides:
calcChildPaintingInfo
in classBox
-
getFirstLetterStyle
-
setFirstLetterStyle
-
getFirstLineStyle
-
setFirstLineStyle
-
isMinMaxCalculated
protected boolean isMinMaxCalculated() -
setMinMaxCalculated
protected void setMinMaxCalculated(boolean minMaxCalculated) -
setDimensionsCalculated
protected void setDimensionsCalculated(boolean dimensionsCalculated) -
setNeedShrinkToFitCalculation
protected void setNeedShrinkToFitCalculation(boolean needShrinkToFitCalculation) -
initStaticPos
-
calcBaseline
-
calcInitialBreakAtLine
-
isCurrentBreakAtLineContext
-
calcBreakAtLineContext
-
calcInlineBaseline
-
findOffset
-
findLastNthLineBox
-
isNeedsKeepWithInline
-
isFloated
public boolean isFloated() -
getFloatedBoxData
-
setFloatedBoxData
-
getChildrenHeight
public int getChildrenHeight() -
setChildrenHeight
protected void setChildrenHeight(int childrenHeight) -
isFromCaptionedTable
public boolean isFromCaptionedTable() -
setFromCaptionedTable
public void setFromCaptionedTable(boolean fromTable) -
isInlineBlock
protected boolean isInlineBlock()- Overrides:
isInlineBlock
in classBox
-
isInMainFlow
public boolean isInMainFlow() -
getDocumentParent
- Overrides:
getDocumentParent
in classBox
-
isContainsInlineContent
-
checkPageContext
-
isNeedsClipOnPaint
-
propagateExtraSpace
protected void propagateExtraSpace(LayoutContext c, ContentLimitContainer parentContainer, ContentLimitContainer currentContainer, int extraTop, int extraBottom)
-