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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumprivate static classprivate static classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate BlockBox.ContentTypeprivate intprivate booleanprivate @Nullable CascadedStyleprivate @Nullable CascadedStyleprivate @Nullable FloatedBoxDataprivate booleanprivate intprivate @Nullable MarkerDataprivate intprivate booleanprivate intprivate booleanprivate booleanprivate @Nullable BlockBox.MarginCollapseResultprivate @Nullable PersistentBFCprivate @Nullable ReplacedElementprivate @Nullable Boxprivate booleanprotected static final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBlockBox()BlockBox(@Nullable Element element, @Nullable CalculatedStyle style, boolean anonymous) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidprotected voidappendPositioningInfo(StringBuilder result) private voidprivate voidintvoidvoidprotected voidcalcChildPaintingInfo(CssContext c, PaintingInfo result, boolean useCache) private voidvoidprotected voidcalcDimensions(LayoutContext c, int cssWidth) private intprivate voidprotected intvoidintprotected voidcalcLayoutHeight(LayoutContext c, BorderPropertySet border, RectPropertySet margin, RectPropertySet padding) private voidcalcMinMaxCSSMinMaxWidth(LayoutContext c, RectPropertySet margin, BorderPropertySet border, RectPropertySet padding) voidprivate voidprivate voidprivate intprivate intprivate intprivate voidbooleanprivate voidcollapseBottomMargin(LayoutContext c, boolean calculationRoot, BlockBox.MarginCollapseResult result) private voidprivate voidprivate voidcollapseTopMargin(LayoutContext c, boolean calculationRoot, BlockBox.MarginCollapseResult result) copyOf()private MarkerDatadump(LayoutContext c, String indent, Box.Dump which) voidprivate LineBoxprivate LineBoxprivate voidfindLastNthLineBox(int count) intfindOffset(Box box) private ReplacedElementprotected int@NonNull BlockBox.ContentTypeintprivate intprotected intprotected intprivate intprivate intprivate intprivate intprotected intprotected intgetCSSWidth(CssContext c, boolean shrinkingToFit) protected String@Nullable FloatedBoxData@Nullable LineBoxint@Nullable MarkerDataintintprivate BlockBoxgetNextCollapsableSibling(BlockBox.MarginCollapseResult collapsedMargin) protected intgetPaintingClipEdge(CssContext cssCtx) @Nullable PersistentBFC@Nullable ReplacedElement@Nullable Boxprivate MarkerDatavoidinitStaticPos(LayoutContext c, BlockBox parent, int childOffset) protected booleanbooleanbooleanbooleanbooleanprivate booleanprotected booleanbooleanbooleanbooleanisInline()protected booleanbooleanprotected booleanprotected booleanbooleanbooleanprivate booleanbooleanprivate booleanprivate booleanbooleanprotected booleanbooleanprivate booleanprivate voidvoidvoidlayout(LayoutContext c, int contentStart) protected voidlayoutChildren(LayoutContext c, int contentStart) protected voidlayoutInlineChildren(LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain) private MarkerData.GlyphMarkermakeGlyphMarker(StrutMetrics strutMetrics) private @Nullable MarkerData.ImageMarkermakeImageMarker(LayoutContext c, StrutMetrics structMetrics, String image) private MarkerData.TextMarkermakeTextMarker(LayoutContext c, IdentValue listStyle) voidvoidvoidvoidpositionAbsolute(CssContext cssCtx, BlockBox.Position direction) voidprotected voidpropagateExtraSpace(LayoutContext c, ContentLimitContainer parentContainer, ContentLimitContainer currentContainer, int extraTop, int extraBottom) private voidvoidprotected voidresolveAutoMargins(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border) private voidsatisfyWidowsAndOrphans(LayoutContext c, int contentStart, boolean tryAgain) voidsetBottomMarginCalculated(boolean bottomMarginCalculated) voidsetChildrenContentType(BlockBox.ContentType contentType) protected voidsetChildrenHeight(int childrenHeight) private voidsetCollapsedBottomMargin(LayoutContext c, RectPropertySet margin, BlockBox.MarginCollapseResult collapsedMargin) protected voidsetDimensionsCalculated(boolean dimensionsCalculated) voidsetFirstLetterStyle(CascadedStyle firstLetterStyle) voidsetFirstLineStyle(CascadedStyle firstLineStyle) voidsetFloatedBoxData(@Nullable FloatedBoxData floatedBoxData) voidsetFromCaptionedTable(boolean fromTable) final voidsetInlineContent(List<Styleable> inlineContent) voidsetListCounter(int listCounter) protected voidsetMaxWidth(int maxWidth) protected voidsetMinMaxCalculated(boolean minMaxCalculated) protected voidsetMinWidth(int minWidth) voidsetNeedPageClear(boolean needPageClear) protected voidsetNeedShrinkToFitCalculation(boolean needShrinkToFitCalculation) voidsetPersistentBFC(PersistentBFC persistentBFC) voidsetReplacedElement(@Nullable ReplacedElement replacedElement) voidsetStaticEquivalent(Box staticEquivalent) voidsetTopMarginCalculated(boolean topMarginCalculated) voidvoidstyleText(LayoutContext c, CalculatedStyle style) toString()Methods inherited from class org.xhtmlrenderer.render.Box
addAllChildren, addChild, addChildForLayout, analyzePageBreaks, appendPosition, appendSize, calcPaintingInfo, clearSelection, collectText, connectChildrenToCurrentLayer, crossesPageBreak, detach, dumpBoxes, exportPageBoxText, exportText, find, forcePageBreakAfter, forcePageBreakBefore, getAbsX, getAbsY, getBorder, getBorderEdge, getBorderSides, getBoxDimensions, getChild, getChildCount, 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, getStyleMarginNoCache, 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, setBoxDimensions, setContainingBlock, setContainingLayer, setContentWidth, setElement, setHeight, setIndex, setLayer, setLeftMBP, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setParent, setPseudoElementOrClass, setRightMBP, setState, setStyle, setTx, setTy, setX, setY
-
Field Details
-
NO_BASELINE
protected static final int NO_BASELINE- See Also:
-
_markerData
-
_listCounter
private int _listCounter -
_persistentBFC
-
_staticEquivalent
-
_needPageClear
private boolean _needPageClear -
_replacedElement
-
_childrenContentType
-
_inlineContent
-
_topMarginCalculated
private boolean _topMarginCalculated -
_bottomMarginCalculated
private boolean _bottomMarginCalculated -
_pendingCollapseCalculation
-
_minWidth
private int _minWidth -
_maxWidth
private int _maxWidth -
_minMaxCalculated
private boolean _minMaxCalculated -
_dimensionsCalculated
private boolean _dimensionsCalculated -
_needShrinkToFitCalculation
private boolean _needShrinkToFitCalculation -
_firstLineStyle
-
_firstLetterStyle
-
_floatedBoxData
-
_childrenHeight
private int _childrenHeight -
_fromCaptionedTable
private boolean _fromCaptionedTable
-
-
Constructor Details
-
BlockBox
protected BlockBox() -
BlockBox
-
-
Method Details
-
copyOf
-
getExtraBoxDescription
-
toString
-
appendPositioningInfo
-
dump
-
paintListMarker
-
getPaintingClipEdge
- Overrides:
getPaintingClipEdgein classBox
-
paintInline
- Specified by:
paintInlinein interfaceInlinePaintable
-
isInline
public boolean isInline() -
getLineBox
-
paintDebugOutline
-
getMarkerData
-
initMarkerData
-
createMarkerData
-
makeGlyphMarker
-
makeImageMarker
@CheckReturnValue private @Nullable MarkerData.ImageMarker makeImageMarker(LayoutContext c, StrutMetrics structMetrics, String image) -
makeTextMarker
-
getListCounter
public int getListCounter() -
setListCounter
public void setListCounter(int listCounter) -
getPersistentBFC
-
setPersistentBFC
-
getStaticEquivalent
-
setStaticEquivalent
-
isReplaced
public boolean isReplaced() -
calcCanvasLocation
public void calcCanvasLocation()- Specified by:
calcCanvasLocationin classBox
-
calcInitialFloatedCanvasLocation
-
calcChildLocations
public void calcChildLocations()- Overrides:
calcChildLocationsin classBox
-
isNeedPageClear
public boolean isNeedPageClear() -
setNeedPageClear
public void setNeedPageClear(boolean needPageClear) -
alignToStaticEquivalent
private void alignToStaticEquivalent() -
positionAbsolute
-
positionAbsoluteOnPage
-
getReplacedElement
-
setReplacedElement
-
reset
-
calcPinnedContentWidth
-
calcPinnedHeight
-
resolveAutoMargins
protected void resolveAutoMargins(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border) -
calcEffPageRelativeWidth
-
calcDimensions
-
calcDimensions
-
calcClearance
-
calcExtraPageClearance
-
addBoxID
-
layout
-
layout
-
isAllowHeightToShrink
protected boolean isAllowHeightToShrink() -
getPageClearance
protected int getPageClearance() -
calcLayoutHeight
protected void calcLayoutHeight(LayoutContext c, BorderPropertySet border, RectPropertySet margin, RectPropertySet padding) -
calcShrinkToFitWidthIfNeeded
-
applyCSSMinMaxWidth
-
applyCSSMinMaxHeight
-
ensureChildren
-
layoutChildren
-
layoutInlineChildren
protected void layoutInlineChildren(LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain) -
justifyText
private void justifyText() -
satisfyWidowsAndOrphans
-
getChildrenContentType
-
setChildrenContentType
-
getInlineContent
-
setInlineContent
-
isSkipWhenCollapsingMargins
protected boolean isSkipWhenCollapsingMargins() -
isMayCollapseMarginsWithChildren
protected boolean isMayCollapseMarginsWithChildren() -
collapseMargins
-
setCollapsedBottomMargin
private void setCollapsedBottomMargin(LayoutContext c, RectPropertySet margin, BlockBox.MarginCollapseResult collapsedMargin) -
getNextCollapsableSibling
-
collapseTopMargin
private void collapseTopMargin(LayoutContext c, boolean calculationRoot, BlockBox.MarginCollapseResult result) -
collapseBottomMargin
private void collapseBottomMargin(LayoutContext c, boolean calculationRoot, BlockBox.MarginCollapseResult result) -
isNoTopPaddingOrBorder
-
isNoBottomPaddingOrBorder
-
collapseEmptySubtreeMargins
-
isVerticalMarginsAdjoin
-
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() -
getCSSMinWidth
-
getCSSMaxWidth
-
getCSSMinHeight
-
getCSSMaxHeight
-
getContainingBlockCSSHeight
-
calcShrinkToFitWidth
-
getAvailableWidth
-
isFixedWidthAdvisoryOnly
protected boolean isFixedWidthAdvisoryOnly() -
recalculateMargin
-
calcMinMaxWidth
-
fitReplacedElement
-
calcMinMaxCSSMinMaxWidth
private void calcMinMaxCSSMinMaxWidth(LayoutContext c, RectPropertySet margin, BorderPropertySet border, RectPropertySet padding) -
calcMinMaxWidthBlockChildren
-
calcMinMaxWidthInlineChildren
-
getMaxWidth
public int getMaxWidth() -
setMaxWidth
protected void setMaxWidth(int maxWidth) -
getMinWidth
public int getMinWidth() -
setMinWidth
protected void setMinWidth(int minWidth) -
styleText
-
styleText
-
calcChildPaintingInfo
- Overrides:
calcChildPaintingInfoin classBox
-
getFirstLetterStyle
-
setFirstLetterStyle
-
getFirstLineStyle
-
setFirstLineStyle
-
isMinMaxCalculated
protected boolean isMinMaxCalculated() -
setMinMaxCalculated
protected void setMinMaxCalculated(boolean minMaxCalculated) -
setDimensionsCalculated
protected void setDimensionsCalculated(boolean dimensionsCalculated) -
isDimensionsCalculated
private boolean isDimensionsCalculated() -
setNeedShrinkToFitCalculation
protected void setNeedShrinkToFitCalculation(boolean needShrinkToFitCalculation) -
isNeedShrinkToFitCalculation
private boolean isNeedShrinkToFitCalculation() -
initStaticPos
-
calcBaseline
-
calcInitialBreakAtLine
-
isCurrentBreakAtLineContext
-
calcBreakAtLineContext
-
calcInlineBaseline
-
findOffset
-
findLastNthLineBox
-
findLastLineBox
-
findLastLineBox
-
findFirstLineBox
-
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:
isInlineBlockin classBox
-
isInMainFlow
public boolean isInMainFlow() -
isContainsInlineContent
-
checkPageContext
-
isNeedsClipOnPaint
-
propagateExtraSpace
protected void propagateExtraSpace(LayoutContext c, ContentLimitContainer parentContainer, ContentLimitContainer currentContainer, int extraTop, int extraBottom)
-