| 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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 LayoutMultiColumnSpannerPlaceholder* m_spannerPlaceholder; | 74 LayoutMultiColumnSpannerPlaceholder* m_spannerPlaceholder; |
| 75 | 75 |
| 76 LayoutUnit m_overrideLogicalContentWidth; | 76 LayoutUnit m_overrideLogicalContentWidth; |
| 77 LayoutUnit m_overrideLogicalContentHeight; | 77 LayoutUnit m_overrideLogicalContentHeight; |
| 78 | 78 |
| 79 bool m_hasOverrideContainingBlockContentLogicalWidth; | 79 bool m_hasOverrideContainingBlockContentLogicalWidth; |
| 80 bool m_hasOverrideContainingBlockContentLogicalHeight; | 80 bool m_hasOverrideContainingBlockContentLogicalHeight; |
| 81 LayoutUnit m_overrideContainingBlockContentLogicalWidth; | 81 LayoutUnit m_overrideContainingBlockContentLogicalWidth; |
| 82 LayoutUnit m_overrideContainingBlockContentLogicalHeight; | 82 LayoutUnit m_overrideContainingBlockContentLogicalHeight; |
| 83 | 83 |
| 84 LayoutUnit m_pageLogicalOffset; | 84 LayoutUnit m_offsetToNextPage; |
| 85 |
| 85 LayoutUnit m_paginationStrut; | 86 LayoutUnit m_paginationStrut; |
| 86 | 87 |
| 87 LayoutBlock* m_percentHeightContainer; | 88 LayoutBlock* m_percentHeightContainer; |
| 88 // For snap area, the owning snap container. | 89 // For snap area, the owning snap container. |
| 89 LayoutBox* m_snapContainer; | 90 LayoutBox* m_snapContainer; |
| 90 // For snap container, the descendant snap areas that contribute snap | 91 // For snap container, the descendant snap areas that contribute snap |
| 91 // points. | 92 // points. |
| 92 std::unique_ptr<SnapAreaSet> m_snapAreas; | 93 std::unique_ptr<SnapAreaSet> m_snapAreas; |
| 93 | 94 |
| 94 SnapAreaSet& ensureSnapAreas() { | 95 SnapAreaSet& ensureSnapAreas() { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 244 } |
| 244 LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); } | 245 LayoutUnit logicalBottom() const { return logicalTop() + logicalHeight(); } |
| 245 LayoutUnit logicalWidth() const { | 246 LayoutUnit logicalWidth() const { |
| 246 return style()->isHorizontalWritingMode() ? m_frameRect.width() | 247 return style()->isHorizontalWritingMode() ? m_frameRect.width() |
| 247 : m_frameRect.height(); | 248 : m_frameRect.height(); |
| 248 } | 249 } |
| 249 LayoutUnit logicalHeight() const { | 250 LayoutUnit logicalHeight() const { |
| 250 return style()->isHorizontalWritingMode() ? m_frameRect.height() | 251 return style()->isHorizontalWritingMode() ? m_frameRect.height() |
| 251 : m_frameRect.width(); | 252 : m_frameRect.width(); |
| 252 } | 253 } |
| 254 LayoutUnit logicalHeightIncludingOverflow() const; |
| 253 | 255 |
| 254 LayoutUnit constrainLogicalWidthByMinMax(LayoutUnit, | 256 LayoutUnit constrainLogicalWidthByMinMax(LayoutUnit, |
| 255 LayoutUnit, | 257 LayoutUnit, |
| 256 LayoutBlock*) const; | 258 LayoutBlock*) const; |
| 257 LayoutUnit constrainLogicalHeightByMinMax( | 259 LayoutUnit constrainLogicalHeightByMinMax( |
| 258 LayoutUnit logicalHeight, | 260 LayoutUnit logicalHeight, |
| 259 LayoutUnit intrinsicContentHeight) const; | 261 LayoutUnit intrinsicContentHeight) const; |
| 260 LayoutUnit constrainContentBoxLogicalHeightByMinMax( | 262 LayoutUnit constrainContentBoxLogicalHeightByMinMax( |
| 261 LayoutUnit logicalHeight, | 263 LayoutUnit logicalHeight, |
| 262 LayoutUnit intrinsicContentHeight) const; | 264 LayoutUnit intrinsicContentHeight) const; |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 LayoutUnit& marginStart, | 757 LayoutUnit& marginStart, |
| 756 LayoutUnit& marginEnd, | 758 LayoutUnit& marginEnd, |
| 757 Length marginStartLength, | 759 Length marginStartLength, |
| 758 Length marginStartEnd) const; | 760 Length marginStartEnd) const; |
| 759 | 761 |
| 760 // Used to resolve margins in the containing block's block-flow direction. | 762 // Used to resolve margins in the containing block's block-flow direction. |
| 761 void computeAndSetBlockDirectionMargins(const LayoutBlock* containingBlock); | 763 void computeAndSetBlockDirectionMargins(const LayoutBlock* containingBlock); |
| 762 | 764 |
| 763 LayoutUnit offsetFromLogicalTopOfFirstPage() const; | 765 LayoutUnit offsetFromLogicalTopOfFirstPage() const; |
| 764 | 766 |
| 765 // The page logical offset is the object's offset from the top of the page in | 767 // The block offset from the logical top of this object to the end of the |
| 766 // the page progression direction (so an x-offset in vertical text and a | 768 // first fragmentainer it lives in. If it only lives in one fragmentainer, 0 |
| 767 // y-offset for horizontal text). | 769 // is returned. |
| 768 LayoutUnit pageLogicalOffset() const { | 770 LayoutUnit offsetToNextPage() const { |
| 769 return m_rareData ? m_rareData->m_pageLogicalOffset : LayoutUnit(); | 771 return m_rareData ? m_rareData->m_offsetToNextPage : LayoutUnit(); |
| 770 } | 772 } |
| 771 void setPageLogicalOffset(LayoutUnit); | 773 void setOffsetToNextPage(LayoutUnit); |
| 772 | 774 |
| 773 // Specify which page or column to associate with an offset, if said offset is | 775 // Specify which page or column to associate with an offset, if said offset is |
| 774 // exactly at a page or column boundary. | 776 // exactly at a page or column boundary. |
| 775 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage }; | 777 enum PageBoundaryRule { AssociateWithFormerPage, AssociateWithLatterPage }; |
| 776 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const; | 778 LayoutUnit pageLogicalHeightForOffset(LayoutUnit) const; |
| 777 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, | 779 LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit, |
| 778 PageBoundaryRule) const; | 780 PageBoundaryRule) const; |
| 781 |
| 779 bool crossesPageBoundary(LayoutUnit offset, LayoutUnit logicalHeight) const; | 782 bool crossesPageBoundary(LayoutUnit offset, LayoutUnit logicalHeight) const; |
| 780 | 783 |
| 781 // Calculate the strut to insert in order fit content of size | 784 // Calculate the strut to insert in order fit content of size |
| 782 // |contentLogicalHeight|. |strutToNextPage| is the strut to add to |offset| | 785 // |contentLogicalHeight|. |strutToNextPage| is the strut to add to |offset| |
| 783 // to merely get to the top of the next page or column. This is what will be | 786 // to merely get to the top of the next page or column. This is what will be |
| 784 // returned if the content can actually fit there. Otherwise, return the | 787 // returned if the content can actually fit there. Otherwise, return the |
| 785 // distance to the next fragmentainer that can fit this piece of content. | 788 // distance to the next fragmentainer that can fit this piece of content. |
| 786 virtual LayoutUnit calculatePaginationStrutToFitContent( | 789 virtual LayoutUnit calculatePaginationStrutToFitContent( |
| 787 LayoutUnit offset, | 790 LayoutUnit offset, |
| 788 LayoutUnit strutToNextPage, | 791 LayoutUnit strutToNextPage, |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 virtual int inlineBlockBaseline(LineDirectionMode) const { | 1088 virtual int inlineBlockBaseline(LineDirectionMode) const { |
| 1086 return -1; | 1089 return -1; |
| 1087 } // Returns -1 if we should skip this box when computing the baseline of an | 1090 } // Returns -1 if we should skip this box when computing the baseline of an |
| 1088 // inline-block. | 1091 // inline-block. |
| 1089 | 1092 |
| 1090 virtual Node* nodeForHitTest() const { return node(); } | 1093 virtual Node* nodeForHitTest() const { return node(); } |
| 1091 | 1094 |
| 1092 bool shrinkToAvoidFloats() const; | 1095 bool shrinkToAvoidFloats() const; |
| 1093 virtual bool avoidsFloats() const; | 1096 virtual bool avoidsFloats() const; |
| 1094 | 1097 |
| 1098 void updateFragmentationInfoForChild(LayoutBox& child); |
| 1099 |
| 1095 void markChildForPaginationRelayoutIfNeeded(LayoutBox& child, | 1100 void markChildForPaginationRelayoutIfNeeded(LayoutBox& child, |
| 1096 SubtreeLayoutScope&); | 1101 SubtreeLayoutScope&); |
| 1097 | 1102 |
| 1098 bool isWritingModeRoot() const { | 1103 bool isWritingModeRoot() const { |
| 1099 return !parent() || | 1104 return !parent() || |
| 1100 parent()->style()->getWritingMode() != style()->getWritingMode(); | 1105 parent()->style()->getWritingMode() != style()->getWritingMode(); |
| 1101 } | 1106 } |
| 1102 bool isOrthogonalWritingModeRoot() const { | 1107 bool isOrthogonalWritingModeRoot() const { |
| 1103 return parent() && | 1108 return parent() && |
| 1104 parent()->isHorizontalWritingMode() != isHorizontalWritingMode(); | 1109 parent()->isHorizontalWritingMode() != isHorizontalWritingMode(); |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1615 | 1620 |
| 1616 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) { | 1621 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) { |
| 1617 return breakValue == BreakColumn || breakValue == BreakLeft || | 1622 return breakValue == BreakColumn || breakValue == BreakLeft || |
| 1618 breakValue == BreakPage || breakValue == BreakRecto || | 1623 breakValue == BreakPage || breakValue == BreakRecto || |
| 1619 breakValue == BreakRight || breakValue == BreakVerso; | 1624 breakValue == BreakRight || breakValue == BreakVerso; |
| 1620 } | 1625 } |
| 1621 | 1626 |
| 1622 } // namespace blink | 1627 } // namespace blink |
| 1623 | 1628 |
| 1624 #endif // LayoutBox_h | 1629 #endif // LayoutBox_h |
| OLD | NEW |