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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 RootInlineBox* lineAtIndex(int) const; | 160 RootInlineBox* lineAtIndex(int) const; |
161 int lineCount(const RootInlineBox* = 0, bool* = 0) const; | 161 int lineCount(const RootInlineBox* = 0, bool* = 0) 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 LayoutBlock* blockElementContinuation() const; | |
171 | 170 |
172 using LayoutBoxModelObject::continuation; | 171 using LayoutBoxModelObject::continuation; |
173 using LayoutBoxModelObject::setContinuation; | 172 using LayoutBoxModelObject::setContinuation; |
174 | 173 |
175 static LayoutBlock* createAnonymousWithParentAndDisplay(const LayoutObject*,
EDisplay = BLOCK); | 174 static LayoutBlock* createAnonymousWithParentAndDisplay(const LayoutObject*,
EDisplay = BLOCK); |
176 static LayoutBlockFlow* createAnonymousColumnsWithParent(const LayoutObject*
); | |
177 static LayoutBlockFlow* createAnonymousColumnSpanWithParent(const LayoutObje
ct*); | |
178 LayoutBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentAndDisplay(this, display); } | 175 LayoutBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentAndDisplay(this, display); } |
179 LayoutBlockFlow* createAnonymousColumnsBlock() const { return createAnonymou
sColumnsWithParent(this); } | |
180 LayoutBlockFlow* createAnonymousColumnSpanBlock() const { return createAnony
mousColumnSpanWithParent(this); } | |
181 | 176 |
182 virtual LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* pare
nt) const override; | 177 virtual LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* pare
nt) const override; |
183 | 178 |
184 int columnGap() const; | 179 int columnGap() const; |
185 | 180 |
186 // Accessors for logical width/height and margins in the containing block's
block-flow direction. | 181 // Accessors for logical width/height and margins in the containing block's
block-flow direction. |
187 LayoutUnit logicalWidthForChild(const LayoutBox& child) const { return isHor
izontalWritingMode() ? child.size().width() : child.size().height(); } | 182 LayoutUnit logicalWidthForChild(const LayoutBox& child) const { return isHor
izontalWritingMode() ? child.size().width() : child.size().height(); } |
188 LayoutUnit logicalHeightForChild(const LayoutBox& child) const { return isHo
rizontalWritingMode() ? child.size().height() : child.size().width(); } | 183 LayoutUnit logicalHeightForChild(const LayoutBox& child) const { return isHo
rizontalWritingMode() ? child.size().height() : child.size().width(); } |
189 LayoutSize logicalSizeForChild(const LayoutBox& child) const { return isHori
zontalWritingMode() ? child.size() : child.size().transposedSize(); } | 184 LayoutSize logicalSizeForChild(const LayoutBox& child) const { return isHori
zontalWritingMode() ? child.size() : child.size().transposedSize(); } |
190 LayoutUnit logicalTopForChild(const LayoutBox& child) const { return isHoriz
ontalWritingMode() ? child.location().y() : child.location().x(); } | 185 LayoutUnit logicalTopForChild(const LayoutBox& child) const { return isHoriz
ontalWritingMode() ? child.location().y() : child.location().x(); } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 | 306 |
312 // 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. |
313 void promoteAllChildrenAndInsertAfter(); | 308 void promoteAllChildrenAndInsertAfter(); |
314 | 309 |
315 virtual void removeLeftoverAnonymousBlock(LayoutBlock* child); | 310 virtual void removeLeftoverAnonymousBlock(LayoutBlock* child); |
316 | 311 |
317 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); | 312 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); |
318 | 313 |
319 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); } |
320 | 315 |
321 void addChildToContinuation(LayoutObject* newChild, LayoutObject* beforeChil
d); | |
322 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje
ct* beforeChild) override; | 316 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje
ct* beforeChild) override; |
323 void addChildToAnonymousColumnBlocks(LayoutObject* newChild, LayoutObject* b
eforeChild); | |
324 | |
325 void addChildIgnoringAnonymousColumnBlocks(LayoutObject* newChild, LayoutObj
ect* beforeChild = 0); | |
326 | 317 |
327 virtual bool isSelfCollapsingBlock() const override; | 318 virtual bool isSelfCollapsingBlock() const override; |
328 | 319 |
329 void removeAnonymousWrappersIfRequired(); | 320 void removeAnonymousWrappersIfRequired(); |
330 | 321 |
331 void insertIntoTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDescendant
sMap*&, TrackedContainerMap*&); | 322 void insertIntoTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDescendant
sMap*&, TrackedContainerMap*&); |
332 static void removeFromTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDes
cendantsMap*&, TrackedContainerMap*&); | 323 static void removeFromTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDes
cendantsMap*&, TrackedContainerMap*&); |
333 | 324 |
334 Node* nodeForHitTest() const; | 325 Node* nodeForHitTest() const; |
335 | 326 |
(...skipping 26 matching lines...) Expand all Loading... |
362 | 353 |
363 private: | 354 private: |
364 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override final; | 355 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = 0) override final; |
365 bool isInlineBoxWrapperActuallyChild() const; | 356 bool isInlineBoxWrapperActuallyChild() const; |
366 | 357 |
367 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); | 358 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = 0); |
368 | 359 |
369 Position positionForBox(InlineBox*, bool start = true) const; | 360 Position positionForBox(InlineBox*, bool start = true) const; |
370 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); | 361 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); |
371 | 362 |
372 void makeChildrenAnonymousColumnBlocks(LayoutObject* beforeChild, LayoutBloc
kFlow* newBlockBox, LayoutObject* newChild); | |
373 | |
374 void splitBlocks(LayoutBlock* fromBlock, LayoutBlock* toBlock, LayoutBlock*
middleBlock, | |
375 LayoutObject* beforeChild, LayoutBoxModelObject* oldCont); | |
376 void splitFlow(LayoutObject* beforeChild, LayoutBlock* newBlockBox, | |
377 LayoutObject* newChild, LayoutBoxModelObject* oldCont); | |
378 LayoutBlock* clone() const; | |
379 LayoutBlock* continuationBefore(LayoutObject* beforeChild); | |
380 LayoutBlockFlow* containingColumnsBlock(bool allowAnonymousColumnBlock = tru
e); | |
381 LayoutBlockFlow* columnsBlockForSpanningElement(LayoutObject* newChild); | |
382 | |
383 // End helper functions and structs used by layoutBlockChildren. | 363 // End helper functions and structs used by layoutBlockChildren. |
384 | 364 |
385 void removeFromGlobalMaps(); | 365 void removeFromGlobalMaps(); |
386 bool widthAvailableToChildrenHasChanged(); | 366 bool widthAvailableToChildrenHasChanged(); |
387 | 367 |
388 protected: | 368 protected: |
389 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL
ogicalHeightForOffset(logicalOffset); } | 369 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL
ogicalHeightForOffset(logicalOffset); } |
390 | 370 |
391 // 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, | 371 // 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, |
392 // then nextPageLogicalTop with ExcludePageBoundary will still move to the t
op of the next page. nextPageLogicalTop with | 372 // then nextPageLogicalTop with ExcludePageBoundary will still move to the t
op of the next page. nextPageLogicalTop with |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 // 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 |
439 // member variables out of LayoutBlock and into LayoutBlockFlow. | 419 // member variables out of LayoutBlock and into LayoutBlockFlow. |
440 friend class LayoutBlockFlow; | 420 friend class LayoutBlockFlow; |
441 }; | 421 }; |
442 | 422 |
443 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 423 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
444 | 424 |
445 } // namespace blink | 425 } // namespace blink |
446 | 426 |
447 #endif // LayoutBlock_h | 427 #endif // LayoutBlock_h |
OLD | NEW |