#ifndef RenderBlock_h
#define RenderBlock_h
#include "core/rendering/ColumnInfo.h"
#include "core/rendering/FloatingObjects.h"
#include "core/rendering/GapRects.h"
#include "core/rendering/RenderBox.h"
#include "core/rendering/RenderLineBoxList.h"
#include "core/rendering/RootInlineBox.h"
#include "core/rendering/style/ShapeValue.h"
#include "platform/text/TextBreakIterator.h"
#include "platform/text/TextRun.h"
#include "wtf/ListHashSet.h"
#include "wtf/OwnPtr.h"
namespace WebCore {
class BasicShape;
class BidiContext;
class LayoutStateMaintainer;
class LineLayoutState;
class RenderInline;
class RenderRegion;
class RenderText;
struct BidiRun;
struct PaintInfo;
class LineInfo;
class RenderRubyRun;
class WordMeasurement;
template <class Run> class BidiRunList;
typedef WTF::ListHashSet<RenderBox*, 16> TrackedRendererListHashSet;
typedef WTF::HashMap<const RenderBlock*, OwnPtr<TrackedRendererListHashSet> > TrackedDescendantsMap;
typedef WTF::HashMap<const RenderBox*, OwnPtr<HashSet<RenderBlock*> > > TrackedContainerMap;
typedef Vector<WordMeasurement, 64> WordMeasurements;
enum CaretType { CursorCaret, DragCaret };
enum ContainingBlockState { NewContainingBlock, SameContainingBlock };
enum TextRunFlag {
DefaultTextRunFlags = 0,
RespectDirection = 1 << 0,
RespectDirectionOverride = 1 << 1
};
typedef unsigned TextRunFlags;
class RenderBlock : public RenderBox {
public:
friend class LineLayoutState;
protected:
explicit RenderBlock(ContainerNode*);
virtual ~RenderBlock();
public:
RenderObject* firstChild() const { ASSERT(children() == virtualChildren()); return children()->firstChild(); }
RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); return children()->lastChild(); }
const RenderObjectChildList* children() const { return &m_children; }
RenderObjectChildList* children() { return &m_children; }
bool beingDestroyed() const { return m_beingDestroyed; }
virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE FINAL;
virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const OVERRIDE;
LayoutUnit minLineHeightForReplacedRenderer(bool isFirstLine, LayoutUnit replacedHeight) const;
RenderLineBoxList* lineBoxes() { return &m_lineBoxes; }
InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); }
InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); }
virtual void deleteLineBoxTree();
virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE;
virtual void removeChild(RenderObject*) OVERRIDE;
virtual void layoutBlock(bool relayoutChildren);
void insertPositionedObject(RenderBox*);
static void removePositionedObject(RenderBox*);
void removePositionedObjects(RenderBlock*, ContainingBlockState = SameContainingBlock);
TrackedRendererListHashSet* positionedObjects() const;
bool hasPositionedObjects() const
{
TrackedRendererListHashSet* objects = positionedObjects();
return objects && !objects->isEmpty();
}
virtual bool visibleForTouchAction() const OVERRIDE FINAL { return true; }
void addPercentHeightDescendant(RenderBox*);
static void removePercentHeightDescendant(RenderBox*);
static bool hasPercentHeightContainerMap();
static bool hasPercentHeightDescendant(RenderBox*);
static void clearPercentHeightDescendantsFrom(RenderBox*);
static void removePercentHeightDescendantIfNeeded(RenderBox*);
TrackedRendererListHashSet* percentHeightDescendants() const;
bool hasPercentHeightDescendants() const
{
TrackedRendererListHashSet* descendants = percentHeightDescendants();
return descendants && !descendants->isEmpty();
}
void setHasMarkupTruncation(bool b) { m_hasMarkupTruncation = b; }
bool hasMarkupTruncation() const { return m_hasMarkupTruncation; }
void setHasMarginBeforeQuirk(bool b) { m_hasMarginBeforeQuirk = b; }
void setHasMarginAfterQuirk(bool b) { m_hasMarginAfterQuirk = b; }
bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; }
bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; }
bool hasMarginBeforeQuirk(const RenderBox* child) const;
bool hasMarginAfterQuirk(const RenderBox* child) const;
void markPositionedObjectsForLayout();
virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&) OVERRIDE FINAL;
virtual bool containsFloats() const { return false; }
LayoutUnit textIndentOffset() const;
virtual PositionWithAffinity positionForPoint(const LayoutPoint&) OVERRIDE;
virtual LayoutUnit availableLogicalWidth() const OVERRIDE FINAL;
LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const;
void adjustStartEdgeForWritingModeIncludingColumns(LayoutRect&) const;
LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const;
LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const;
RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(firstLineBox()); }
RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(lastLineBox()); }
GapRects selectionGapRectsForRepaint(const RenderLayerModelObject* repaintContainer);
LayoutRect logicalLeftSelectionGap(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
RenderObject* selObj, LayoutUnit logicalLeft, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*);
LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
RenderObject* selObj, LayoutUnit logicalRight, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*);
void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap);
RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const;
LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, const LayoutRect& logicalRect);
RootInlineBox* lineAtIndex(int) const;
int lineCount(const RootInlineBox* = 0, bool* = 0) const;
int heightForLineCount(int);
void clearTruncation();
void adjustRectForColumns(LayoutRect&) const;
virtual void adjustForColumns(LayoutSize&, const LayoutPoint&) const OVERRIDE FINAL;
void adjustForColumnRect(LayoutSize& offset, const LayoutPoint& locationInContainer) const;
void addContinuationWithOutline(RenderInline*);
bool paintsContinuationOutline(RenderInline*);
virtual RenderBoxModelObject* virtualContinuation() const OVERRIDE FINAL { return continuation(); }
bool isAnonymousBlockContinuation() const { return continuation() && isAnonymousBlock(); }
RenderInline* inlineElementContinuation() const;
RenderBlock* blockElementContinuation() const;
using RenderBoxModelObject::continuation;
using RenderBoxModelObject::setContinuation;
static RenderBlock* createAnonymousWithParentRendererAndDisplay(const RenderObject*, EDisplay = BLOCK);
static RenderBlockFlow* createAnonymousColumnsWithParentRenderer(const RenderObject*);
static RenderBlockFlow* createAnonymousColumnSpanWithParentRenderer(const RenderObject*);
RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return createAnonymousWithParentRendererAndDisplay(this, display); }
RenderBlockFlow* createAnonymousColumnsBlock() const { return createAnonymousColumnsWithParentRenderer(this); }
RenderBlockFlow* createAnonymousColumnSpanBlock() const { return createAnonymousColumnSpanWithParentRenderer(this); }
virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* parent) const OVERRIDE;
ColumnInfo* columnInfo() const;
int columnGap() const;
unsigned columnCount(ColumnInfo*) const;
LayoutRect columnRectAt(ColumnInfo*, unsigned) const;
LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : LayoutUnit(); }
void setPaginationStrut(LayoutUnit);
bool shouldBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m_lineBreakToAvoidWidow >= 0; }
void clearShouldBreakAtLineToAvoidWidow() const;
int lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBreakToAvoidWidow : -1; }
void setBreakAtLineToAvoidWidow(int);
void clearDidBreakAtLineToAvoidWidow();
void setDidBreakAtLineToAvoidWidow();
bool didBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m_didBreakAtLineToAvoidWidow; }
LayoutUnit pageLogicalOffset() const { return m_rareData ? m_rareData->m_pageLogicalOffset : LayoutUnit(); }
void setPageLogicalOffset(LayoutUnit);
LayoutUnit logicalWidthForChild(const RenderBox* child) const { return isHorizontalWritingMode() ? child->width() : child->height(); }
LayoutUnit logicalHeightForChild(const RenderBox* child) const { return isHorizontalWritingMode() ? child->height() : child->width(); }
LayoutSize logicalSizeForChild(const RenderBox* child) const { return isHorizontalWritingMode() ? child->size() : child->size().transposedSize(); }
LayoutUnit logicalTopForChild(const RenderBox* child) const { return isHorizontalWritingMode() ? child->y() : child->x(); }
LayoutUnit marginBeforeForChild(const RenderBoxModelObject* child) const { return child->marginBefore(style()); }
LayoutUnit marginAfterForChild(const RenderBoxModelObject* child) const { return child->marginAfter(style()); }
LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { return child->marginStart(style()); }
LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { return child->marginEnd(style()); }
void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { child->setMarginStart(value, style()); }
void setMarginEndForChild(RenderBox* child, LayoutUnit value) const { child->setMarginEnd(value, style()); }
void setMarginBeforeForChild(RenderBox* child, LayoutUnit value) const { child->setMarginBefore(value, style()); }
void setMarginAfterForChild(RenderBox* child, LayoutUnit value) const { child->setMarginAfter(value, style()); }
LayoutUnit collapsedMarginBeforeForChild(const RenderBox* child) const;
LayoutUnit collapsedMarginAfterForChild(const RenderBox* child) const;
virtual void updateFirstLetter();
virtual void scrollbarsChanged(bool , bool ) { };
LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>(0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); }
LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingMode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); }
LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetForContent() + availableLogicalWidth(); }
LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDirection() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForContent(); }
LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirection() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForContent(); }
#ifndef NDEBUG
void checkPositionedObjectsNeedLayout();
void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, const InlineBox* = 0, const char* = 0, const RenderObject* = 0) const;
#endif
LayoutSize logicalOffsetFromShapeAncestorContainer(const RenderBlock* container) const;
static void paintAsInlineBlock(RenderObject*, PaintInfo&, const LayoutPoint&);
protected:
virtual void willBeDestroyed() OVERRIDE;
void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&);
virtual void layout() OVERRIDE;
virtual bool updateImageLoadingPriorities() OVERRIDE FINAL;
enum PositionedLayoutBehavior {
DefaultLayout,
LayoutOnlyFixedPositionedObjects,
ForcedLayoutAfterContainingBlockMoved
};
void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior = DefaultLayout);
void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLayoutScope&);
LayoutUnit marginIntrinsicLogicalWidthForChild(RenderBox* child) const;
int beforeMarginInLineDirection(LineDirectionMode) const;
virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE;
virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE;
virtual void paintChildren(PaintInfo&, const LayoutPoint&);
void paintChild(RenderBox*, PaintInfo&, const LayoutPoint&);
void paintChildAsInlineBlock(RenderBox*, PaintInfo&, const LayoutPoint&);
virtual void adjustInlineDirectionLineBounds(int , float& , float& ) const { }
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;
virtual void computePreferredLogicalWidths() OVERRIDE;
void adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const;
virtual int firstLineBoxBaseline() const OVERRIDE;
virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE;
int lastLineBoxBaseline(LineDirectionMode) const;
virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) OVERRIDE;
static void startDelayUpdateScrollInfo();
static void finishDelayUpdateScrollInfo();
void updateScrollInfoAfterLayout();
virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) OVERRIDE;
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
virtual bool hasLineIfEmpty() const;
bool simplifiedLayout();
virtual void simplifiedNormalFlowLayout();
void setDesiredColumnCountAndWidth(int, LayoutUnit);
public:
virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false);
protected:
virtual void addOverflowFromChildren();
void addOverflowFromPositionedObjects();
void addOverflowFromBlockChildren();
void addVisualOverflowFromTheme();
virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE;
virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOffset) const OVERRIDE;
void computeRegionRangeForBlock(RenderFlowThread*);
void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox*);
virtual bool isInlineBlockOrInlineTable() const OVERRIDE FINAL { return isInline() && isReplaced(); }
private:
virtual RenderObjectChildList* virtualChildren() OVERRIDE FINAL { return children(); }
virtual const RenderObjectChildList* virtualChildren() const OVERRIDE FINAL { return children(); }
virtual const char* renderName() const OVERRIDE;
virtual bool isRenderBlock() const OVERRIDE FINAL { return true; }
void makeChildrenNonInline(RenderObject* insertionPoint = 0);
virtual void removeLeftoverAnonymousBlock(RenderBlock* child);
static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* child);
virtual void dirtyLinesFromChangedChild(RenderObject* child) OVERRIDE FINAL { m_lineBoxes.dirtyLinesFromChangedChild(this, child); }
void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild);
virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild) OVERRIDE;
void addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild);
void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild = 0);
virtual bool isSelfCollapsingBlock() const OVERRIDE;
void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendantsMap*&, TrackedContainerMap*&);
static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDescendantsMap*&, TrackedContainerMap*&);
void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderObject* currentChild, unsigned length);
void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* firstLetterContainer);
Node* nodeForHitTest() const;
virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { }
void paintContents(PaintInfo&, const LayoutPoint&);
void paintColumnContents(PaintInfo&, const LayoutPoint&, bool paintFloats = false);
void paintColumnRules(PaintInfo&, const LayoutPoint&);
void paintSelection(PaintInfo&, const LayoutPoint&);
void paintCaret(PaintInfo&, const LayoutPoint&, CaretType);
bool hasCaret() const { return hasCaret(CursorCaret) || hasCaret(DragCaret); }
bool hasCaret(CaretType) const;
virtual bool avoidsFloats() const OVERRIDE;
bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&) { return false; }
virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset);
void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const;
virtual RenderBlock* firstLineBlock() const OVERRIDE;
virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const OVERRIDE FINAL;
virtual RenderStyle* outlineStyleForRepaint() const OVERRIDE FINAL;
virtual RenderObject* hoverAncestor() const OVERRIDE FINAL;
virtual void updateDragState(bool dragOn) OVERRIDE FINAL;
virtual void childBecameNonInline(RenderObject* child) OVERRIDE FINAL;
virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool ) OVERRIDE FINAL
{
return selectionGapRectsForRepaint(repaintContainer);
}
virtual bool shouldPaintSelectionGaps() const OVERRIDE FINAL;
bool isSelectionRoot() const;
GapRects selectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const PaintInfo* = 0);
GapRects blockSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& lastLogicalRight, const PaintInfo*);
LayoutRect blockSelectionGap(RenderBlock* rootBlock, const LayoutPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock,
LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const PaintInfo*);
virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position);
virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position);
virtual void clipOutFloatingObjects(RenderBlock*, const PaintInfo*, const LayoutPoint&, const LayoutSize&) { };
virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const OVERRIDE;
virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRIDE;
LayoutUnit desiredColumnWidth() const;
void paintContinuationOutlines(PaintInfo&, const LayoutPoint&);
virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0) OVERRIDE FINAL;
void adjustPointToColumnContents(LayoutPoint&) const;
void fitBorderToLinesIfNeeded();
virtual void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const;
void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBottom, RootInlineBox* highest = 0);
Position positionForBox(InlineBox*, bool start = true) const;
PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&);
void calcColumnWidth();
void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlockFlow* newBlockBox, RenderObject* newChild);
void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock,
RenderObject* beforeChild, RenderBoxModelObject* oldCont);
void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
RenderObject* newChild, RenderBoxModelObject* oldCont);
RenderBlock* clone() const;
RenderBlock* continuationBefore(RenderObject* beforeChild);
RenderBlockFlow* containingColumnsBlock(bool allowAnonymousColumnBlock = true);
RenderBlockFlow* columnsBlockForSpanningElement(RenderObject* newChild);
protected:
enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary };
LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
bool createsBlockFormattingContext() const;
public:
LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const;
LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const;
LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule = IncludePageBoundary) const;
protected:
bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const;
void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage);
void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight);
LayoutUnit adjustForUnsplittableChild(RenderBox* child, LayoutUnit logicalOffset, bool includeMargins = false);
void adjustLinePositionForPagination(RootInlineBox*, LayoutUnit& deltaOffset, RenderFlowThread*);
void offsetForContents(LayoutPoint&) const;
bool requiresColumns(int desiredColumnCount) const;
virtual bool updateLogicalWidthAndColumnWidth();
virtual bool canCollapseAnonymousBlockChild() const { return true; }
public:
virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const OVERRIDE FINAL;
RenderRegion* regionAtBlockOffset(LayoutUnit) const;
void invalidateLineHeight() { m_lineHeight = -1; }
public:
struct RenderBlockRareData {
WTF_MAKE_NONCOPYABLE(RenderBlockRareData); WTF_MAKE_FAST_ALLOCATED;
public:
RenderBlockRareData()
: m_paginationStrut(0)
, m_pageLogicalOffset(0)
, m_lineBreakToAvoidWidow(-1)
, m_didBreakAtLineToAvoidWidow(false)
{
}
LayoutUnit m_paginationStrut;
LayoutUnit m_pageLogicalOffset;
int m_lineBreakToAvoidWidow : 31;
unsigned m_didBreakAtLineToAvoidWidow : 1;
};
protected:
OwnPtr<RenderBlockRareData> m_rareData;
RenderObjectChildList m_children;
RenderLineBoxList m_lineBoxes;
mutable signed m_lineHeight : 26;
unsigned m_hasMarginBeforeQuirk : 1;
unsigned m_hasMarginAfterQuirk : 1;
unsigned m_beingDestroyed : 1;
unsigned m_hasMarkupTruncation : 1;
unsigned m_hasBorderOrPaddingLogicalWidthChanged : 1;
mutable unsigned m_hasOnlySelfCollapsingChildren : 1;
friend class RenderRubyBase;
friend class LineBreaker;
friend class RenderBlockFlow;
};
DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock());
}
#endif