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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #ifndef LayoutBlock_h | 23 #ifndef LayoutBlock_h |
24 #define LayoutBlock_h | 24 #define LayoutBlock_h |
25 | 25 |
26 #include "core/CoreExport.h" | 26 #include "core/CoreExport.h" |
27 #include "core/layout/FloatingObjects.h" | 27 #include "core/layout/FloatingObjects.h" |
28 #include "core/layout/GapRects.h" | 28 #include "core/layout/GapRects.h" |
29 #include "core/layout/LayoutBox.h" | 29 #include "core/layout/LayoutBox.h" |
30 #include "core/layout/api/LineLayoutItem.h" | |
31 #include "core/layout/line/LineBoxList.h" | |
32 #include "core/layout/line/RootInlineBox.h" | |
33 #include "core/style/ShapeValue.h" | 30 #include "core/style/ShapeValue.h" |
34 #include "platform/text/TextBreakIterator.h" | 31 #include "platform/text/TextBreakIterator.h" |
35 #include "wtf/ListHashSet.h" | 32 #include "wtf/ListHashSet.h" |
36 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
37 | 34 |
38 namespace blink { | 35 namespace blink { |
39 | 36 |
40 class LineLayoutState; | 37 class LineLayoutState; |
41 struct PaintInfo; | 38 struct PaintInfo; |
42 class LayoutInline; | 39 class LayoutInline; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 LayoutObjectChildList* children() { return &m_children; } | 122 LayoutObjectChildList* children() { return &m_children; } |
126 | 123 |
127 // These two functions are overridden for inline-block. | 124 // These two functions are overridden for inline-block. |
128 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode =
PositionOnContainingLine) const final; | 125 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode =
PositionOnContainingLine) const final; |
129 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePo
sitionMode = PositionOnContainingLine) const override; | 126 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePo
sitionMode = PositionOnContainingLine) const override; |
130 | 127 |
131 LayoutUnit minLineHeightForReplacedObject(bool isFirstLine, LayoutUnit repla
cedHeight) const; | 128 LayoutUnit minLineHeightForReplacedObject(bool isFirstLine, LayoutUnit repla
cedHeight) const; |
132 | 129 |
133 bool createsNewFormattingContext() const; | 130 bool createsNewFormattingContext() const; |
134 | 131 |
135 const LineBoxList& lineBoxes() const { return m_lineBoxes; } | |
136 LineBoxList* lineBoxes() { return &m_lineBoxes; } | |
137 | |
138 const char* name() const override; | 132 const char* name() const override; |
139 | 133 |
140 protected: | 134 protected: |
141 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } | |
142 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } | |
143 | |
144 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } | |
145 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } | |
146 | |
147 // Insert a child correctly into the tree when |beforeDescendant| isn't a di
rect child of | 135 // Insert a child correctly into the tree when |beforeDescendant| isn't a di
rect child of |
148 // |this|. This happens e.g. when there's an anonymous block child of |this|
and | 136 // |this|. This happens e.g. when there's an anonymous block child of |this|
and |
149 // |beforeDescendant| has been reparented into that one. Such things are inv
isible to the DOM, | 137 // |beforeDescendant| has been reparented into that one. Such things are inv
isible to the DOM, |
150 // and addChild() is typically called with the DOM tree (and not the layout
tree) in mind. | 138 // and addChild() is typically called with the DOM tree (and not the layout
tree) in mind. |
151 void addChildBeforeDescendant(LayoutObject* newChild, LayoutObject* beforeDe
scendant); | 139 void addChildBeforeDescendant(LayoutObject* newChild, LayoutObject* beforeDe
scendant); |
152 | 140 |
153 public: | 141 public: |
154 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow | 142 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow |
155 virtual void deleteLineBoxTree(); | 143 virtual void deleteLineBoxTree(); |
156 | 144 |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 430 |
443 // Adjust from painting offsets to the local coords of this layoutObject | 431 // Adjust from painting offsets to the local coords of this layoutObject |
444 void offsetForContents(LayoutPoint&) const; | 432 void offsetForContents(LayoutPoint&) const; |
445 | 433 |
446 PositionWithAffinity positionForPointRespectingEditingBoundaries(LineLayoutB
ox child, const LayoutPoint& pointInParentCoordinates); | 434 PositionWithAffinity positionForPointRespectingEditingBoundaries(LineLayoutB
ox child, const LayoutPoint& pointInParentCoordinates); |
447 PositionWithAffinity positionForPointIfOutsideAtomicInlineLevel(const Layout
Point&); | 435 PositionWithAffinity positionForPointIfOutsideAtomicInlineLevel(const Layout
Point&); |
448 | 436 |
449 virtual bool updateLogicalWidthAndColumnWidth(); | 437 virtual bool updateLogicalWidthAndColumnWidth(); |
450 | 438 |
451 LayoutObjectChildList m_children; | 439 LayoutObjectChildList m_children; |
452 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>. | |
453 | 440 |
454 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in LayoutBlockRareData since they are set too frequently. | 441 unsigned m_hasMarginBeforeQuirk : 1; // Note these quirk values can't be put
in LayoutBlockRareData since they are set too frequently. |
455 unsigned m_hasMarginAfterQuirk : 1; | 442 unsigned m_hasMarginAfterQuirk : 1; |
456 unsigned m_beingDestroyed : 1; | 443 unsigned m_beingDestroyed : 1; |
457 unsigned m_hasMarkupTruncation : 1; | 444 unsigned m_hasMarkupTruncation : 1; |
458 unsigned m_widthAvailableToChildrenChanged : 1; | 445 unsigned m_widthAvailableToChildrenChanged : 1; |
459 unsigned m_heightAvailableToChildrenChanged : 1; | 446 unsigned m_heightAvailableToChildrenChanged : 1; |
460 unsigned m_isSelfCollapsing : 1; // True if margin-before and margin-after a
re adjoining. | 447 unsigned m_isSelfCollapsing : 1; // True if margin-before and margin-after a
re adjoining. |
461 unsigned m_descendantsWithFloatsMarkedForLayout : 1; | 448 unsigned m_descendantsWithFloatsMarkedForLayout : 1; |
462 | 449 |
463 unsigned m_hasPositionedObjects : 1; | 450 unsigned m_hasPositionedObjects : 1; |
464 unsigned m_hasPercentHeightDescendants : 1; | 451 unsigned m_hasPercentHeightDescendants : 1; |
465 | 452 |
466 // FIXME: This is temporary as we move code that accesses block flow | 453 // FIXME: This is temporary as we move code that accesses block flow |
467 // member variables out of LayoutBlock and into LayoutBlockFlow. | 454 // member variables out of LayoutBlock and into LayoutBlockFlow. |
468 friend class LayoutBlockFlow; | 455 friend class LayoutBlockFlow; |
469 }; | 456 }; |
470 | 457 |
471 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 458 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
472 | 459 |
473 } // namespace blink | 460 } // namespace blink |
474 | 461 |
475 #endif // LayoutBlock_h | 462 #endif // LayoutBlock_h |
OLD | NEW |