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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } | 87 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } |
88 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } | 88 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } |
89 | 89 |
90 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } | 90 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } |
91 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } | 91 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } |
92 | 92 |
93 public: | 93 public: |
94 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow | 94 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow |
95 virtual void deleteLineBoxTree(); | 95 virtual void deleteLineBoxTree(); |
96 | 96 |
97 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0)
override; | 97 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nu
llptr) override; |
98 virtual void removeChild(LayoutObject*) override; | 98 virtual void removeChild(LayoutObject*) override; |
99 | 99 |
100 virtual void layoutBlock(bool relayoutChildren); | 100 virtual void layoutBlock(bool relayoutChildren); |
101 | 101 |
102 void insertPositionedObject(LayoutBox*); | 102 void insertPositionedObject(LayoutBox*); |
103 static void removePositionedObject(LayoutBox*); | 103 static void removePositionedObject(LayoutBox*); |
104 void removePositionedObjects(LayoutBlock*, ContainingBlockState = SameContai
ningBlock); | 104 void removePositionedObjects(LayoutBlock*, ContainingBlockState = SameContai
ningBlock); |
105 | 105 |
106 TrackedLayoutBoxListHashSet* positionedObjects() const; | 106 TrackedLayoutBoxListHashSet* positionedObjects() const; |
107 bool hasPositionedObjects() const | 107 bool hasPositionedObjects() const |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; | 151 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; |
152 | 152 |
153 LayoutBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; | 153 LayoutBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; |
154 | 154 |
155 virtual void setSelectionState(SelectionState) override; | 155 virtual void setSelectionState(SelectionState) override; |
156 | 156 |
157 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; | 157 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; |
158 | 158 |
159 // Helper methods for computing line counts and heights for line counts. | 159 // Helper methods for computing line counts and heights for line counts. |
160 RootInlineBox* lineAtIndex(int) const; | 160 RootInlineBox* lineAtIndex(int) const; |
161 int lineCount(const RootInlineBox* = 0, bool* = 0) const; | 161 int lineCount(const RootInlineBox* = nullptr, bool* = nullptr) const; |
162 int heightForLineCount(int); | 162 int heightForLineCount(int); |
163 void clearTruncation(); | 163 void clearTruncation(); |
164 | 164 |
165 void addContinuationWithOutline(LayoutInline*); | 165 void addContinuationWithOutline(LayoutInline*); |
166 | 166 |
167 virtual LayoutBoxModelObject* virtualContinuation() const override final { r
eturn continuation(); } | 167 virtual LayoutBoxModelObject* virtualContinuation() const override final { r
eturn continuation(); } |
168 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } | 168 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } |
169 LayoutInline* inlineElementContinuation() const; | 169 LayoutInline* inlineElementContinuation() const; |
170 | 170 |
171 using LayoutBoxModelObject::continuation; | 171 using LayoutBoxModelObject::continuation; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } | 205 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } |
206 | 206 |
207 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; | 207 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; |
208 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; | 208 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; |
209 | 209 |
210 #if ENABLE(ASSERT) | 210 #if ENABLE(ASSERT) |
211 void checkPositionedObjectsNeedLayout(); | 211 void checkPositionedObjectsNeedLayout(); |
212 bool paintsContinuationOutline(LayoutInline* flow); | 212 bool paintsContinuationOutline(LayoutInline* flow); |
213 #endif | 213 #endif |
214 #ifndef NDEBUG | 214 #ifndef NDEBUG |
215 void showLineTreeAndMark(const InlineBox* = 0, const char* = 0, const Inline
Box* = 0, const char* = 0, const LayoutObject* = 0) const; | 215 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr,
const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr
) const; |
216 #endif | 216 #endif |
217 | 217 |
218 bool recalcChildOverflowAfterStyleChange(); | 218 bool recalcChildOverflowAfterStyleChange(); |
219 bool recalcOverflowAfterStyleChange(); | 219 bool recalcOverflowAfterStyleChange(); |
220 | 220 |
221 protected: | 221 protected: |
222 virtual void willBeDestroyed() override; | 222 virtual void willBeDestroyed() override; |
223 | 223 |
224 void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&); | 224 void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&); |
225 | 225 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 virtual bool isInlineBlockOrInlineTable() const override final { return isIn
line() && isReplaced(); } | 295 virtual bool isInlineBlockOrInlineTable() const override final { return isIn
line() && isReplaced(); } |
296 | 296 |
297 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child
PaintInvalidationState) override; | 297 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child
PaintInvalidationState) override; |
298 | 298 |
299 private: | 299 private: |
300 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } | 300 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } |
301 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } | 301 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } |
302 | 302 |
303 virtual bool isLayoutBlock() const override final { return true; } | 303 virtual bool isLayoutBlock() const override final { return true; } |
304 | 304 |
305 void makeChildrenNonInline(LayoutObject* insertionPoint = 0); | 305 void makeChildrenNonInline(LayoutObject* insertionPoint = nullptr); |
306 | 306 |
307 // Promote all children and make them siblings that come right after this bl
ock. | 307 // Promote all children and make them siblings that come right after this bl
ock. |
308 void promoteAllChildrenAndInsertAfter(); | 308 void promoteAllChildrenAndInsertAfter(); |
309 | 309 |
310 virtual void removeLeftoverAnonymousBlock(LayoutBlock* child); | 310 virtual void removeLeftoverAnonymousBlock(LayoutBlock* child); |
311 | 311 |
312 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); | 312 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); |
313 | 313 |
314 virtual void dirtyLinesFromChangedChild(LayoutObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } | 314 virtual void dirtyLinesFromChangedChild(LayoutObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } |
315 | 315 |
(...skipping 17 matching lines...) Expand all Loading... |
333 virtual bool hitTestFloats(HitTestResult&, const HitTestLocation&, const Lay
outPoint&) { return false; } | 333 virtual bool hitTestFloats(HitTestResult&, const HitTestLocation&, const Lay
outPoint&) { return false; } |
334 | 334 |
335 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); | 335 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); |
336 | 336 |
337 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; | 337 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; |
338 | 338 |
339 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline | 339 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline |
340 // children. | 340 // children. |
341 virtual LayoutBlock* firstLineBlock() const override; | 341 virtual LayoutBlock* firstLineBlock() const override; |
342 | 342 |
343 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO
bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat
ionState* = 0) const override final; | 343 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO
bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat
ionState* = nullptr) const override final; |
344 | 344 |
345 virtual LayoutObject* hoverAncestor() const override final; | 345 virtual LayoutObject* hoverAncestor() const override final; |
346 virtual void updateDragState(bool dragOn) override final; | 346 virtual void updateDragState(bool dragOn) override final; |
347 virtual void childBecameNonInline(LayoutObject* child) override final; | 347 virtual void childBecameNonInline(LayoutObject* child) override final; |
348 | 348 |
349 bool isSelectionRoot() const; | 349 bool isSelectionRoot() const; |
350 | 350 |
351 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; | 351 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; |
352 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; | 352 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; |
353 | 353 |
354 private: | 354 private: |
355 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override final; | 355 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = nullptr) override final; |
356 bool isInlineBoxWrapperActuallyChild() const; | 356 bool isInlineBoxWrapperActuallyChild() const; |
357 | 357 |
358 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); | 358 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = nullptr); |
359 | 359 |
360 Position positionForBox(InlineBox*, bool start = true) const; | 360 Position positionForBox(InlineBox*, bool start = true) const; |
361 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); | 361 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); |
362 | 362 |
363 // End helper functions and structs used by layoutBlockChildren. | 363 // End helper functions and structs used by layoutBlockChildren. |
364 | 364 |
365 void removeFromGlobalMaps(); | 365 void removeFromGlobalMaps(); |
366 bool widthAvailableToChildrenHasChanged(); | 366 bool widthAvailableToChildrenHasChanged(); |
367 | 367 |
368 protected: | 368 protected: |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // FIXME: This is temporary as we move code that accesses block flow | 418 // FIXME: This is temporary as we move code that accesses block flow |
419 // member variables out of LayoutBlock and into LayoutBlockFlow. | 419 // member variables out of LayoutBlock and into LayoutBlockFlow. |
420 friend class LayoutBlockFlow; | 420 friend class LayoutBlockFlow; |
421 }; | 421 }; |
422 | 422 |
423 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 423 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
424 | 424 |
425 } // namespace blink | 425 } // namespace blink |
426 | 426 |
427 #endif // LayoutBlock_h | 427 #endif // LayoutBlock_h |
OLD | NEW |