OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 typedef Vector<WordMeasurement, 64> WordMeasurements; | 52 typedef Vector<WordMeasurement, 64> WordMeasurements; |
53 | 53 |
54 enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; | 54 enum ContainingBlockState { NewContainingBlock, SameContainingBlock }; |
55 | 55 |
56 typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*> > > Continu
ationOutlineTableMap; | 56 typedef WTF::HashMap<RenderBlock*, OwnPtr<ListHashSet<RenderInline*> > > Continu
ationOutlineTableMap; |
57 | 57 |
58 ContinuationOutlineTableMap* continuationOutlineTable(); | 58 ContinuationOutlineTableMap* continuationOutlineTable(); |
59 | 59 |
60 class RenderBlock : public RenderBox { | 60 class RenderBlock : public RenderBox { |
61 public: | 61 public: |
62 virtual void destroy() OVERRIDE; | 62 virtual void destroy() override; |
63 virtual void trace(Visitor*) OVERRIDE; | 63 virtual void trace(Visitor*) override; |
64 friend class LineLayoutState; | 64 friend class LineLayoutState; |
65 | 65 |
66 protected: | 66 protected: |
67 explicit RenderBlock(ContainerNode*); | 67 explicit RenderBlock(ContainerNode*); |
68 virtual ~RenderBlock(); | 68 virtual ~RenderBlock(); |
69 | 69 |
70 public: | 70 public: |
71 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 71 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
72 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | 72 RenderObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } |
73 | 73 |
74 // If you have a RenderBlock, use firstChild or lastChild instead. | 74 // If you have a RenderBlock, use firstChild or lastChild instead. |
75 void slowFirstChild() const WTF_DELETED_FUNCTION; | 75 void slowFirstChild() const WTF_DELETED_FUNCTION; |
76 void slowLastChild() const WTF_DELETED_FUNCTION; | 76 void slowLastChild() const WTF_DELETED_FUNCTION; |
77 | 77 |
78 const RenderObjectChildList* children() const { return &m_children; } | 78 const RenderObjectChildList* children() const { return &m_children; } |
79 RenderObjectChildList* children() { return &m_children; } | 79 RenderObjectChildList* children() { return &m_children; } |
80 | 80 |
81 bool beingDestroyed() const { return m_beingDestroyed; } | 81 bool beingDestroyed() const { return m_beingDestroyed; } |
82 | 82 |
83 // These two functions are overridden for inline-block. | 83 // These two functions are overridden for inline-block. |
84 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const OVERRIDE FINAL; | 84 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const override final; |
85 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const OVERRIDE; | 85 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const override; |
86 | 86 |
87 LayoutUnit minLineHeightForReplacedRenderer(bool isFirstLine, LayoutUnit rep
lacedHeight) const; | 87 LayoutUnit minLineHeightForReplacedRenderer(bool isFirstLine, LayoutUnit rep
lacedHeight) const; |
88 | 88 |
89 RenderLineBoxList* lineBoxes() { return &m_lineBoxes; } | 89 RenderLineBoxList* lineBoxes() { return &m_lineBoxes; } |
90 | 90 |
91 protected: | 91 protected: |
92 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } | 92 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } |
93 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } | 93 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } |
94 | 94 |
95 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } | 95 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } |
96 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } | 96 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } |
97 | 97 |
98 public: | 98 public: |
99 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow | 99 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow |
100 virtual void deleteLineBoxTree(); | 100 virtual void deleteLineBoxTree(); |
101 | 101 |
102 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
OVERRIDE; | 102 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
override; |
103 virtual void removeChild(RenderObject*) OVERRIDE; | 103 virtual void removeChild(RenderObject*) override; |
104 | 104 |
105 virtual void layoutBlock(bool relayoutChildren); | 105 virtual void layoutBlock(bool relayoutChildren); |
106 | 106 |
107 void insertPositionedObject(RenderBox*); | 107 void insertPositionedObject(RenderBox*); |
108 static void removePositionedObject(RenderBox*); | 108 static void removePositionedObject(RenderBox*); |
109 void removePositionedObjects(RenderBlock*, ContainingBlockState = SameContai
ningBlock); | 109 void removePositionedObjects(RenderBlock*, ContainingBlockState = SameContai
ningBlock); |
110 | 110 |
111 TrackedRendererListHashSet* positionedObjects() const; | 111 TrackedRendererListHashSet* positionedObjects() const; |
112 bool hasPositionedObjects() const | 112 bool hasPositionedObjects() const |
113 { | 113 { |
(...skipping 23 matching lines...) Expand all Loading... |
137 | 137 |
138 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } | 138 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } |
139 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } | 139 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } |
140 | 140 |
141 bool hasMarginBeforeQuirk(const RenderBox* child) const; | 141 bool hasMarginBeforeQuirk(const RenderBox* child) const; |
142 bool hasMarginAfterQuirk(const RenderBox* child) const; | 142 bool hasMarginAfterQuirk(const RenderBox* child) const; |
143 | 143 |
144 void markPositionedObjectsForLayout(); | 144 void markPositionedObjectsForLayout(); |
145 // FIXME: Do we really need this to be virtual? It's just so we can call thi
s on | 145 // FIXME: Do we really need this to be virtual? It's just so we can call thi
s on |
146 // RenderBoxes without needed to check whether they're RenderBlocks first. | 146 // RenderBoxes without needed to check whether they're RenderBlocks first. |
147 virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&) OVERRIDE
FINAL; | 147 virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&) override
final; |
148 | 148 |
149 LayoutUnit textIndentOffset() const; | 149 LayoutUnit textIndentOffset() const; |
150 | 150 |
151 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) OVERRIDE; | 151 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override; |
152 | 152 |
153 // Block flows subclass availableWidth to handle multi column layout (shrink
ing the width available to children when laying out.) | 153 // Block flows subclass availableWidth to handle multi column layout (shrink
ing the width available to children when laying out.) |
154 virtual LayoutUnit availableLogicalWidth() const OVERRIDE FINAL; | 154 virtual LayoutUnit availableLogicalWidth() const override final; |
155 | 155 |
156 LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const; | 156 LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const; |
157 void adjustStartEdgeForWritingModeIncludingColumns(LayoutRect&) const; | 157 void adjustStartEdgeForWritingModeIncludingColumns(LayoutRect&) const; |
158 | 158 |
159 LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const; | 159 LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const; |
160 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; | 160 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; |
161 | 161 |
162 virtual bool shouldPaintSelectionGaps() const OVERRIDE FINAL; | 162 virtual bool shouldPaintSelectionGaps() const override final; |
163 GapRects selectionGapRectsForPaintInvalidation(const RenderLayerModelObject*
paintInvalidationContainer) const; | 163 GapRects selectionGapRectsForPaintInvalidation(const RenderLayerModelObject*
paintInvalidationContainer) const; |
164 LayoutRect logicalLeftSelectionGap(const RenderBlock* rootBlock, const Layou
tPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 164 LayoutRect logicalLeftSelectionGap(const RenderBlock* rootBlock, const Layou
tPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
165 const RenderObject* selObj, LayoutUnit lo
gicalLeft, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*) co
nst; | 165 const RenderObject* selObj, LayoutUnit lo
gicalLeft, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*) co
nst; |
166 LayoutRect logicalRightSelectionGap(const RenderBlock* rootBlock, const Layo
utPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 166 LayoutRect logicalRightSelectionGap(const RenderBlock* rootBlock, const Layo
utPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
167 const RenderObject* selObj, LayoutUnit l
ogicalRight, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*)
const; | 167 const RenderObject* selObj, LayoutUnit l
ogicalRight, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*)
const; |
168 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap) cons
t; | 168 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap) cons
t; |
169 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; | 169 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; |
170 | 170 |
171 virtual void setSelectionState(SelectionState) OVERRIDE; | 171 virtual void setSelectionState(SelectionState) override; |
172 | 172 |
173 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; | 173 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; |
174 | 174 |
175 // Helper methods for computing line counts and heights for line counts. | 175 // Helper methods for computing line counts and heights for line counts. |
176 RootInlineBox* lineAtIndex(int) const; | 176 RootInlineBox* lineAtIndex(int) const; |
177 int lineCount(const RootInlineBox* = 0, bool* = 0) const; | 177 int lineCount(const RootInlineBox* = 0, bool* = 0) const; |
178 int heightForLineCount(int); | 178 int heightForLineCount(int); |
179 void clearTruncation(); | 179 void clearTruncation(); |
180 | 180 |
181 void adjustRectForColumns(LayoutRect&) const; | 181 void adjustRectForColumns(LayoutRect&) const; |
182 virtual LayoutSize columnOffset(const LayoutPoint&) const OVERRIDE; | 182 virtual LayoutSize columnOffset(const LayoutPoint&) const override; |
183 void adjustForColumnRect(LayoutSize& offset, const LayoutPoint& locationInCo
ntainer) const; | 183 void adjustForColumnRect(LayoutSize& offset, const LayoutPoint& locationInCo
ntainer) const; |
184 | 184 |
185 void addContinuationWithOutline(RenderInline*); | 185 void addContinuationWithOutline(RenderInline*); |
186 | 186 |
187 virtual RenderBoxModelObject* virtualContinuation() const OVERRIDE FINAL { r
eturn continuation(); } | 187 virtual RenderBoxModelObject* virtualContinuation() const override final { r
eturn continuation(); } |
188 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } | 188 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } |
189 RenderInline* inlineElementContinuation() const; | 189 RenderInline* inlineElementContinuation() const; |
190 RenderBlock* blockElementContinuation() const; | 190 RenderBlock* blockElementContinuation() const; |
191 | 191 |
192 using RenderBoxModelObject::continuation; | 192 using RenderBoxModelObject::continuation; |
193 using RenderBoxModelObject::setContinuation; | 193 using RenderBoxModelObject::setContinuation; |
194 | 194 |
195 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render
Object*, EDisplay = BLOCK); | 195 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render
Object*, EDisplay = BLOCK); |
196 static RenderBlockFlow* createAnonymousColumnsWithParentRenderer(const Rende
rObject*); | 196 static RenderBlockFlow* createAnonymousColumnsWithParentRenderer(const Rende
rObject*); |
197 static RenderBlockFlow* createAnonymousColumnSpanWithParentRenderer(const Re
nderObject*); | 197 static RenderBlockFlow* createAnonymousColumnSpanWithParentRenderer(const Re
nderObject*); |
198 RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentRendererAndDisplay(this, display); } | 198 RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentRendererAndDisplay(this, display); } |
199 RenderBlockFlow* createAnonymousColumnsBlock() const { return createAnonymou
sColumnsWithParentRenderer(this); } | 199 RenderBlockFlow* createAnonymousColumnsBlock() const { return createAnonymou
sColumnsWithParentRenderer(this); } |
200 RenderBlockFlow* createAnonymousColumnSpanBlock() const { return createAnony
mousColumnSpanWithParentRenderer(this); } | 200 RenderBlockFlow* createAnonymousColumnSpanBlock() const { return createAnony
mousColumnSpanWithParentRenderer(this); } |
201 | 201 |
202 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare
nt) const OVERRIDE; | 202 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare
nt) const override; |
203 | 203 |
204 ColumnInfo* columnInfo() const; | 204 ColumnInfo* columnInfo() const; |
205 int columnGap() const; | 205 int columnGap() const; |
206 | 206 |
207 // These two functions take the ColumnInfo* to avoid repeated lookups of the
info in the global HashMap. | 207 // These two functions take the ColumnInfo* to avoid repeated lookups of the
info in the global HashMap. |
208 unsigned columnCount(ColumnInfo*) const; | 208 unsigned columnCount(ColumnInfo*) const; |
209 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; | 209 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; |
210 | 210 |
211 // The page logical offset is the object's offset from the top of the page i
n the page progression | 211 // The page logical offset is the object's offset from the top of the page i
n the page progression |
212 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). | 212 // direction (so an x-offset in vertical text and a y-offset for horizontal
text). |
(...skipping 10 matching lines...) Expand all Loading... |
223 LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { re
turn child->marginStart(style()); } | 223 LayoutUnit marginStartForChild(const RenderBoxModelObject* child) const { re
turn child->marginStart(style()); } |
224 LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { retu
rn child->marginEnd(style()); } | 224 LayoutUnit marginEndForChild(const RenderBoxModelObject* child) const { retu
rn child->marginEnd(style()); } |
225 void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { chil
d->setMarginStart(value, style()); } | 225 void setMarginStartForChild(RenderBox* child, LayoutUnit value) const { chil
d->setMarginStart(value, style()); } |
226 void setMarginEndForChild(RenderBox* child, LayoutUnit value) const { child-
>setMarginEnd(value, style()); } | 226 void setMarginEndForChild(RenderBox* child, LayoutUnit value) const { child-
>setMarginEnd(value, style()); } |
227 void setMarginBeforeForChild(RenderBox* child, LayoutUnit value) const { chi
ld->setMarginBefore(value, style()); } | 227 void setMarginBeforeForChild(RenderBox* child, LayoutUnit value) const { chi
ld->setMarginBefore(value, style()); } |
228 void setMarginAfterForChild(RenderBox* child, LayoutUnit value) const { chil
d->setMarginAfter(value, style()); } | 228 void setMarginAfterForChild(RenderBox* child, LayoutUnit value) const { chil
d->setMarginAfter(value, style()); } |
229 LayoutUnit collapsedMarginBeforeForChild(const RenderBox* child) const; | 229 LayoutUnit collapsedMarginBeforeForChild(const RenderBox* child) const; |
230 LayoutUnit collapsedMarginAfterForChild(const RenderBox* child) const; | 230 LayoutUnit collapsedMarginAfterForChild(const RenderBox* child) const; |
231 | 231 |
232 virtual void updateFirstLetter(); | 232 virtual void updateFirstLetter(); |
233 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; | 233 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override; |
234 | 234 |
235 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v
erticalScrollbarChanged*/) { } | 235 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v
erticalScrollbarChanged*/) { } |
236 | 236 |
237 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>(
0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); } | 237 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>(
0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); } |
238 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM
ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } | 238 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM
ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } |
239 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo
rContent() + availableLogicalWidth(); } | 239 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo
rContent() + availableLogicalWidth(); } |
240 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire
ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor
Content(); } | 240 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire
ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor
Content(); } |
241 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } | 241 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } |
242 | 242 |
243 virtual LayoutUnit logicalLeftSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const; | 243 virtual LayoutUnit logicalLeftSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const; |
244 virtual LayoutUnit logicalRightSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const; | 244 virtual LayoutUnit logicalRightSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const; |
245 | 245 |
246 GapRects selectionGaps(const RenderBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 246 GapRects selectionGaps(const RenderBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
247 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo* = 0) const; | 247 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo* = 0) const; |
248 | 248 |
249 #if ENABLE(ASSERT) | 249 #if ENABLE(ASSERT) |
250 void checkPositionedObjectsNeedLayout(); | 250 void checkPositionedObjectsNeedLayout(); |
251 bool paintsContinuationOutline(RenderInline* flow); | 251 bool paintsContinuationOutline(RenderInline* flow); |
252 #endif | 252 #endif |
253 #ifndef NDEBUG | 253 #ifndef NDEBUG |
254 void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, const Inline
Box* = 0, const char* = 0, const RenderObject* = 0) const; | 254 void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, const Inline
Box* = 0, const char* = 0, const RenderObject* = 0) const; |
255 #endif | 255 #endif |
256 | 256 |
257 bool recalcChildOverflowAfterStyleChange(); | 257 bool recalcChildOverflowAfterStyleChange(); |
258 bool recalcOverflowAfterStyleChange(); | 258 bool recalcOverflowAfterStyleChange(); |
259 | 259 |
260 protected: | 260 protected: |
261 virtual void willBeDestroyed() OVERRIDE; | 261 virtual void willBeDestroyed() override; |
262 | 262 |
263 void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&); | 263 void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&); |
264 | 264 |
265 virtual void layout() OVERRIDE; | 265 virtual void layout() override; |
266 virtual bool updateImageLoadingPriorities() OVERRIDE FINAL; | 266 virtual bool updateImageLoadingPriorities() override final; |
267 | 267 |
268 enum PositionedLayoutBehavior { | 268 enum PositionedLayoutBehavior { |
269 DefaultLayout, | 269 DefaultLayout, |
270 LayoutOnlyFixedPositionedObjects, | 270 LayoutOnlyFixedPositionedObjects, |
271 ForcedLayoutAfterContainingBlockMoved | 271 ForcedLayoutAfterContainingBlockMoved |
272 }; | 272 }; |
273 | 273 |
274 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior
= DefaultLayout); | 274 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior
= DefaultLayout); |
275 void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLa
youtScope&); | 275 void markFixedPositionObjectForLayoutIfNeeded(RenderObject* child, SubtreeLa
youtScope&); |
276 | 276 |
277 LayoutUnit marginIntrinsicLogicalWidthForChild(RenderBox* child) const; | 277 LayoutUnit marginIntrinsicLogicalWidthForChild(RenderBox* child) const; |
278 | 278 |
279 int beforeMarginInLineDirection(LineDirectionMode) const; | 279 int beforeMarginInLineDirection(LineDirectionMode) const; |
280 | 280 |
281 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; | 281 virtual void paint(PaintInfo&, const LayoutPoint&) override; |
282 public: | 282 public: |
283 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE; | 283 virtual void paintObject(PaintInfo&, const LayoutPoint&) override; |
284 virtual void paintChildren(PaintInfo&, const LayoutPoint&); | 284 virtual void paintChildren(PaintInfo&, const LayoutPoint&); |
285 | 285 |
286 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow | 286 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow |
287 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { } | 287 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { } |
288 | 288 |
289 protected: | 289 protected: |
290 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit
yCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { } | 290 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit
yCount */, float& /* logicalLeft */, float& /* logicalWidth */) const { } |
291 | 291 |
292 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const OVERRIDE; | 292 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const override; |
293 virtual void computePreferredLogicalWidths() OVERRIDE; | 293 virtual void computePreferredLogicalWidths() override; |
294 void adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, Lay
outUnit& maxLogicalWidth) const; | 294 void adjustIntrinsicLogicalWidthsForColumns(LayoutUnit& minLogicalWidth, Lay
outUnit& maxLogicalWidth) const; |
295 | 295 |
296 virtual int firstLineBoxBaseline() const OVERRIDE; | 296 virtual int firstLineBoxBaseline() const override; |
297 virtual int inlineBlockBaseline(LineDirectionMode) const OVERRIDE; | 297 virtual int inlineBlockBaseline(LineDirectionMode) const override; |
298 int lastLineBoxBaseline(LineDirectionMode) const; | 298 int lastLineBoxBaseline(LineDirectionMode) const; |
299 | 299 |
300 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) OVERRID
E; | 300 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid
e; |
301 | 301 |
302 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be | 302 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be |
303 // called. This function is used when a flexbox is laying out its | 303 // called. This function is used when a flexbox is laying out its |
304 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), | 304 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), |
305 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro
llInfo() | 305 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro
llInfo() |
306 // is called the same number of times. | 306 // is called the same number of times. |
307 static void startDelayUpdateScrollInfo(); | 307 static void startDelayUpdateScrollInfo(); |
308 static void finishDelayUpdateScrollInfo(); | 308 static void finishDelayUpdateScrollInfo(); |
309 | 309 |
310 void updateScrollInfoAfterLayout(); | 310 void updateScrollInfoAfterLayout(); |
311 | 311 |
312 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) O
VERRIDE; | 312 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o
verride; |
313 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE; | 313 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; |
314 | 314 |
315 virtual bool hasLineIfEmpty() const; | 315 virtual bool hasLineIfEmpty() const; |
316 | 316 |
317 bool simplifiedLayout(); | 317 bool simplifiedLayout(); |
318 virtual void simplifiedNormalFlowLayout(); | 318 virtual void simplifiedNormalFlowLayout(); |
319 | 319 |
320 void setDesiredColumnCountAndWidth(int, LayoutUnit); | 320 void setDesiredColumnCountAndWidth(int, LayoutUnit); |
321 | 321 |
322 public: | 322 public: |
323 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); | 323 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); |
324 protected: | 324 protected: |
325 virtual void addOverflowFromChildren(); | 325 virtual void addOverflowFromChildren(); |
326 void addOverflowFromPositionedObjects(); | 326 void addOverflowFromPositionedObjects(); |
327 void addOverflowFromBlockChildren(); | 327 void addOverflowFromBlockChildren(); |
328 void addVisualOverflowFromTheme(); | 328 void addVisualOverflowFromTheme(); |
329 | 329 |
330 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset, const RenderLayerModelObject* paintContainer) const OVERRIDE; | 330 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset, const RenderLayerModelObject* paintContainer) const override; |
331 | 331 |
332 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint&
layerOffset) const OVERRIDE; | 332 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint&
layerOffset) const override; |
333 | 333 |
334 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox*
); | 334 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox*
); |
335 | 335 |
336 virtual bool isInlineBlockOrInlineTable() const OVERRIDE FINAL { return isIn
line() && isReplaced(); } | 336 virtual bool isInlineBlockOrInlineTable() const override final { return isIn
line() && isReplaced(); } |
337 | 337 |
338 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) OVERRIDE; | 338 virtual void invalidateTreeIfNeeded(const PaintInvalidationState&) override; |
339 | 339 |
340 private: | 340 private: |
341 virtual RenderObjectChildList* virtualChildren() OVERRIDE FINAL { return chi
ldren(); } | 341 virtual RenderObjectChildList* virtualChildren() override final { return chi
ldren(); } |
342 virtual const RenderObjectChildList* virtualChildren() const OVERRIDE FINAL
{ return children(); } | 342 virtual const RenderObjectChildList* virtualChildren() const override final
{ return children(); } |
343 | 343 |
344 virtual const char* renderName() const OVERRIDE; | 344 virtual const char* renderName() const override; |
345 | 345 |
346 virtual bool isRenderBlock() const OVERRIDE FINAL { return true; } | 346 virtual bool isRenderBlock() const override final { return true; } |
347 | 347 |
348 void makeChildrenNonInline(RenderObject* insertionPoint = 0); | 348 void makeChildrenNonInline(RenderObject* insertionPoint = 0); |
349 virtual void removeLeftoverAnonymousBlock(RenderBlock* child); | 349 virtual void removeLeftoverAnonymousBlock(RenderBlock* child); |
350 | 350 |
351 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch
ild); | 351 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch
ild); |
352 | 352 |
353 virtual void dirtyLinesFromChangedChild(RenderObject* child) OVERRIDE FINAL
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } | 353 virtual void dirtyLinesFromChangedChild(RenderObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } |
354 | 354 |
355 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil
d); | 355 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil
d); |
356 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild) OVERRIDE; | 356 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild) override; |
357 void addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* b
eforeChild); | 357 void addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* b
eforeChild); |
358 | 358 |
359 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj
ect* beforeChild = 0); | 359 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj
ect* beforeChild = 0); |
360 | 360 |
361 virtual bool isSelfCollapsingBlock() const OVERRIDE; | 361 virtual bool isSelfCollapsingBlock() const override; |
362 | 362 |
363 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants
Map*&, TrackedContainerMap*&); | 363 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants
Map*&, TrackedContainerMap*&); |
364 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc
endantsMap*&, TrackedContainerMap*&); | 364 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc
endantsMap*&, TrackedContainerMap*&); |
365 | 365 |
366 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderText& c
urrentChild, unsigned length); | 366 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderText& c
urrentChild, unsigned length); |
367 void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* fi
rstLetterContainer); | 367 void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* fi
rstLetterContainer); |
368 | 368 |
369 Node* nodeForHitTest() const; | 369 Node* nodeForHitTest() const; |
370 | 370 |
371 private: | 371 private: |
372 virtual bool avoidsFloats() const OVERRIDE { return true; } | 372 virtual bool avoidsFloats() const override { return true; } |
373 | 373 |
374 bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLoca
tion& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); | 374 bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLoca
tion& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); |
375 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc
ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction)
; | 375 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc
ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction)
; |
376 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow | 376 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow |
377 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation&, const LayoutPoint&) { return false; } | 377 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation&, const LayoutPoint&) { return false; } |
378 | 378 |
379 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); | 379 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); |
380 | 380 |
381 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; | 381 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; |
382 | 382 |
383 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline | 383 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline |
384 // children. | 384 // children. |
385 virtual RenderBlock* firstLineBlock() const OVERRIDE; | 385 virtual RenderBlock* firstLineBlock() const override; |
386 | 386 |
387 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode
lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalid
ationState* = 0) const OVERRIDE FINAL; | 387 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode
lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalid
ationState* = 0) const override final; |
388 | 388 |
389 virtual RenderObject* hoverAncestor() const OVERRIDE FINAL; | 389 virtual RenderObject* hoverAncestor() const override final; |
390 virtual void updateDragState(bool dragOn) OVERRIDE FINAL; | 390 virtual void updateDragState(bool dragOn) override final; |
391 virtual void childBecameNonInline(RenderObject* child) OVERRIDE FINAL; | 391 virtual void childBecameNonInline(RenderObject* child) override final; |
392 | 392 |
393 virtual LayoutRect selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer) const OVERRIDE FINAL | 393 virtual LayoutRect selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer) const override final |
394 { | 394 { |
395 return selectionGapRectsForPaintInvalidation(paintInvalidationContainer)
; | 395 return selectionGapRectsForPaintInvalidation(paintInvalidationContainer)
; |
396 } | 396 } |
397 bool isSelectionRoot() const; | 397 bool isSelectionRoot() const; |
398 GapRects blockSelectionGaps(const RenderBlock* rootBlock, const LayoutPoint&
rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 398 GapRects blockSelectionGaps(const RenderBlock* rootBlock, const LayoutPoint&
rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
399 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogi
calLeft, LayoutUnit& lastLogicalRight, const PaintInfo*) const; | 399 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogi
calLeft, LayoutUnit& lastLogicalRight, const PaintInfo*) const; |
400 LayoutRect blockSelectionGap(const RenderBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 400 LayoutRect blockSelectionGap(const RenderBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
401 LayoutUnit lastLogicalTop, LayoutUnit lastLogic
alLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const PaintInfo*)
const; | 401 LayoutUnit lastLogicalTop, LayoutUnit lastLogic
alLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const PaintInfo*)
const; |
402 | 402 |
403 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow | 403 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow |
404 virtual void clipOutFloatingObjects(const RenderBlock*, const PaintInfo*, co
nst LayoutPoint&, const LayoutSize&) const { }; | 404 virtual void clipOutFloatingObjects(const RenderBlock*, const PaintInfo*, co
nst LayoutPoint&, const LayoutSize&) const { }; |
405 | 405 |
406 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const OVERRIDE; | 406 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; |
407 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRID
E; | 407 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; |
408 | 408 |
409 LayoutUnit desiredColumnWidth() const; | 409 LayoutUnit desiredColumnWidth() const; |
410 | 410 |
411 private: | 411 private: |
412 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) OVERRIDE FINAL; | 412 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override final; |
413 | 413 |
414 void adjustPointToColumnContents(LayoutPoint&) const; | 414 void adjustPointToColumnContents(LayoutPoint&) const; |
415 | 415 |
416 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); | 416 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); |
417 | 417 |
418 Position positionForBox(InlineBox*, bool start = true) const; | 418 Position positionForBox(InlineBox*, bool start = true) const; |
419 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); | 419 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); |
420 | 420 |
421 void calcColumnWidth(); | 421 void calcColumnWidth(); |
422 void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBloc
kFlow* newBlockBox, RenderObject* newChild); | 422 void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBloc
kFlow* newBlockBox, RenderObject* newChild); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 // Adjust from painting offsets to the local coords of this renderer | 462 // Adjust from painting offsets to the local coords of this renderer |
463 void offsetForContents(LayoutPoint&) const; | 463 void offsetForContents(LayoutPoint&) const; |
464 | 464 |
465 bool requiresColumns(int desiredColumnCount) const; | 465 bool requiresColumns(int desiredColumnCount) const; |
466 | 466 |
467 virtual bool updateLogicalWidthAndColumnWidth(); | 467 virtual bool updateLogicalWidthAndColumnWidth(); |
468 | 468 |
469 virtual bool canCollapseAnonymousBlockChild() const { return true; } | 469 virtual bool canCollapseAnonymousBlockChild() const { return true; } |
470 | 470 |
471 public: | 471 public: |
472 virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const OVERRIDE FINAL; | 472 virtual LayoutUnit offsetFromLogicalTopOfFirstPage() const override final; |
473 | 473 |
474 protected: | 474 protected: |
475 RenderObjectChildList m_children; | 475 RenderObjectChildList m_children; |
476 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t
his block flow. For example, <div>Hello<br>world.</div> will have two total lin
es for the <div>. | 476 RenderLineBoxList m_lineBoxes; // All of the root line boxes created for t
his block flow. For example, <div>Hello<br>world.</div> will have two total lin
es for the <div>. |
477 | 477 |
478 LayoutUnit m_pageLogicalOffset; | 478 LayoutUnit m_pageLogicalOffset; |
479 | 479 |
480 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in RenderBlockRareData since they are set too frequently. | 480 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in RenderBlockRareData since they are set too frequently. |
481 unsigned m_hasMarginAfterQuirk : 1; | 481 unsigned m_hasMarginAfterQuirk : 1; |
482 unsigned m_beingDestroyed : 1; | 482 unsigned m_beingDestroyed : 1; |
(...skipping 11 matching lines...) Expand all Loading... |
494 // FIXME: This is temporary as we move code that accesses block flow | 494 // FIXME: This is temporary as we move code that accesses block flow |
495 // member variables out of RenderBlock and into RenderBlockFlow. | 495 // member variables out of RenderBlock and into RenderBlockFlow. |
496 friend class RenderBlockFlow; | 496 friend class RenderBlockFlow; |
497 }; | 497 }; |
498 | 498 |
499 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); | 499 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); |
500 | 500 |
501 } // namespace blink | 501 } // namespace blink |
502 | 502 |
503 #endif // RenderBlock_h | 503 #endif // RenderBlock_h |
OLD | NEW |