Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.h

Issue 1993943002: Move m_lineBoxes and its getters down to LayoutBlockFlow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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-2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2003-2013 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * Copyright (C) 2013 Google Inc. All rights reserved. 7 * Copyright (C) 2013 Google Inc. All rights reserved.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are 10 * modification, are permitted provided that the following conditions are
(...skipping 21 matching lines...) Expand all
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */ 34 */
35 35
36 #ifndef LayoutBlockFlow_h 36 #ifndef LayoutBlockFlow_h
37 #define LayoutBlockFlow_h 37 #define LayoutBlockFlow_h
38 38
39 #include "core/CoreExport.h" 39 #include "core/CoreExport.h"
40 #include "core/layout/FloatingObjects.h" 40 #include "core/layout/FloatingObjects.h"
41 #include "core/layout/LayoutBlock.h" 41 #include "core/layout/LayoutBlock.h"
42 #include "core/layout/api/LineLayoutItem.h"
43 #include "core/layout/line/LineBoxList.h"
44 #include "core/layout/line/RootInlineBox.h"
42 #include "core/layout/line/TrailingObjects.h" 45 #include "core/layout/line/TrailingObjects.h"
43 #include "core/style/ComputedStyleConstants.h" 46 #include "core/style/ComputedStyleConstants.h"
44 47
45 namespace blink { 48 namespace blink {
46 49
47 class BlockChildrenLayoutInfo; 50 class BlockChildrenLayoutInfo;
48 class ClipScope; 51 class ClipScope;
49 class MarginInfo; 52 class MarginInfo;
50 class LineBreaker; 53 class LineBreaker;
51 class LineInfo; 54 class LineInfo;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 { 120 {
118 return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(posi tion, indentText, logicalHeight) 121 return style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(posi tion, indentText, logicalHeight)
119 : logicalWidth() - logicalRightOffsetForLine(position, indentText, l ogicalHeight); 122 : logicalWidth() - logicalRightOffsetForLine(position, indentText, l ogicalHeight);
120 } 123 }
121 LayoutUnit endOffsetForLine(LayoutUnit position, IndentTextOrNot indentText, LayoutUnit logicalHeight = LayoutUnit()) const 124 LayoutUnit endOffsetForLine(LayoutUnit position, IndentTextOrNot indentText, LayoutUnit logicalHeight = LayoutUnit()) const
122 { 125 {
123 return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(pos ition, indentText, logicalHeight) 126 return !style()->isLeftToRightDirection() ? logicalLeftOffsetForLine(pos ition, indentText, logicalHeight)
124 : logicalWidth() - logicalRightOffsetForLine(position, indentText, l ogicalHeight); 127 : logicalWidth() - logicalRightOffsetForLine(position, indentText, l ogicalHeight);
125 } 128 }
126 129
127 // FIXME-BLOCKFLOW: Move this into LayoutBlockFlow once there are no calls 130 const LineBoxList& lineBoxes() const { return m_lineBoxes; }
128 // in LayoutBlock. http://crbug.com/393945, http://crbug.com/302024 131 LineBoxList* lineBoxes() { return &m_lineBoxes; }
129 using LayoutBlock::lineBoxes; 132 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); }
130 using LayoutBlock::firstLineBox; 133 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); }
131 using LayoutBlock::lastLineBox; 134 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir stLineBox()); }
132 using LayoutBlock::firstRootBox; 135 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last LineBox()); }
133 using LayoutBlock::lastRootBox;
134 136
135 LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUn it position) const override; 137 LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUn it position) const override;
136 LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutU nit position) const override; 138 LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutU nit position) const override;
137 139
138 RootInlineBox* createAndAppendRootInlineBox(); 140 RootInlineBox* createAndAppendRootInlineBox();
139 141
140 // Return the number of lines in *this* block flow. Does not recurse into bl ock flow children. 142 // Return the number of lines in *this* block flow. Does not recurse into bl ock flow children.
141 // Will start counting from the first line, and stop counting right after |s topRootInlineBox|, 143 // Will start counting from the first line, and stop counting right after |s topRootInlineBox|,
142 // if specified. 144 // if specified.
143 int lineCount(const RootInlineBox* stopRootInlineBox = nullptr) const; 145 int lineCount(const RootInlineBox* stopRootInlineBox = nullptr) const;
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 603
602 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTop, LayoutBox& c hild, BlockChildrenLayoutInfo&, bool atBeforeSideOfBlock); 604 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTop, LayoutBox& c hild, BlockChildrenLayoutInfo&, bool atBeforeSideOfBlock);
603 // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page. 605 // Computes a deltaOffset value that put a line at the top of the next page if it doesn't fit on the current page.
604 void adjustLinePositionForPagination(RootInlineBox&, LayoutUnit& deltaOffset ); 606 void adjustLinePositionForPagination(RootInlineBox&, LayoutUnit& deltaOffset );
605 // If the child is unsplittable and can't fit on the current page, return th e top of the next page/column. 607 // If the child is unsplittable and can't fit on the current page, return th e top of the next page/column.
606 LayoutUnit adjustForUnsplittableChild(LayoutBox&, LayoutUnit logicalOffset) const; 608 LayoutUnit adjustForUnsplittableChild(LayoutBox&, LayoutUnit logicalOffset) const;
607 609
608 // Used to store state between styleWillChange and styleDidChange 610 // Used to store state between styleWillChange and styleDidChange
609 static bool s_canPropagateFloatIntoSibling; 611 static bool s_canPropagateFloatIntoSibling;
610 612
613 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>.
614
611 LayoutBlockFlowRareData& ensureRareData(); 615 LayoutBlockFlowRareData& ensureRareData();
612 616
613 LayoutUnit m_paintInvalidationLogicalTop; 617 LayoutUnit m_paintInvalidationLogicalTop;
614 LayoutUnit m_paintInvalidationLogicalBottom; 618 LayoutUnit m_paintInvalidationLogicalBottom;
615 619
616 bool isSelfCollapsingBlock() const override; 620 bool isSelfCollapsingBlock() const override;
617 bool checkIfIsSelfCollapsingBlock() const; 621 bool checkIfIsSelfCollapsingBlock() const;
618 622
619 protected: 623 protected:
620 OwnPtr<LayoutBlockFlowRareData> m_rareData; 624 OwnPtr<LayoutBlockFlowRareData> m_rareData;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 668
665 // END METHODS DEFINED IN LayoutBlockFlowLine 669 // END METHODS DEFINED IN LayoutBlockFlowLine
666 670
667 }; 671 };
668 672
669 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow()); 673 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow());
670 674
671 } // namespace blink 675 } // namespace blink
672 676
673 #endif // LayoutBlockFlow_h 677 #endif // LayoutBlockFlow_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698