OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 // Internet Explorer and Firefox always create a marker for list items,
even when the list-style-type is none. We do not make a marker | 64 // Internet Explorer and Firefox always create a marker for list items,
even when the list-style-type is none. We do not make a marker |
65 // in the list-style-type: none case, since it is wasteful to do so. Ho
wever, in order to match other browsers we have to pretend like | 65 // in the list-style-type: none case, since it is wasteful to do so. Ho
wever, in order to match other browsers we have to pretend like |
66 // an invisible marker exists. The side effect of having an invisible m
arker is that the quirks mode behavior of shrinking lines with no | 66 // an invisible marker exists. The side effect of having an invisible m
arker is that the quirks mode behavior of shrinking lines with no |
67 // text children must not apply. This change also means that gaps will
exist between image bullet list items. Even when the list bullet | 67 // text children must not apply. This change also means that gaps will
exist between image bullet list items. Even when the list bullet |
68 // is an image, the line is still considered to be immune from the quirk
. | 68 // is an image, the line is still considered to be immune from the quirk
. |
69 m_hasTextChildren = obj.style()->display() == LIST_ITEM; | 69 m_hasTextChildren = obj.style()->display() == LIST_ITEM; |
70 m_hasTextDescendants = m_hasTextChildren; | 70 m_hasTextDescendants = m_hasTextChildren; |
71 } | 71 } |
72 | 72 |
73 #if ENABLE(ASSERT) | 73 #if ENABLE(ASSERT) |
74 virtual ~InlineFlowBox(); | 74 ~InlineFlowBox() override; |
75 #endif | 75 #endif |
76 | 76 |
77 #ifndef NDEBUG | 77 #ifndef NDEBUG |
78 virtual void showLineTreeAndMark(const InlineBox* = nullptr, const char* = n
ullptr, const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* =
nullptr, int = 0) const override; | 78 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr,
const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr
, int = 0) const override; |
79 #endif | 79 #endif |
80 virtual const char* boxName() const override; | 80 const char* boxName() const override; |
81 | 81 |
82 InlineFlowBox* prevLineBox() const { return m_prevLineBox; } | 82 InlineFlowBox* prevLineBox() const { return m_prevLineBox; } |
83 InlineFlowBox* nextLineBox() const { return m_nextLineBox; } | 83 InlineFlowBox* nextLineBox() const { return m_nextLineBox; } |
84 void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; } | 84 void setNextLineBox(InlineFlowBox* n) { m_nextLineBox = n; } |
85 void setPreviousLineBox(InlineFlowBox* p) { m_prevLineBox = p; } | 85 void setPreviousLineBox(InlineFlowBox* p) { m_prevLineBox = p; } |
86 | 86 |
87 InlineBox* firstChild() const { checkConsistency(); return m_firstChild; } | 87 InlineBox* firstChild() const { checkConsistency(); return m_firstChild; } |
88 InlineBox* lastChild() const { checkConsistency(); return m_lastChild; } | 88 InlineBox* lastChild() const { checkConsistency(); return m_lastChild; } |
89 | 89 |
90 virtual bool isLeaf() const override final { return false; } | 90 bool isLeaf() const final { return false; } |
91 | 91 |
92 InlineBox* firstLeafChild() const; | 92 InlineBox* firstLeafChild() const; |
93 InlineBox* lastLeafChild() const; | 93 InlineBox* lastLeafChild() const; |
94 | 94 |
95 typedef void (*CustomInlineBoxRangeReverse)(void* userData, Vector<InlineBox
*>::iterator first, Vector<InlineBox*>::iterator last); | 95 typedef void (*CustomInlineBoxRangeReverse)(void* userData, Vector<InlineBox
*>::iterator first, Vector<InlineBox*>::iterator last); |
96 void collectLeafBoxesInLogicalOrder(Vector<InlineBox*>&, CustomInlineBoxRang
eReverse customReverseImplementation = 0, void* userData = nullptr) const; | 96 void collectLeafBoxesInLogicalOrder(Vector<InlineBox*>&, CustomInlineBoxRang
eReverse customReverseImplementation = 0, void* userData = nullptr) const; |
97 | 97 |
98 virtual void setConstructed() override final | 98 void setConstructed() final |
99 { | 99 { |
100 InlineBox::setConstructed(); | 100 InlineBox::setConstructed(); |
101 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()
) | 101 for (InlineBox* child = firstChild(); child; child = child->nextOnLine()
) |
102 child->setConstructed(); | 102 child->setConstructed(); |
103 } | 103 } |
104 | 104 |
105 void addToLine(InlineBox* child); | 105 void addToLine(InlineBox* child); |
106 virtual void deleteLine() override final; | 106 void deleteLine() final; |
107 virtual void extractLine() override final; | 107 void extractLine() final; |
108 virtual void attachLine() override final; | 108 void attachLine() final; |
109 virtual void move(const LayoutSize&) override; | 109 void move(const LayoutSize&) override; |
110 | 110 |
111 virtual void extractLineBoxFromLayoutObject(); | 111 virtual void extractLineBoxFromLayoutObject(); |
112 virtual void attachLineBoxToLayoutObject(); | 112 virtual void attachLineBoxToLayoutObject(); |
113 virtual void removeLineBoxFromLayoutObject(); | 113 virtual void removeLineBoxFromLayoutObject(); |
114 | 114 |
115 virtual void clearTruncation() override; | 115 void clearTruncation() override; |
116 | 116 |
117 IntRect roundedFrameRect() const; | 117 IntRect roundedFrameRect() const; |
118 | 118 |
119 virtual void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop,
LayoutUnit lineBottom) override; | 119 void paint(const PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutU
nit lineBottom) override; |
120 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo
ntainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit li
neBottom) override; | 120 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer,
const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom
) override; |
121 | 121 |
122 bool boxShadowCanBeAppliedToBackground(const FillLayer&) const; | 122 bool boxShadowCanBeAppliedToBackground(const FillLayer&) const; |
123 | 123 |
124 virtual LineBoxList* lineBoxes() const; | 124 virtual LineBoxList* lineBoxes() const; |
125 | 125 |
126 // logicalLeft = left in a horizontal line and top in a vertical line. | 126 // logicalLeft = left in a horizontal line and top in a vertical line. |
127 LayoutUnit marginBorderPaddingLogicalLeft() const { return marginLogicalLeft
() + borderLogicalLeft() + paddingLogicalLeft(); } | 127 LayoutUnit marginBorderPaddingLogicalLeft() const { return marginLogicalLeft
() + borderLogicalLeft() + paddingLogicalLeft(); } |
128 LayoutUnit marginBorderPaddingLogicalRight() const { return marginLogicalRig
ht() + borderLogicalRight() + paddingLogicalRight(); } | 128 LayoutUnit marginBorderPaddingLogicalRight() const { return marginLogicalRig
ht() + borderLogicalRight() + paddingLogicalRight(); } |
129 LayoutUnit marginLogicalLeft() const | 129 LayoutUnit marginLogicalLeft() const |
130 { | 130 { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lineBottom); | 191 void flipLinesInBlockDirection(LayoutUnit lineTop, LayoutUnit lineBottom); |
192 FontBaseline dominantBaseline() const; | 192 FontBaseline dominantBaseline() const; |
193 | 193 |
194 LayoutUnit computeOverAnnotationAdjustment(LayoutUnit allowedPosition) const
; | 194 LayoutUnit computeOverAnnotationAdjustment(LayoutUnit allowedPosition) const
; |
195 LayoutUnit computeUnderAnnotationAdjustment(LayoutUnit allowedPosition) cons
t; | 195 LayoutUnit computeUnderAnnotationAdjustment(LayoutUnit allowedPosition) cons
t; |
196 | 196 |
197 void computeOverflow(LayoutUnit lineTop, LayoutUnit lineBottom, GlyphOverflo
wAndFallbackFontsMap&); | 197 void computeOverflow(LayoutUnit lineTop, LayoutUnit lineBottom, GlyphOverflo
wAndFallbackFontsMap&); |
198 | 198 |
199 void removeChild(InlineBox* child, MarkLineBoxes); | 199 void removeChild(InlineBox* child, MarkLineBoxes); |
200 | 200 |
201 virtual LayoutObject::SelectionState selectionState() const override; | 201 LayoutObject::SelectionState selectionState() const override; |
202 | 202 |
203 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid
th) const override final; | 203 bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWidth) cons
t final; |
204 virtual LayoutUnit placeEllipsisBox(bool ltr, LayoutUnit blockLeftEdge, Layo
utUnit blockRightEdge, LayoutUnit ellipsisWidth, LayoutUnit &truncatedWidth, boo
l&) override; | 204 LayoutUnit placeEllipsisBox(bool ltr, LayoutUnit blockLeftEdge, LayoutUnit b
lockRightEdge, LayoutUnit ellipsisWidth, LayoutUnit &truncatedWidth, bool&) over
ride; |
205 | 205 |
206 bool hasTextChildren() const { return m_hasTextChildren; } | 206 bool hasTextChildren() const { return m_hasTextChildren; } |
207 bool hasTextDescendants() const { return m_hasTextDescendants; } | 207 bool hasTextDescendants() const { return m_hasTextDescendants; } |
208 void setHasTextDescendants() { m_hasTextDescendants = true; } | 208 void setHasTextDescendants() { m_hasTextDescendants = true; } |
209 | 209 |
210 void checkConsistency() const; | 210 void checkConsistency() const; |
211 void setHasBadChildList(); | 211 void setHasBadChildList(); |
212 | 212 |
213 // Line visual and layout overflow are in the coordinate space of the block.
This means that they aren't purely physical directions. | 213 // Line visual and layout overflow are in the coordinate space of the block.
This means that they aren't purely physical directions. |
214 // For horizontal-tb and vertical-lr they will match physical directions, bu
t for horizontal-bt and vertical-rl, the top/bottom and left/right | 214 // For horizontal-tb and vertical-lr they will match physical directions, bu
t for horizontal-bt and vertical-rl, the top/bottom and left/right |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); | 294 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); |
295 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM
ap&, LayoutRect& logicalVisualOverflow); | 295 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM
ap&, LayoutRect& logicalVisualOverflow); |
296 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve
rflow, LayoutRect& logicalVisualOverflow); | 296 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve
rflow, LayoutRect& logicalVisualOverflow); |
297 | 297 |
298 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); | 298 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); |
299 void setVisualOverflow(const LayoutRect&, const LayoutRect&); | 299 void setVisualOverflow(const LayoutRect&, const LayoutRect&); |
300 | 300 |
301 protected: | 301 protected: |
302 OwnPtr<OverflowModel> m_overflow; | 302 OwnPtr<OverflowModel> m_overflow; |
303 | 303 |
304 virtual bool isInlineFlowBox() const override final { return true; } | 304 bool isInlineFlowBox() const final { return true; } |
305 | 305 |
306 InlineBox* m_firstChild; | 306 InlineBox* m_firstChild; |
307 InlineBox* m_lastChild; | 307 InlineBox* m_lastChild; |
308 | 308 |
309 InlineFlowBox* m_prevLineBox; // The previous box that also uses our LayoutO
bject | 309 InlineFlowBox* m_prevLineBox; // The previous box that also uses our LayoutO
bject |
310 InlineFlowBox* m_nextLineBox; // The next box that also uses our LayoutObjec
t | 310 InlineFlowBox* m_nextLineBox; // The next box that also uses our LayoutObjec
t |
311 | 311 |
312 // Maximum logicalTop among all children of an InlineFlowBox. Used to | 312 // Maximum logicalTop among all children of an InlineFlowBox. Used to |
313 // calculate the offset for TextUnderlinePositionUnder. | 313 // calculate the offset for TextUnderlinePositionUnder. |
314 void computeMaxLogicalTop(LayoutUnit& maxLogicalTop) const; | 314 void computeMaxLogicalTop(LayoutUnit& maxLogicalTop) const; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 } | 360 } |
361 | 361 |
362 } // namespace blink | 362 } // namespace blink |
363 | 363 |
364 #ifndef NDEBUG | 364 #ifndef NDEBUG |
365 // Outside the WebCore namespace for ease of invocation from gdb. | 365 // Outside the WebCore namespace for ease of invocation from gdb. |
366 void showTree(const blink::InlineFlowBox*); | 366 void showTree(const blink::InlineFlowBox*); |
367 #endif | 367 #endif |
368 | 368 |
369 #endif // InlineFlowBox_h | 369 #endif // InlineFlowBox_h |
OLD | NEW |