diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderBlock.h')
| -rw-r--r-- | Source/WebCore/rendering/RenderBlock.h | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h index e3ed210de..24cce99b4 100644 --- a/Source/WebCore/rendering/RenderBlock.h +++ b/Source/WebCore/rendering/RenderBlock.h @@ -35,7 +35,7 @@ #include <wtf/ListHashSet.h> #if ENABLE(CSS_EXCLUSIONS) -#include "WrapShapeInfo.h" +#include "ExclusionShapeInsideInfo.h" #endif namespace WebCore { @@ -53,15 +53,17 @@ struct PaintInfo; class LineInfo; class RenderRubyRun; class TextLayout; +class WordMeasurement; template <class Iterator, class Run> class BidiResolver; template <class Run> class BidiRunList; template <class Iterator> struct MidpointState; typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver; typedef MidpointState<InlineIterator> LineMidpointState; -typedef WTF::ListHashSet<RenderBox*> TrackedRendererListHashSet; +typedef WTF::ListHashSet<RenderBox*, 16> TrackedRendererListHashSet; typedef WTF::HashMap<const RenderBlock*, TrackedRendererListHashSet*> TrackedDescendantsMap; typedef WTF::HashMap<const RenderBox*, HashSet<RenderBlock*>*> TrackedContainerMap; +typedef Vector<WordMeasurement, 64> WordMeasurements; enum CaretType { CursorCaret, DragCaret }; @@ -216,7 +218,7 @@ public: bool containsNonZeroBidiLevel() const; - GapRects selectionGapRectsForRepaint(RenderBoxModelObject* repaintContainer); + GapRects selectionGapRectsForRepaint(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, @@ -263,11 +265,25 @@ public: static void appendRunsForObject(BidiRunList<BidiRun>&, int start, int end, RenderObject*, InlineBidiResolver&); - static TextRun constructTextRun(RenderObject* context, const Font&, const String&, RenderStyle*, - TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, TextRunFlags = DefaultTextRunFlags); + static TextRun constructTextRun(RenderObject* context, const Font& font, const String& string, RenderStyle* style, + TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, TextRunFlags = DefaultTextRunFlags); - static TextRun constructTextRun(RenderObject* context, const Font&, const UChar*, int length, RenderStyle*, - TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion, TextRunFlags = DefaultTextRunFlags); + static TextRun constructTextRun(RenderObject* context, const Font& font, const RenderText* text, RenderStyle* style, + TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); + + static TextRun constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, unsigned length, RenderStyle* style, + TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); + + static TextRun constructTextRun(RenderObject* context, const Font& font, const RenderText* text, unsigned offset, RenderStyle* style, + TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); + +#if ENABLE(8BIT_TEXTRUN) + static TextRun constructTextRun(RenderObject* context, const Font& font, const LChar* characters, int length, RenderStyle* style, + TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); +#endif + + static TextRun constructTextRun(RenderObject* context, const Font& font, const UChar* characters, int length, RenderStyle* style, + TextRun::ExpansionBehavior = TextRun::AllowTrailingExpansion | TextRun::ForbidLeadingExpansion); ColumnInfo* columnInfo() const; int columnGap() const; @@ -402,9 +418,9 @@ public: #endif #if ENABLE(CSS_EXCLUSIONS) - WrapShapeInfo* wrapShapeInfo() const + ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const { - return style()->wrapShapeInside() && WrapShapeInfo::isWrapShapeInfoEnabledForRenderBlock(this) ? WrapShapeInfo::wrapShapeInfoForRenderBlock(this) : 0; + return style()->shapeInside() && ExclusionShapeInsideInfo::isExclusionShapeInsideInfoEnabledForRenderBlock(this) ? ExclusionShapeInsideInfo::exclusionShapeInsideInfoForRenderBlock(this) : 0; } #endif @@ -460,6 +476,8 @@ protected: static void startDelayUpdateScrollInfo(); static void finishDelayUpdateScrollInfo(); + void updateScrollInfoAfterLayout(); + virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle); virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); @@ -499,7 +517,7 @@ protected: private: #if ENABLE(CSS_EXCLUSIONS) void computeExclusionShapeSize(); - void updateWrapShapeInfoAfterStyleChange(const BasicShape*, const BasicShape* oldWrapShape); + void updateExclusionShapeInsideInfoAfterStyleChange(const BasicShape*, const BasicShape* oldWrapShape); #endif virtual RenderObjectChildList* virtualChildren() { return children(); } virtual const RenderObjectChildList* virtualChildren() const { return children(); } @@ -727,7 +745,7 @@ private: reset(); } - InlineIterator nextLineBreak(InlineBidiResolver&, LineInfo&, RenderTextInfo&, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines); + InlineIterator nextLineBreak(InlineBidiResolver&, LineInfo&, RenderTextInfo&, FloatingObject* lastFloatFromPreviousLine, unsigned consecutiveHyphenatedLines, WordMeasurements&); bool lineWasHyphenated() { return m_hyphenated; } const Vector<RenderBox*>& positionedObjects() { return m_positionedObjects; } @@ -755,7 +773,7 @@ private: void setMarginsForRubyRun(BidiRun*, RenderRubyRun*, RenderObject*, const LineInfo&); - void computeInlineDirectionPositionsForLine(RootInlineBox*, const LineInfo&, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&); + void computeInlineDirectionPositionsForLine(RootInlineBox*, const LineInfo&, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&, WordMeasurements&); void computeBlockDirectionPositionsForLine(RootInlineBox*, BidiRun*, GlyphOverflowAndFallbackFontsMap&, VerticalPositionCache&); void deleteEllipsisLineBoxes(); void checkLinesForTextOverflow(); @@ -809,14 +827,14 @@ private: // children. virtual RenderBlock* firstLineBlock() const; - virtual LayoutRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const; + virtual LayoutRect rectWithOutlineForRepaint(RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const OVERRIDE; virtual RenderStyle* outlineStyleForRepaint() const; virtual RenderObject* hoverAncestor() const; virtual void updateDragState(bool dragOn); virtual void childBecameNonInline(RenderObject* child); - virtual LayoutRect selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool /*clipToVisibleContent*/) + virtual LayoutRect selectionRectForRepaint(RenderLayerModelObject* repaintContainer, bool /*clipToVisibleContent*/) OVERRIDE { return selectionGapRectsForRepaint(repaintContainer); } @@ -858,8 +876,6 @@ private: bool expandsToEncloseOverhangingFloats() const; - void updateScrollInfoAfterLayout(); - void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock* middleBlock, RenderObject* beforeChild, RenderBoxModelObject* oldCont); void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox, @@ -963,7 +979,7 @@ private: // End helper functions and structs used by layoutBlockChildren. // Helper function for layoutInlineChildren() - RootInlineBox* createLineBoxesFromBidiRuns(BidiRunList<BidiRun>&, const InlineIterator& end, LineInfo&, VerticalPositionCache&, BidiRun* trailingSpaceRun); + 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); void linkToEndLineIfNeeded(LineLayoutState&); |
