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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #ifndef RenderBlock_h | 23 #ifndef RenderBlock_h |
24 #define RenderBlock_h | 24 #define RenderBlock_h |
25 | 25 |
26 #include "core/rendering/ColumnInfo.h" | |
27 #include "core/rendering/FloatingObjects.h" | 26 #include "core/rendering/FloatingObjects.h" |
28 #include "core/rendering/GapRects.h" | 27 #include "core/rendering/GapRects.h" |
29 #include "core/rendering/RenderBox.h" | 28 #include "core/rendering/RenderBox.h" |
30 #include "core/rendering/RenderLineBoxList.h" | 29 #include "core/rendering/RenderLineBoxList.h" |
31 #include "core/rendering/RootInlineBox.h" | 30 #include "core/rendering/RootInlineBox.h" |
32 #include "core/rendering/shapes/ShapeInsideInfo.h" | 31 #include "core/rendering/shapes/ShapeInsideInfo.h" |
33 #include "core/rendering/style/ShapeValue.h" | 32 #include "core/rendering/style/ShapeValue.h" |
34 #include "platform/text/TextBreakIterator.h" | 33 #include "platform/text/TextBreakIterator.h" |
35 #include "platform/text/TextRun.h" | 34 #include "platform/text/TextRun.h" |
36 #include "wtf/ListHashSet.h" | 35 #include "wtf/ListHashSet.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // RenderBoxes without needed to check whether they're RenderBlocks first. | 140 // RenderBoxes without needed to check whether they're RenderBlocks first. |
142 virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&) OVERRIDE
FINAL; | 141 virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&) OVERRIDE
FINAL; |
143 | 142 |
144 // FIXME-BLOCKFLOW: Remove virtualizaion when all of the line layout code ha
s been moved out of RenderBlock | 143 // FIXME-BLOCKFLOW: Remove virtualizaion when all of the line layout code ha
s been moved out of RenderBlock |
145 virtual bool containsFloats() const { return false; } | 144 virtual bool containsFloats() const { return false; } |
146 | 145 |
147 LayoutUnit textIndentOffset() const; | 146 LayoutUnit textIndentOffset() const; |
148 | 147 |
149 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) OVERRIDE; | 148 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) OVERRIDE; |
150 | 149 |
151 // Block flows subclass availableWidth to handle multi column layout (shrink
ing the width available to children when laying out.) | |
152 virtual LayoutUnit availableLogicalWidth() const OVERRIDE FINAL; | |
153 | |
154 LayoutPoint flipForWritingModeIncludingColumns(const LayoutPoint&) const; | |
155 void adjustStartEdgeForWritingModeIncludingColumns(LayoutRect&) const; | |
156 | |
157 LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const; | 150 LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const; |
158 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; | 151 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; |
159 | 152 |
160 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } | 153 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } |
161 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } | 154 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } |
162 | 155 |
163 GapRects selectionGapRectsForRepaint(const RenderLayerModelObject* repaintCo
ntainer); | 156 GapRects selectionGapRectsForRepaint(const RenderLayerModelObject* repaintCo
ntainer); |
164 LayoutRect logicalLeftSelectionGap(RenderBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 157 LayoutRect logicalLeftSelectionGap(RenderBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
165 RenderObject* selObj, LayoutUnit logicalL
eft, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*); | 158 RenderObject* selObj, LayoutUnit logicalL
eft, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*); |
166 LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoin
t& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 159 LayoutRect logicalRightSelectionGap(RenderBlock* rootBlock, const LayoutPoin
t& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
167 RenderObject* selObj, LayoutUnit logical
Right, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*); | 160 RenderObject* selObj, LayoutUnit logical
Right, LayoutUnit logicalTop, LayoutUnit logicalHeight, const PaintInfo*); |
168 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap); | 161 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap); |
169 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; | 162 RenderBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; |
170 | 163 |
171 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect); | 164 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect); |
172 | 165 |
173 // Helper methods for computing line counts and heights for line counts. | 166 // Helper methods for computing line counts and heights for line counts. |
174 RootInlineBox* lineAtIndex(int) const; | 167 RootInlineBox* lineAtIndex(int) const; |
175 int lineCount(const RootInlineBox* = 0, bool* = 0) const; | 168 int lineCount(const RootInlineBox* = 0, bool* = 0) const; |
176 int heightForLineCount(int); | 169 int heightForLineCount(int); |
177 void clearTruncation(); | 170 void clearTruncation(); |
178 | 171 |
179 void adjustRectForColumns(LayoutRect&) const; | |
180 virtual void adjustForColumns(LayoutSize&, const LayoutPoint&) const OVERRID
E FINAL; | |
181 void adjustForColumnRect(LayoutSize& offset, const LayoutPoint& locationInCo
ntainer) const; | |
182 | |
183 void addContinuationWithOutline(RenderInline*); | 172 void addContinuationWithOutline(RenderInline*); |
184 bool paintsContinuationOutline(RenderInline*); | 173 bool paintsContinuationOutline(RenderInline*); |
185 | 174 |
186 virtual RenderBoxModelObject* virtualContinuation() const OVERRIDE FINAL { r
eturn continuation(); } | 175 virtual RenderBoxModelObject* virtualContinuation() const OVERRIDE FINAL { r
eturn continuation(); } |
187 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } | 176 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } |
188 RenderInline* inlineElementContinuation() const; | 177 RenderInline* inlineElementContinuation() const; |
189 RenderBlock* blockElementContinuation() const; | 178 RenderBlock* blockElementContinuation() const; |
190 | 179 |
191 using RenderBoxModelObject::continuation; | 180 using RenderBoxModelObject::continuation; |
192 using RenderBoxModelObject::setContinuation; | 181 using RenderBoxModelObject::setContinuation; |
193 | 182 |
194 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render
Object*, EDisplay = BLOCK); | 183 static RenderBlock* createAnonymousWithParentRendererAndDisplay(const Render
Object*, EDisplay = BLOCK); |
195 static RenderBlockFlow* createAnonymousColumnsWithParentRenderer(const Rende
rObject*); | |
196 static RenderBlockFlow* createAnonymousColumnSpanWithParentRenderer(const Re
nderObject*); | |
197 RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentRendererAndDisplay(this, display); } | 184 RenderBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentRendererAndDisplay(this, display); } |
198 RenderBlockFlow* createAnonymousColumnsBlock() const { return createAnonymou
sColumnsWithParentRenderer(this); } | |
199 RenderBlockFlow* createAnonymousColumnSpanBlock() const { return createAnony
mousColumnSpanWithParentRenderer(this); } | |
200 | 185 |
201 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare
nt) const OVERRIDE; | 186 virtual RenderBox* createAnonymousBoxWithSameTypeAs(const RenderObject* pare
nt) const OVERRIDE; |
202 | 187 |
203 ColumnInfo* columnInfo() const; | |
204 int columnGap() const; | 188 int columnGap() const; |
205 | 189 |
206 void updateColumnInfoFromStyle(RenderStyle*); | |
207 | |
208 // These two functions take the ColumnInfo* to avoid repeated lookups of the
info in the global HashMap. | |
209 unsigned columnCount(ColumnInfo*) const; | |
210 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; | |
211 | |
212 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin
ationStrut : LayoutUnit(); } | 190 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin
ationStrut : LayoutUnit(); } |
213 void setPaginationStrut(LayoutUnit); | 191 void setPaginationStrut(LayoutUnit); |
214 | 192 |
215 bool shouldBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData
->m_lineBreakToAvoidWidow >= 0; } | 193 bool shouldBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData
->m_lineBreakToAvoidWidow >= 0; } |
216 void clearShouldBreakAtLineToAvoidWidow() const; | 194 void clearShouldBreakAtLineToAvoidWidow() const; |
217 int lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBr
eakToAvoidWidow : -1; } | 195 int lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBr
eakToAvoidWidow : -1; } |
218 void setBreakAtLineToAvoidWidow(int); | 196 void setBreakAtLineToAvoidWidow(int); |
219 void clearDidBreakAtLineToAvoidWidow(); | 197 void clearDidBreakAtLineToAvoidWidow(); |
220 void setDidBreakAtLineToAvoidWidow(); | 198 void setDidBreakAtLineToAvoidWidow(); |
221 bool didBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m
_didBreakAtLineToAvoidWidow; } | 199 bool didBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m
_didBreakAtLineToAvoidWidow; } |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 void updateScrollInfoAfterLayout(); | 342 void updateScrollInfoAfterLayout(); |
365 | 343 |
366 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle) O
VERRIDE; | 344 virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle) O
VERRIDE; |
367 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE; | 345 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE; |
368 | 346 |
369 virtual bool hasLineIfEmpty() const; | 347 virtual bool hasLineIfEmpty() const; |
370 | 348 |
371 bool simplifiedLayout(); | 349 bool simplifiedLayout(); |
372 virtual void simplifiedNormalFlowLayout(); | 350 virtual void simplifiedNormalFlowLayout(); |
373 | 351 |
374 void setDesiredColumnCountAndWidth(int, LayoutUnit); | |
375 | |
376 public: | 352 public: |
377 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); | 353 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); |
378 protected: | 354 protected: |
379 virtual void addOverflowFromChildren(); | 355 virtual void addOverflowFromChildren(); |
380 void addOverflowFromPositionedObjects(); | 356 void addOverflowFromPositionedObjects(); |
381 void addOverflowFromBlockChildren(); | 357 void addOverflowFromBlockChildren(); |
382 void addVisualOverflowFromTheme(); | 358 void addVisualOverflowFromTheme(); |
383 | 359 |
384 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition
alOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE; | 360 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition
alOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE; |
385 | 361 |
(...skipping 23 matching lines...) Expand all Loading... |
409 | 385 |
410 void makeChildrenNonInline(RenderObject* insertionPoint = 0); | 386 void makeChildrenNonInline(RenderObject* insertionPoint = 0); |
411 virtual void removeLeftoverAnonymousBlock(RenderBlock* child); | 387 virtual void removeLeftoverAnonymousBlock(RenderBlock* child); |
412 | 388 |
413 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch
ild); | 389 static void collapseAnonymousBlockChild(RenderBlock* parent, RenderBlock* ch
ild); |
414 | 390 |
415 virtual void dirtyLinesFromChangedChild(RenderObject* child) OVERRIDE FINAL
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } | 391 virtual void dirtyLinesFromChangedChild(RenderObject* child) OVERRIDE FINAL
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } |
416 | 392 |
417 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil
d); | 393 void addChildToContinuation(RenderObject* newChild, RenderObject* beforeChil
d); |
418 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild) OVERRIDE; | 394 virtual void addChildIgnoringContinuation(RenderObject* newChild, RenderObje
ct* beforeChild) OVERRIDE; |
419 void addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* b
eforeChild); | |
420 | 395 |
421 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj
ect* beforeChild = 0); | 396 void addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObj
ect* beforeChild = 0); |
422 | 397 |
423 virtual bool isSelfCollapsingBlock() const OVERRIDE; | 398 virtual bool isSelfCollapsingBlock() const OVERRIDE; |
424 | 399 |
425 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants
Map*&, TrackedContainerMap*&); | 400 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants
Map*&, TrackedContainerMap*&); |
426 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc
endantsMap*&, TrackedContainerMap*&); | 401 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc
endantsMap*&, TrackedContainerMap*&); |
427 | 402 |
428 // Called to lay out the legend for a fieldset or the ruby text of a ruby ru
n. | 403 // Called to lay out the legend for a fieldset or the ruby text of a ruby ru
n. |
429 virtual RenderObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/,
SubtreeLayoutScope&) { return 0; } | 404 virtual RenderObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/,
SubtreeLayoutScope&) { return 0; } |
430 | 405 |
431 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderObject*
currentChild, unsigned length); | 406 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderObject*
currentChild, unsigned length); |
432 void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* fi
rstLetterContainer); | 407 void updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* fi
rstLetterContainer); |
433 | 408 |
434 Node* nodeForHitTest() const; | 409 Node* nodeForHitTest() const; |
435 | 410 |
436 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow | 411 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow |
437 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { } | 412 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool) { } |
438 void paintContents(PaintInfo&, const LayoutPoint&); | 413 void paintContents(PaintInfo&, const LayoutPoint&); |
439 void paintColumnContents(PaintInfo&, const LayoutPoint&, bool paintFloats =
false); | |
440 void paintColumnRules(PaintInfo&, const LayoutPoint&); | |
441 void paintSelection(PaintInfo&, const LayoutPoint&); | 414 void paintSelection(PaintInfo&, const LayoutPoint&); |
442 void paintCaret(PaintInfo&, const LayoutPoint&, CaretType); | 415 void paintCaret(PaintInfo&, const LayoutPoint&, CaretType); |
443 | 416 |
444 bool hasCaret() const { return hasCaret(CursorCaret) || hasCaret(DragCaret);
} | 417 bool hasCaret() const { return hasCaret(CursorCaret) || hasCaret(DragCaret);
} |
445 bool hasCaret(CaretType) const; | 418 bool hasCaret(CaretType) const; |
446 | 419 |
447 virtual bool avoidsFloats() const OVERRIDE; | |
448 | |
449 bool hitTestColumns(const HitTestRequest&, HitTestResult&, const HitTestLoca
tion& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction); | |
450 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc
ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction)
; | 420 bool hitTestContents(const HitTestRequest&, HitTestResult&, const HitTestLoc
ation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction)
; |
451 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow | 421 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow |
452 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation&, const LayoutPoint&) { return false; } | 422 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation&, const LayoutPoint&) { return false; } |
453 | 423 |
454 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); | 424 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); |
455 | 425 |
456 // FIXME: Make this method const so we can remove the const_cast in computeI
ntrinsicLogicalWidths. | 426 // FIXME: Make this method const so we can remove the const_cast in computeI
ntrinsicLogicalWidths. |
457 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout
Unit& maxLogicalWidth); | 427 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout
Unit& maxLogicalWidth); |
458 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; | 428 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; |
459 | 429 |
(...skipping 22 matching lines...) Expand all Loading... |
482 LayoutUnit lastLogicalTop, LayoutUnit lastLogic
alLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const PaintInfo*)
; | 452 LayoutUnit lastLogicalTop, LayoutUnit lastLogic
alLeft, LayoutUnit lastLogicalRight, LayoutUnit logicalBottom, const PaintInfo*)
; |
483 virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, Layout
Unit position); | 453 virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, Layout
Unit position); |
484 virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, Layou
tUnit position); | 454 virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, Layou
tUnit position); |
485 | 455 |
486 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow | 456 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Rend
erBlockFlow |
487 virtual void clipOutFloatingObjects(RenderBlock*, const PaintInfo*, const La
youtPoint&, const LayoutSize&) { }; | 457 virtual void clipOutFloatingObjects(RenderBlock*, const PaintInfo*, const La
youtPoint&, const LayoutSize&) { }; |
488 | 458 |
489 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const OVERRIDE; | 459 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const OVERRIDE; |
490 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRID
E; | 460 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const OVERRID
E; |
491 | 461 |
492 LayoutUnit desiredColumnWidth() const; | |
493 | |
494 void paintContinuationOutlines(PaintInfo&, const LayoutPoint&); | 462 void paintContinuationOutlines(PaintInfo&, const LayoutPoint&); |
495 | 463 |
496 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) OVERRIDE FINAL; | 464 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) OVERRIDE FINAL; |
497 | 465 |
498 void adjustPointToColumnContents(LayoutPoint&) const; | |
499 | |
500 void fitBorderToLinesIfNeeded(); // Shrink the box in which the border paint
s if border-fit is set. | 466 void fitBorderToLinesIfNeeded(); // Shrink the box in which the border paint
s if border-fit is set. |
501 virtual void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit&
right) const; // Helper function for borderFitAdjust | 467 virtual void adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit&
right) const; // Helper function for borderFitAdjust |
502 | 468 |
503 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); | 469 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); |
504 | 470 |
505 Position positionForBox(InlineBox*, bool start = true) const; | 471 Position positionForBox(InlineBox*, bool start = true) const; |
506 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); | 472 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); |
507 | 473 |
508 virtual void calcColumnWidth(); | |
509 void makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBloc
kFlow* newBlockBox, RenderObject* newChild); | |
510 | |
511 bool expandsToEncloseOverhangingFloats() const; | 474 bool expandsToEncloseOverhangingFloats() const; |
512 | 475 |
513 void splitBlocks(RenderBlock* fromBlock, RenderBlock* toBlock, RenderBlock*
middleBlock, | |
514 RenderObject* beforeChild, RenderBoxModelObject* oldCont); | |
515 void splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox, | |
516 RenderObject* newChild, RenderBoxModelObject* oldCont); | |
517 RenderBlock* clone() const; | 476 RenderBlock* clone() const; |
518 RenderBlock* continuationBefore(RenderObject* beforeChild); | 477 RenderBlock* continuationBefore(RenderObject* beforeChild); |
519 RenderBlockFlow* containingColumnsBlock(bool allowAnonymousColumnBlock = tru
e); | |
520 RenderBlockFlow* columnsBlockForSpanningElement(RenderObject* newChild); | |
521 | 478 |
522 // End helper functions and structs used by layoutBlockChildren. | 479 // End helper functions and structs used by layoutBlockChildren. |
523 | 480 |
524 protected: | 481 protected: |
525 void determineLogicalLeftPositionForChild(RenderBox* child, ApplyLayoutDelta
Mode = DoNotApplyLayoutDelta); | 482 void determineLogicalLeftPositionForChild(RenderBox* child, ApplyLayoutDelta
Mode = DoNotApplyLayoutDelta); |
526 | 483 |
527 // Pagination routines. | 484 // Pagination routines. |
528 bool relayoutToAvoidWidows(LayoutStateMaintainer&); | 485 bool relayoutToAvoidWidows(LayoutStateMaintainer&); |
529 | 486 |
530 // Returns the logicalOffset at the top of the next page. If the offset pass
ed in is already at the top of the current page, | 487 // Returns the logicalOffset at the top of the next page. If the offset pass
ed in is already at the top of the current page, |
531 // then nextPageLogicalTop with ExcludePageBoundary will still move to the t
op of the next page. nextPageLogicalTop with | 488 // then nextPageLogicalTop with ExcludePageBoundary will still move to the t
op of the next page. nextPageLogicalTop with |
532 // IncludePageBoundary set will not. | 489 // IncludePageBoundary set will not. |
533 // | 490 // |
534 // For a page height of 800px, the first rule will return 800 if the value p
assed in is 0. The second rule will simply return 0. | 491 // For a page height of 800px, the first rule will return 800 if the value p
assed in is 0. The second rule will simply return 0. |
535 enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary }; | 492 enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary }; |
536 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = E
xcludePageBoundary) const; | 493 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = E
xcludePageBoundary) const; |
537 bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBou
ndary) const; | 494 bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBou
ndary) const; |
538 | 495 |
539 virtual ColumnInfo::PaginationUnit paginationUnit() const; | |
540 | |
541 public: | 496 public: |
542 LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const; | 497 LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const; |
543 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const; | 498 LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const; |
544 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBounda
ryRule = IncludePageBoundary) const; | 499 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBounda
ryRule = IncludePageBoundary) const; |
545 | 500 |
546 protected: | 501 protected: |
547 bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUn
it logicalOffset, LayoutUnit minimumLogicalHeight) const; | 502 bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUn
it logicalOffset, LayoutUnit minimumLogicalHeight) const; |
548 | 503 |
549 // A page break is required at some offset due to space shortage in the curr
ent fragmentainer. | 504 // A page break is required at some offset due to space shortage in the curr
ent fragmentainer. |
550 void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage); | 505 void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 return false; | 593 return false; |
639 } | 594 } |
640 return true; | 595 return true; |
641 } | 596 } |
642 | 597 |
643 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); | 598 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlock, isRenderBlock()); |
644 | 599 |
645 } // namespace WebCore | 600 } // namespace WebCore |
646 | 601 |
647 #endif // RenderBlock_h | 602 #endif // RenderBlock_h |
OLD | NEW |