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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidt
hToEndOfLine = nullptr) final; | 421 LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidt
hToEndOfLine = nullptr) final; |
422 bool isInlineBoxWrapperActuallyChild() const; | 422 bool isInlineBoxWrapperActuallyChild() const; |
423 | 423 |
424 Position positionForBox(InlineBox*, bool start = true) const; | 424 Position positionForBox(InlineBox*, bool start = true) const; |
425 | 425 |
426 // End helper functions and structs used by layoutBlockChildren. | 426 // End helper functions and structs used by layoutBlockChildren. |
427 | 427 |
428 void removeFromGlobalMaps(); | 428 void removeFromGlobalMaps(); |
429 bool widthAvailableToChildrenHasChanged(); | 429 bool widthAvailableToChildrenHasChanged(); |
430 | 430 |
431 public: | |
432 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); | |
433 protected: | 431 protected: |
434 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL
ogicalHeightForOffset(logicalOffset); } | 432 bool isPageLogicalHeightKnown(LayoutUnit logicalOffset) const { return pageL
ogicalHeightForOffset(logicalOffset); } |
435 | 433 |
436 // Returns the logical offset at the top of the next page, for a given offse
t. | 434 // Returns the logical offset at the top of the next page, for a given offse
t. |
437 // | 435 // |
438 // If the given offset is at a page boundary, using AssociateWithLatterPage
as PageBoundaryRule | 436 // If the given offset is at a page boundary, using AssociateWithLatterPage
as PageBoundaryRule |
439 // will move us one page ahead (since the offset is at the top of the "curre
nt" page). Using | 437 // will move us one page ahead (since the offset is at the top of the "curre
nt" page). Using |
440 // AssociateWithFormerPage instead will keep us where we are (since the offs
et is at the bottom | 438 // AssociateWithFormerPage instead will keep us where we are (since the offs
et is at the bottom |
441 // of the "current" page, which is exactly the same offset as the top offset
on the next page). | 439 // of the "current" page, which is exactly the same offset as the top offset
on the next page). |
442 // | 440 // |
443 // For a page height of 800px, AssociateWithLatterPage will return 1600 if t
he value passed in | 441 // For a page height of 800px, AssociateWithLatterPage will return 1600 if t
he value passed in |
444 // is 800. AssociateWithFormerPage will simply return 800. | 442 // is 800. AssociateWithFormerPage will simply return 800. |
445 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule) co
nst; | 443 LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule) co
nst; |
446 | 444 |
447 // Paginated content inside this block was laid out. | 445 // Paginated content inside this block was laid out. |
448 // |logicalBottomOffsetAfterPagination| is the logical bottom offset of the
child content after | 446 // |logicalBottomOffsetAfterPagination| is the logical bottom offset of the
child content after |
449 // applying any forced or unforced breaks as needed. | 447 // applying any forced or unforced breaks as needed. |
450 void paginatedContentWasLaidOut(LayoutUnit logicalBottomOffsetAfterPaginatio
n); | 448 void paginatedContentWasLaidOut(LayoutUnit logicalBottomOffsetAfterPaginatio
n); |
451 | 449 |
452 // Adjust from painting offsets to the local coords of this layoutObject | 450 // Adjust from painting offsets to the local coords of this layoutObject |
453 void offsetForContents(LayoutPoint&) const; | 451 void offsetForContents(LayoutPoint&) const; |
454 | 452 |
455 PositionWithAffinity positionForPointRespectingEditingBoundaries(LineLayoutB
ox child, const LayoutPoint& pointInParentCoordinates); | 453 PositionWithAffinity positionForPointRespectingEditingBoundaries(LineLayoutB
ox child, const LayoutPoint& pointInParentCoordinates); |
456 PositionWithAffinity positionForPointIfOutsideAtomicInlineLevel(const Layout
Point&); | 454 PositionWithAffinity positionForPointIfOutsideAtomicInlineLevel(const Layout
Point&); |
457 | 455 |
458 virtual bool updateLogicalWidthAndColumnWidth(); | 456 virtual bool updateLogicalWidthAndColumnWidth(); |
459 | 457 |
460 virtual bool canCollapseAnonymousBlockChild() const { return true; } | |
461 | |
462 LayoutObjectChildList m_children; | 458 LayoutObjectChildList m_children; |
463 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc
k flow. For example, <div>Hello<br>world.</div> will have two total lines for t
he <div>. | 459 LineBoxList m_lineBoxes; // All of the root line boxes created for this bloc
k flow. For example, <div>Hello<br>world.</div> will have two total lines for t
he <div>. |
464 | 460 |
465 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in LayoutBlockRareData since they are set too frequently. | 461 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in LayoutBlockRareData since they are set too frequently. |
466 unsigned m_hasMarginAfterQuirk : 1; | 462 unsigned m_hasMarginAfterQuirk : 1; |
467 unsigned m_beingDestroyed : 1; | 463 unsigned m_beingDestroyed : 1; |
468 unsigned m_hasMarkupTruncation : 1; | 464 unsigned m_hasMarkupTruncation : 1; |
469 unsigned m_widthAvailableToChildrenChanged : 1; | 465 unsigned m_widthAvailableToChildrenChanged : 1; |
470 unsigned m_heightAvailableToChildrenChanged : 1; | 466 unsigned m_heightAvailableToChildrenChanged : 1; |
471 unsigned m_isSelfCollapsing : 1; // True if margin-before and margin-after a
re adjoining. | 467 unsigned m_isSelfCollapsing : 1; // True if margin-before and margin-after a
re adjoining. |
472 unsigned m_descendantsWithFloatsMarkedForLayout : 1; | 468 unsigned m_descendantsWithFloatsMarkedForLayout : 1; |
473 | 469 |
474 unsigned m_hasPositionedObjects : 1; | 470 unsigned m_hasPositionedObjects : 1; |
475 unsigned m_hasPercentHeightDescendants : 1; | 471 unsigned m_hasPercentHeightDescendants : 1; |
476 | 472 |
477 // LayoutRubyBase objects need to be able to split and merge, moving their c
hildren around | 473 // LayoutRubyBase objects need to be able to split and merge, moving their c
hildren around |
478 // (calling moveChildTo, moveAllChildrenTo, and makeChildrenNonInline). | 474 // (calling moveChildTo, moveAllChildrenTo, and makeChildrenNonInline). |
479 friend class LayoutRubyBase; | 475 friend class LayoutRubyBase; |
480 | 476 |
481 // FIXME: This is temporary as we move code that accesses block flow | 477 // FIXME: This is temporary as we move code that accesses block flow |
482 // member variables out of LayoutBlock and into LayoutBlockFlow. | 478 // member variables out of LayoutBlock and into LayoutBlockFlow. |
483 friend class LayoutBlockFlow; | 479 friend class LayoutBlockFlow; |
484 }; | 480 }; |
485 | 481 |
486 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 482 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
487 | 483 |
488 } // namespace blink | 484 } // namespace blink |
489 | 485 |
490 #endif // LayoutBlock_h | 486 #endif // LayoutBlock_h |
OLD | NEW |