struct BidiRun;
struct PaintInfo;
-class LineBreaker;
class LineInfo;
class RenderRubyRun;
#if ENABLE(CSS_SHAPES)
InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); }
InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); }
- void deleteLineBoxTree();
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
+ virtual void deleteLineBoxTree();
virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0) OVERRIDE;
virtual void removeChild(RenderObject*) OVERRIDE;
static void removePositionedObject(RenderBox*);
void removePositionedObjects(RenderBlock*, ContainingBlockState = SameContainingBlock);
- void removeFloatingObjects();
-
TrackedRendererListHashSet* positionedObjects() const;
bool hasPositionedObjects() const
{
bool generatesLineBoxesForInlineChild(RenderObject*);
- void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0, bool inLayout = true);
- void markSiblingsWithFloatsForLayout(RenderBox* floatToRemove = 0);
void markPositionedObjectsForLayout();
virtual void markForPaginationRelayoutIfNeeded() OVERRIDE FINAL;
- bool containsFloats() const { return m_floatingObjects && !m_floatingObjects->set().isEmpty(); }
- bool containsFloat(RenderBox*) const;
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all of the line layout code has been moved out of RenderBlock
+ virtual bool containsFloats() const { return false; }
// Versions that can compute line offsets with the region and page offset passed in. Used for speed to avoid having to
// compute the region all over again when you already know it.
{
return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline());
}
-
- static void appendRunsForObject(BidiRunList<BidiRun>&, int start, int end, RenderObject*, InlineBidiResolver&);
static TextRun constructTextRun(RenderObject* context, const Font&, const String&, const RenderStyle&,
TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, TextRunFlags = DefaultTextRunFlags);
void setDesiredColumnCountAndWidth(int, LayoutUnit);
public:
- void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false);
+ virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = false);
void clearLayoutOverflow();
protected:
virtual void addOverflowFromChildren();
- void addOverflowFromFloats();
void addOverflowFromPositionedObjects();
void addOverflowFromBlockChildren();
void addOverflowFromInlineChildren();
virtual void checkForPaginationLogicalHeightChange(LayoutUnit& pageLogicalHeight, bool& pageLogicalHeightChanged, bool& hasSpecifiedPageLogicalHeight);
private:
- LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode) const;
- LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedOffset, LayoutUnit* heightRemaining, LayoutUnit logicalHeight, ShapeOutsideFloatOffsetMode) const;
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
+ virtual LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit, LayoutUnit fixedOffset, LayoutUnit*, LayoutUnit, ShapeOutsideFloatOffsetMode) const { return fixedOffset; };
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
+ virtual LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit, LayoutUnit fixedOffset, LayoutUnit*, LayoutUnit, ShapeOutsideFloatOffsetMode) const { return fixedOffset; }
LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const;
LayoutUnit adjustLogicalLeftOffsetForLine(LayoutUnit offsetFromFloats, bool applyTextIndent) const;
void makeChildrenNonInline(RenderObject* insertionPoint = 0);
virtual void removeLeftoverAnonymousBlock(RenderBlock* child);
- void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveInsert);
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
+ virtual void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveInsert) { moveAllChildrenTo(toBlock, fullRemoveInsert); }
void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild);
virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild) OVERRIDE;
virtual bool isSelfCollapsingBlock() const OVERRIDE FINAL;
- virtual void repaintOverhangingFloats(bool paintAllDescendants) OVERRIDE FINAL;
-
- BidiRun* handleTrailingSpaces(BidiRunList<BidiRun>&, BidiContext*);
-
void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendantsMap*&, TrackedContainerMap*&);
static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDescendantsMap*&, TrackedContainerMap*&);
return child->y() + child->renderer().marginTop();
}
- LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit logicalTopOffset) const;
-
- void checkFloatsInCleanLine(RootInlineBox*, Vector<FloatWithRect>&, size_t& floatIndex, bool& encounteredNewFloat, bool& dirtiedByFloat);
- RootInlineBox* determineStartPosition(LineLayoutState&, InlineBidiResolver&);
- void determineEndPosition(LineLayoutState&, RootInlineBox* startBox, InlineIterator& cleanLineStart, BidiStatus& cleanLineBidiStatus);
- bool matchedEndLine(LineLayoutState&, const InlineBidiResolver&, const InlineIterator& endLineStart, const BidiStatus& endLineStatus);
- bool checkPaginationAndFloatsAtEndLine(LineLayoutState&);
-
- RootInlineBox* constructLine(BidiRunList<BidiRun>&, const LineInfo&);
- InlineFlowBox* createLineBoxes(RenderObject*, const LineInfo&, InlineBox* childBox, bool startsNewSegment);
-
- void setMarginsForRubyRun(BidiRun*, RenderRubyRun*, RenderObject*, const LineInfo&);
-
- BidiRun* computeInlineDirectionPositionsForSegment(RootInlineBox*, const LineInfo&, ETextAlign, float& logicalLeft,
- float& availableLogicalWidth, BidiRun* firstRun, BidiRun* trailingSpaceRun, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache&, WordMeasurements&);
- void computeInlineDirectionPositionsForLine(RootInlineBox*, const LineInfo&, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&, WordMeasurements&);
- void computeBlockDirectionPositionsForLine(RootInlineBox*, BidiRun*, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&);
- void deleteEllipsisLineBoxes();
- void checkLinesForTextOverflow();
-
- // Positions new floats and also adjust all floats encountered on the line if any of them
- // have to move to the next page/column.
- bool positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFloatFromPreviousLine, LineInfo&, LineWidth&);
- void appendFloatingObjectToLastLine(FloatingObject*);
-
- // End of functions defined in RenderBlockLineLayout.cpp.
-
- void paintFloats(PaintInfo&, const LayoutPoint&, bool preservePhase = false);
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
+ 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);
- FloatingObject* insertFloatingObject(RenderBox*);
- void removeFloatingObject(RenderBox*);
- void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset);
-
- // Called from lineWidth, to position the floats added in the last line.
- // Returns true if and only if it has positioned any floats.
- bool positionNewFloats();
-
- LayoutUnit getClearDelta(RenderBox* child, LayoutUnit yPos);
-
virtual bool avoidsFloats() const OVERRIDE;
- bool hasOverhangingFloats() { return parent() && !hasColumns() && containsFloats() && lowestFloatLogicalBottom() > logicalHeight(); }
- bool hasOverhangingFloat(RenderBox*);
- void addIntrudingFloats(RenderBlock* prev, LayoutUnit xoffset, LayoutUnit yoffset);
- LayoutUnit addOverhangingFloats(RenderBlock* child, bool makeChildPaintOtherFloats);
-
- LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::FloatLeftRight) const;
- LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMode = ShapeOutsideFloatMarginBoxOffset) const;
-
bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
virtual bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction);
- bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset);
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
+ virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&) { return false; }
virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset);
LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&);
LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches&);
+ // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to RenderBlockFlow
+ virtual void clipOutFloatingObjects(RenderBlock*, const PaintInfo*, const LayoutPoint&, const LayoutSize&) { };
friend class LogicalSelectionOffsetCaches;
virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const OVERRIDE;
void adjustPointToColumnContents(LayoutPoint&) const;
void fitBorderToLinesIfNeeded(); // Shrink the box in which the border paints if border-fit is set.
- void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const; // Helper function for borderFitAdjust
+ virtual void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const; // Helper function for borderFitAdjust
void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBottom, RootInlineBox* highest = 0);
- void newLine(EClear);
-
Position positionForBox(InlineBox*, bool start = true) const;
VisiblePosition positionForPointWithInlineChildren(const LayoutPoint&);
void moveRunInUnderSiblingBlockIfNeeded(RenderObject* runIn);
void moveRunInToOriginalPosition(RenderObject* runIn);
- // Helper function for layoutInlineChildren()
- RootInlineBox* createLineBoxesFromBidiRuns(BidiRunList<BidiRun>&, const InlineIterator& end, LineInfo&, VerticalPositionCache&, BidiRun* trailingSpaceRun, WordMeasurements&);
- void layoutRunsAndFloats(LineLayoutState&, bool hasInlineChild);
- void layoutRunsAndFloatsInRange(LineLayoutState&, InlineBidiResolver&, const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiStatus, unsigned consecutiveHyphenatedLines);
-#if ENABLE(CSS_SHAPES)
- void updateShapeAndSegmentsForCurrentLine(ShapeInsideInfo*&, const LayoutSize&, LineLayoutState&);
- void updateShapeAndSegmentsForCurrentLineInFlowThread(ShapeInsideInfo*&, LineLayoutState&);
- bool adjustLogicalLineTopAndLogicalHeightIfNeeded(ShapeInsideInfo*, LayoutUnit, LineLayoutState&, InlineBidiResolver&, FloatingObject*, InlineIterator&, WordMeasurements&);
-#endif
- const InlineIterator& restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogicalHeight, LayoutUnit newLogicalHeight, FloatingObject* lastFloatFromPreviousLine, InlineBidiResolver&, const InlineIterator&);
- void linkToEndLineIfNeeded(LineLayoutState&);
- static void repaintDirtyFloats(Vector<FloatWithRect>& floats);
-
protected:
void dirtyForLayoutFromPercentageHeightDescendants();
// FIXME: This is temporary to allow us to move code from RenderBlock into RenderBlockFlow that accesses member variables that we haven't moved out of
// RenderBlock yet.
friend class RenderBlockFlow;
-
-protected:
- void createFloatingObjects();
+ // FIXME-BLOCKFLOW: Remove this when the line layout stuff has all moved out of RenderBlock
+ friend class LineBreaker;
public:
// Allocated only when some of these fields have non-default values
protected:
- OwnPtr<FloatingObjects> m_floatingObjects;
OwnPtr<RenderBlockRareData> m_rareData;
RenderLineBoxList m_lineBoxes; // All of the root line boxes created for this block flow. For example, <div>Hello<br>world.</div> will have two total lines for the <div>.
// RenderRubyBase objects need to be able to split and merge, moving their children around
// (calling moveChildTo, moveAllChildrenTo, and makeChildrenNonInline).
friend class RenderRubyBase;
- friend class LineBreaker;
- friend class LineWidth; // Needs to know FloatingObject
private:
// Used to store state between styleWillChange and styleDidChange