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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 typedef WTF::HashMap<LayoutBlock*, OwnPtr<ListHashSet<LayoutInline*>>> Continuat
ionOutlineTableMap; | 51 typedef WTF::HashMap<LayoutBlock*, OwnPtr<ListHashSet<LayoutInline*>>> Continuat
ionOutlineTableMap; |
52 | 52 |
53 ContinuationOutlineTableMap* continuationOutlineTable(); | 53 ContinuationOutlineTableMap* continuationOutlineTable(); |
54 | 54 |
55 class CORE_EXPORT LayoutBlock : public LayoutBox { | 55 class CORE_EXPORT LayoutBlock : public LayoutBox { |
56 public: | 56 public: |
57 friend class LineLayoutState; | 57 friend class LineLayoutState; |
58 | 58 |
59 protected: | 59 protected: |
60 explicit LayoutBlock(ContainerNode*); | 60 explicit LayoutBlock(ContainerNode*); |
61 virtual ~LayoutBlock(); | 61 ~LayoutBlock() override; |
62 | 62 |
63 public: | 63 public: |
64 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 64 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
65 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | 65 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } |
66 | 66 |
67 // If you have a LayoutBlock, use firstChild or lastChild instead. | 67 // If you have a LayoutBlock, use firstChild or lastChild instead. |
68 void slowFirstChild() const = delete; | 68 void slowFirstChild() const = delete; |
69 void slowLastChild() const = delete; | 69 void slowLastChild() const = delete; |
70 | 70 |
71 const LayoutObjectChildList* children() const { return &m_children; } | 71 const LayoutObjectChildList* children() const { return &m_children; } |
72 LayoutObjectChildList* children() { return &m_children; } | 72 LayoutObjectChildList* children() { return &m_children; } |
73 | 73 |
74 bool beingDestroyed() const { return m_beingDestroyed; } | 74 bool beingDestroyed() const { return m_beingDestroyed; } |
75 | 75 |
76 // These two functions are overridden for inline-block. | 76 // These two functions are overridden for inline-block. |
77 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const override final; | 77 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode =
PositionOnContainingLine) const final; |
78 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const override; | 78 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePo
sitionMode = PositionOnContainingLine) const override; |
79 | 79 |
80 LayoutUnit minLineHeightForReplacedObject(bool isFirstLine, LayoutUnit repla
cedHeight) const; | 80 LayoutUnit minLineHeightForReplacedObject(bool isFirstLine, LayoutUnit repla
cedHeight) const; |
81 | 81 |
82 LineBoxList* lineBoxes() { return &m_lineBoxes; } | 82 LineBoxList* lineBoxes() { return &m_lineBoxes; } |
83 | 83 |
84 virtual const char* name() const override; | 84 const char* name() const override; |
85 | 85 |
86 protected: | 86 protected: |
87 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } | 87 InlineFlowBox* firstLineBox() const { return m_lineBoxes.firstLineBox(); } |
88 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } | 88 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } |
89 | 89 |
90 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } | 90 RootInlineBox* firstRootBox() const { return static_cast<RootInlineBox*>(fir
stLineBox()); } |
91 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } | 91 RootInlineBox* lastRootBox() const { return static_cast<RootInlineBox*>(last
LineBox()); } |
92 | 92 |
93 public: | 93 public: |
94 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow | 94 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow |
95 virtual void deleteLineBoxTree(); | 95 virtual void deleteLineBoxTree(); |
96 | 96 |
97 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nu
llptr) override; | 97 void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nullptr) o
verride; |
98 virtual void removeChild(LayoutObject*) override; | 98 void removeChild(LayoutObject*) override; |
99 | 99 |
100 virtual void layoutBlock(bool relayoutChildren); | 100 virtual void layoutBlock(bool relayoutChildren); |
101 | 101 |
102 void insertPositionedObject(LayoutBox*); | 102 void insertPositionedObject(LayoutBox*); |
103 static void removePositionedObject(LayoutBox*); | 103 static void removePositionedObject(LayoutBox*); |
104 void removePositionedObjects(LayoutBlock*, ContainingBlockState = SameContai
ningBlock); | 104 void removePositionedObjects(LayoutBlock*, ContainingBlockState = SameContai
ningBlock); |
105 | 105 |
106 TrackedLayoutBoxListHashSet* positionedObjects() const; | 106 TrackedLayoutBoxListHashSet* positionedObjects() const; |
107 bool hasPositionedObjects() const | 107 bool hasPositionedObjects() const |
108 { | 108 { |
(...skipping 25 matching lines...) Expand all Loading... |
134 | 134 |
135 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } | 135 bool hasMarginBeforeQuirk() const { return m_hasMarginBeforeQuirk; } |
136 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } | 136 bool hasMarginAfterQuirk() const { return m_hasMarginAfterQuirk; } |
137 | 137 |
138 bool hasMarginBeforeQuirk(const LayoutBox* child) const; | 138 bool hasMarginBeforeQuirk(const LayoutBox* child) const; |
139 bool hasMarginAfterQuirk(const LayoutBox* child) const; | 139 bool hasMarginAfterQuirk(const LayoutBox* child) const; |
140 | 140 |
141 void markPositionedObjectsForLayout(); | 141 void markPositionedObjectsForLayout(); |
142 // FIXME: Do we really need this to be virtual? It's just so we can call thi
s on | 142 // FIXME: Do we really need this to be virtual? It's just so we can call thi
s on |
143 // LayoutBoxes without needed to check whether they're LayoutBlocks first. | 143 // LayoutBoxes without needed to check whether they're LayoutBlocks first. |
144 virtual void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&) override
final; | 144 void markForPaginationRelayoutIfNeeded(SubtreeLayoutScope&) final; |
145 | 145 |
146 LayoutUnit textIndentOffset() const; | 146 LayoutUnit textIndentOffset() const; |
147 | 147 |
148 virtual PositionWithAffinity positionForPoint(const LayoutPoint&) override; | 148 PositionWithAffinity positionForPoint(const LayoutPoint&) override; |
149 | 149 |
150 LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const; | 150 LayoutUnit blockDirectionOffset(const LayoutSize& offsetFromBlock) const; |
151 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; | 151 LayoutUnit inlineDirectionOffset(const LayoutSize& offsetFromBlock) const; |
152 | 152 |
153 LayoutBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; | 153 LayoutBlock* blockBeforeWithinSelectionRoot(LayoutSize& offset) const; |
154 | 154 |
155 virtual void setSelectionState(SelectionState) override; | 155 void setSelectionState(SelectionState) override; |
156 | 156 |
157 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; | 157 LayoutRect logicalRectToPhysicalRect(const LayoutPoint& physicalPosition, co
nst LayoutRect& logicalRect) const; |
158 | 158 |
159 // Helper methods for computing line counts and heights for line counts. | 159 // Helper methods for computing line counts and heights for line counts. |
160 RootInlineBox* lineAtIndex(int) const; | 160 RootInlineBox* lineAtIndex(int) const; |
161 int lineCount(const RootInlineBox* = nullptr, bool* = nullptr) const; | 161 int lineCount(const RootInlineBox* = nullptr, bool* = nullptr) const; |
162 int heightForLineCount(int); | 162 int heightForLineCount(int); |
163 void clearTruncation(); | 163 void clearTruncation(); |
164 | 164 |
165 void addContinuationWithOutline(LayoutInline*); | 165 void addContinuationWithOutline(LayoutInline*); |
166 | 166 |
167 virtual LayoutBoxModelObject* virtualContinuation() const override final { r
eturn continuation(); } | 167 LayoutBoxModelObject* virtualContinuation() const final { return continuatio
n(); } |
168 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } | 168 bool isAnonymousBlockContinuation() const { return continuation() && isAnony
mousBlock(); } |
169 LayoutInline* inlineElementContinuation() const; | 169 LayoutInline* inlineElementContinuation() const; |
170 | 170 |
171 using LayoutBoxModelObject::continuation; | 171 using LayoutBoxModelObject::continuation; |
172 using LayoutBoxModelObject::setContinuation; | 172 using LayoutBoxModelObject::setContinuation; |
173 | 173 |
174 static LayoutBlock* createAnonymousWithParentAndDisplay(const LayoutObject*,
EDisplay = BLOCK); | 174 static LayoutBlock* createAnonymousWithParentAndDisplay(const LayoutObject*,
EDisplay = BLOCK); |
175 LayoutBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentAndDisplay(this, display); } | 175 LayoutBlock* createAnonymousBlock(EDisplay display = BLOCK) const { return c
reateAnonymousWithParentAndDisplay(this, display); } |
176 | 176 |
177 virtual LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* pare
nt) const override; | 177 LayoutBox* createAnonymousBoxWithSameTypeAs(const LayoutObject* parent) cons
t override; |
178 | 178 |
179 int columnGap() const; | 179 int columnGap() const; |
180 | 180 |
181 // Accessors for logical width/height and margins in the containing block's
block-flow direction. | 181 // Accessors for logical width/height and margins in the containing block's
block-flow direction. |
182 LayoutUnit logicalWidthForChild(const LayoutBox& child) const { return isHor
izontalWritingMode() ? child.size().width() : child.size().height(); } | 182 LayoutUnit logicalWidthForChild(const LayoutBox& child) const { return isHor
izontalWritingMode() ? child.size().width() : child.size().height(); } |
183 LayoutUnit logicalHeightForChild(const LayoutBox& child) const { return isHo
rizontalWritingMode() ? child.size().height() : child.size().width(); } | 183 LayoutUnit logicalHeightForChild(const LayoutBox& child) const { return isHo
rizontalWritingMode() ? child.size().height() : child.size().width(); } |
184 LayoutSize logicalSizeForChild(const LayoutBox& child) const { return isHori
zontalWritingMode() ? child.size() : child.size().transposedSize(); } | 184 LayoutSize logicalSizeForChild(const LayoutBox& child) const { return isHori
zontalWritingMode() ? child.size() : child.size().transposedSize(); } |
185 LayoutUnit logicalTopForChild(const LayoutBox& child) const { return isHoriz
ontalWritingMode() ? child.location().y() : child.location().x(); } | 185 LayoutUnit logicalTopForChild(const LayoutBox& child) const { return isHoriz
ontalWritingMode() ? child.location().y() : child.location().x(); } |
186 LayoutUnit marginBeforeForChild(const LayoutBoxModelObject& child) const { r
eturn child.marginBefore(style()); } | 186 LayoutUnit marginBeforeForChild(const LayoutBoxModelObject& child) const { r
eturn child.marginBefore(style()); } |
187 LayoutUnit marginAfterForChild(const LayoutBoxModelObject& child) const { re
turn child.marginAfter(style()); } | 187 LayoutUnit marginAfterForChild(const LayoutBoxModelObject& child) const { re
turn child.marginAfter(style()); } |
188 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const { re
turn child.marginStart(style()); } | 188 LayoutUnit marginStartForChild(const LayoutBoxModelObject& child) const { re
turn child.marginStart(style()); } |
189 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const { retu
rn child.marginEnd(style()); } | 189 LayoutUnit marginEndForChild(const LayoutBoxModelObject& child) const { retu
rn child.marginEnd(style()); } |
190 void setMarginStartForChild(LayoutBox& child, LayoutUnit value) const { chil
d.setMarginStart(value, style()); } | 190 void setMarginStartForChild(LayoutBox& child, LayoutUnit value) const { chil
d.setMarginStart(value, style()); } |
191 void setMarginEndForChild(LayoutBox& child, LayoutUnit value) const { child.
setMarginEnd(value, style()); } | 191 void setMarginEndForChild(LayoutBox& child, LayoutUnit value) const { child.
setMarginEnd(value, style()); } |
192 void setMarginBeforeForChild(LayoutBox& child, LayoutUnit value) const { chi
ld.setMarginBefore(value, style()); } | 192 void setMarginBeforeForChild(LayoutBox& child, LayoutUnit value) const { chi
ld.setMarginBefore(value, style()); } |
193 void setMarginAfterForChild(LayoutBox& child, LayoutUnit value) const { chil
d.setMarginAfter(value, style()); } | 193 void setMarginAfterForChild(LayoutBox& child, LayoutUnit value) const { chil
d.setMarginAfter(value, style()); } |
194 LayoutUnit collapsedMarginBeforeForChild(const LayoutBox& child) const; | 194 LayoutUnit collapsedMarginBeforeForChild(const LayoutBox& child) const; |
195 LayoutUnit collapsedMarginAfterForChild(const LayoutBox& child) const; | 195 LayoutUnit collapsedMarginAfterForChild(const LayoutBox& child) const; |
196 | 196 |
197 virtual bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInCo
ntainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; | 197 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer,
const LayoutPoint& accumulatedOffset, HitTestAction) override; |
198 | 198 |
199 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v
erticalScrollbarChanged*/) { } | 199 virtual void scrollbarsChanged(bool /*horizontalScrollbarChanged*/, bool /*v
erticalScrollbarChanged*/) { } |
200 | 200 |
201 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>(
0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); } | 201 LayoutUnit availableLogicalWidthForContent() const { return max<LayoutUnit>(
0, logicalRightOffsetForContent() - logicalLeftOffsetForContent()); } |
202 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM
ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } | 202 LayoutUnit logicalLeftOffsetForContent() const { return isHorizontalWritingM
ode() ? borderLeft() + paddingLeft() : borderTop() + paddingTop(); } |
203 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo
rContent() + availableLogicalWidth(); } | 203 LayoutUnit logicalRightOffsetForContent() const { return logicalLeftOffsetFo
rContent() + availableLogicalWidth(); } |
204 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire
ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor
Content(); } | 204 LayoutUnit startOffsetForContent() const { return style()->isLeftToRightDire
ction() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetFor
Content(); } |
205 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } | 205 LayoutUnit endOffsetForContent() const { return !style()->isLeftToRightDirec
tion() ? logicalLeftOffsetForContent() : logicalWidth() - logicalRightOffsetForC
ontent(); } |
206 | 206 |
207 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; | 207 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; |
208 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; | 208 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const; |
209 | 209 |
210 #if ENABLE(ASSERT) | 210 #if ENABLE(ASSERT) |
211 void checkPositionedObjectsNeedLayout(); | 211 void checkPositionedObjectsNeedLayout(); |
212 bool paintsContinuationOutline(LayoutInline* flow); | 212 bool paintsContinuationOutline(LayoutInline* flow); |
213 #endif | 213 #endif |
214 #ifndef NDEBUG | 214 #ifndef NDEBUG |
215 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr,
const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr
) const; | 215 void showLineTreeAndMark(const InlineBox* = nullptr, const char* = nullptr,
const InlineBox* = nullptr, const char* = nullptr, const LayoutObject* = nullptr
) const; |
216 #endif | 216 #endif |
217 | 217 |
218 bool recalcChildOverflowAfterStyleChange(); | 218 bool recalcChildOverflowAfterStyleChange(); |
219 bool recalcOverflowAfterStyleChange(); | 219 bool recalcOverflowAfterStyleChange(); |
220 | 220 |
221 protected: | 221 protected: |
222 virtual void willBeDestroyed() override; | 222 void willBeDestroyed() override; |
223 | 223 |
224 void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&); | 224 void dirtyForLayoutFromPercentageHeightDescendants(SubtreeLayoutScope&); |
225 | 225 |
226 virtual void layout() override; | 226 void layout() override; |
227 virtual bool updateImageLoadingPriorities() override final; | 227 bool updateImageLoadingPriorities() final; |
228 | 228 |
229 enum PositionedLayoutBehavior { | 229 enum PositionedLayoutBehavior { |
230 DefaultLayout, | 230 DefaultLayout, |
231 LayoutOnlyFixedPositionedObjects, | 231 LayoutOnlyFixedPositionedObjects, |
232 ForcedLayoutAfterContainingBlockMoved | 232 ForcedLayoutAfterContainingBlockMoved |
233 }; | 233 }; |
234 | 234 |
235 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior
= DefaultLayout); | 235 void layoutPositionedObjects(bool relayoutChildren, PositionedLayoutBehavior
= DefaultLayout); |
236 void markFixedPositionObjectForLayoutIfNeeded(LayoutObject* child, SubtreeLa
youtScope&); | 236 void markFixedPositionObjectForLayoutIfNeeded(LayoutObject* child, SubtreeLa
youtScope&); |
237 | 237 |
238 LayoutUnit marginIntrinsicLogicalWidthForChild(LayoutBox& child) const; | 238 LayoutUnit marginIntrinsicLogicalWidthForChild(LayoutBox& child) const; |
239 | 239 |
240 int beforeMarginInLineDirection(LineDirectionMode) const; | 240 int beforeMarginInLineDirection(LineDirectionMode) const; |
241 | 241 |
242 virtual void paint(const PaintInfo&, const LayoutPoint&) override; | 242 void paint(const PaintInfo&, const LayoutPoint&) override; |
243 public: | 243 public: |
244 virtual void paintObject(const PaintInfo&, const LayoutPoint&); | 244 virtual void paintObject(const PaintInfo&, const LayoutPoint&); |
245 virtual void paintChildren(const PaintInfo&, const LayoutPoint&); | 245 virtual void paintChildren(const PaintInfo&, const LayoutPoint&); |
246 | 246 |
247 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow | 247 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow |
248 virtual void paintFloats(const PaintInfo&, const LayoutPoint&, bool) { } | 248 virtual void paintFloats(const PaintInfo&, const LayoutPoint&, bool) { } |
249 virtual void paintSelection(const PaintInfo&, const LayoutPoint&) { } | 249 virtual void paintSelection(const PaintInfo&, const LayoutPoint&) { } |
250 | 250 |
251 protected: | 251 protected: |
252 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit
yCount */, LayoutUnit& /* logicalLeft */, LayoutUnit& /* logicalWidth */) const
{ } | 252 virtual void adjustInlineDirectionLineBounds(unsigned /* expansionOpportunit
yCount */, LayoutUnit& /* logicalLeft */, LayoutUnit& /* logicalWidth */) const
{ } |
253 | 253 |
254 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const override; | 254 void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit&
maxLogicalWidth) const override; |
255 virtual void computePreferredLogicalWidths() override; | 255 void computePreferredLogicalWidths() override; |
256 | 256 |
257 virtual int firstLineBoxBaseline() const override; | 257 int firstLineBoxBaseline() const override; |
258 virtual int inlineBlockBaseline(LineDirectionMode) const override; | 258 int inlineBlockBaseline(LineDirectionMode) const override; |
259 int lastLineBoxBaseline(LineDirectionMode) const; | 259 int lastLineBoxBaseline(LineDirectionMode) const; |
260 | 260 |
261 virtual void updateHitTestResult(HitTestResult&, const LayoutPoint&) overrid
e; | 261 void updateHitTestResult(HitTestResult&, const LayoutPoint&) override; |
262 | 262 |
263 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be | 263 // Delay update scrollbar until finishDelayUpdateScrollInfo() will be |
264 // called. This function is used when a flexbox is laying out its | 264 // called. This function is used when a flexbox is laying out its |
265 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), | 265 // descendant. If multiple calls are made to startDelayUpdateScrollInfo(), |
266 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro
llInfo() | 266 // finishDelayUpdateScrollInfo() will do nothing until finishDelayUpdateScro
llInfo() |
267 // is called the same number of times. | 267 // is called the same number of times. |
268 static void startDelayUpdateScrollInfo(); | 268 static void startDelayUpdateScrollInfo(); |
269 static void finishDelayUpdateScrollInfo(); | 269 static void finishDelayUpdateScrollInfo(); |
270 | 270 |
271 void updateScrollInfoAfterLayout(); | 271 void updateScrollInfoAfterLayout(); |
272 | 272 |
273 virtual void styleWillChange(StyleDifference, const ComputedStyle& newStyle)
override; | 273 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid
e; |
274 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle)
override; | 274 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
275 | 275 |
276 virtual bool hasLineIfEmpty() const; | 276 virtual bool hasLineIfEmpty() const; |
277 | 277 |
278 bool simplifiedLayout(); | 278 bool simplifiedLayout(); |
279 virtual void simplifiedNormalFlowLayout(); | 279 virtual void simplifiedNormalFlowLayout(); |
280 | 280 |
281 public: | 281 public: |
282 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); | 282 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool = false); |
283 protected: | 283 protected: |
284 virtual void addOverflowFromChildren(); | 284 virtual void addOverflowFromChildren(); |
285 void addOverflowFromPositionedObjects(); | 285 void addOverflowFromPositionedObjects(); |
286 void addOverflowFromBlockChildren(); | 286 void addOverflowFromBlockChildren(); |
287 void addVisualOverflowFromTheme(); | 287 void addVisualOverflowFromTheme(); |
288 | 288 |
289 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& addit
ionalOffset) const override; | 289 void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOff
set) const override; |
290 | 290 |
291 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint&
layerOffset) const override; | 291 void computeSelfHitTestRects(Vector<LayoutRect>&, const LayoutPoint& layerOf
fset) const override; |
292 | 292 |
293 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox&
); | 293 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox&
); |
294 | 294 |
295 virtual bool isInlineBlockOrInlineTable() const override final { return isIn
line() && isReplaced(); } | 295 bool isInlineBlockOrInlineTable() const final { return isInline() && isRepla
ced(); } |
296 | 296 |
297 virtual void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& child
PaintInvalidationState) override; | 297 void invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& childPaintInv
alidationState) override; |
298 | 298 |
299 private: | 299 private: |
300 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } | 300 LayoutObjectChildList* virtualChildren() final { return children(); } |
301 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } | 301 const LayoutObjectChildList* virtualChildren() const final { return children
(); } |
302 | 302 |
303 virtual bool isLayoutBlock() const override final { return true; } | 303 bool isLayoutBlock() const final { return true; } |
304 | 304 |
305 void makeChildrenNonInline(LayoutObject* insertionPoint = nullptr); | 305 void makeChildrenNonInline(LayoutObject* insertionPoint = nullptr); |
306 | 306 |
307 // Promote all children and make them siblings that come right after this bl
ock. | 307 // Promote all children and make them siblings that come right after this bl
ock. |
308 void promoteAllChildrenAndInsertAfter(); | 308 void promoteAllChildrenAndInsertAfter(); |
309 | 309 |
310 virtual void removeLeftoverAnonymousBlock(LayoutBlock* child); | 310 virtual void removeLeftoverAnonymousBlock(LayoutBlock* child); |
311 | 311 |
312 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); | 312 static void collapseAnonymousBlockChild(LayoutBlock* parent, LayoutBlock* ch
ild); |
313 | 313 |
314 virtual void dirtyLinesFromChangedChild(LayoutObject* child) override final
{ m_lineBoxes.dirtyLinesFromChangedChild(this, child); } | 314 void dirtyLinesFromChangedChild(LayoutObject* child) final { m_lineBoxes.dir
tyLinesFromChangedChild(this, child); } |
315 | 315 |
316 virtual void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObje
ct* beforeChild) override; | 316 void addChildIgnoringContinuation(LayoutObject* newChild, LayoutObject* befo
reChild) override; |
317 | 317 |
318 virtual bool isSelfCollapsingBlock() const override; | 318 bool isSelfCollapsingBlock() const override; |
319 | 319 |
320 void removeAnonymousWrappersIfRequired(); | 320 void removeAnonymousWrappersIfRequired(); |
321 | 321 |
322 void insertIntoTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDescendant
sMap*&, TrackedContainerMap*&); | 322 void insertIntoTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDescendant
sMap*&, TrackedContainerMap*&); |
323 static void removeFromTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDes
cendantsMap*&, TrackedContainerMap*&); | 323 static void removeFromTrackedLayoutBoxMaps(LayoutBox* descendant, TrackedDes
cendantsMap*&, TrackedContainerMap*&); |
324 | 324 |
325 Node* nodeForHitTest() const; | 325 Node* nodeForHitTest() const; |
326 | 326 |
327 bool tryLayoutDoingPositionedMovementOnly(); | 327 bool tryLayoutDoingPositionedMovementOnly(); |
328 | 328 |
329 virtual bool avoidsFloats() const override { return true; } | 329 bool avoidsFloats() const override { return true; } |
330 | 330 |
331 bool hitTestContents(HitTestResult&, const HitTestLocation& locationInContai
ner, const LayoutPoint& accumulatedOffset, HitTestAction); | 331 bool hitTestContents(HitTestResult&, const HitTestLocation& locationInContai
ner, const LayoutPoint& accumulatedOffset, HitTestAction); |
332 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow | 332 // FIXME-BLOCKFLOW: Remove virtualizaion when all callers have moved to Layo
utBlockFlow |
333 virtual bool hitTestFloats(HitTestResult&, const HitTestLocation&, const Lay
outPoint&) { return false; } | 333 virtual bool hitTestFloats(HitTestResult&, const HitTestLocation&, const Lay
outPoint&) { return false; } |
334 | 334 |
335 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); | 335 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); |
336 | 336 |
337 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; | 337 void computeBlockPreferredLogicalWidths(LayoutUnit& minLogicalWidth, LayoutU
nit& maxLogicalWidth) const; |
338 | 338 |
339 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline | 339 // Obtains the nearest enclosing block (including this block) that contribut
es a first-line style to our inline |
340 // children. | 340 // children. |
341 virtual LayoutBlock* firstLineBlock() const override; | 341 LayoutBlock* firstLineBlock() const override; |
342 | 342 |
343 virtual LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelO
bject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidat
ionState* = nullptr) const override final; | 343 LayoutRect rectWithOutlineForPaintInvalidation(const LayoutBoxModelObject* p
aintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalidationState
* = nullptr) const final; |
344 | 344 |
345 virtual LayoutObject* hoverAncestor() const override final; | 345 LayoutObject* hoverAncestor() const final; |
346 virtual void updateDragState(bool dragOn) override final; | 346 void updateDragState(bool dragOn) final; |
347 virtual void childBecameNonInline(LayoutObject* child) override final; | 347 void childBecameNonInline(LayoutObject* child) final; |
348 | 348 |
349 bool isSelectionRoot() const; | 349 bool isSelectionRoot() const; |
350 | 350 |
351 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedO
ffset) const override; | 351 void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) c
onst override; |
352 virtual void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const overrid
e; | 352 void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override; |
353 | 353 |
354 private: | 354 private: |
355 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* e
xtraWidthToEndOfLine = nullptr) override final; | 355 LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidt
hToEndOfLine = nullptr) final; |
356 bool isInlineBoxWrapperActuallyChild() const; | 356 bool isInlineBoxWrapperActuallyChild() const; |
357 | 357 |
358 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = nullptr); | 358 void markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBot
tom, RootInlineBox* highest = nullptr); |
359 | 359 |
360 Position positionForBox(InlineBox*, bool start = true) const; | 360 Position positionForBox(InlineBox*, bool start = true) const; |
361 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); | 361 PositionWithAffinity positionForPointWithInlineChildren(const LayoutPoint&); |
362 | 362 |
363 // End helper functions and structs used by layoutBlockChildren. | 363 // End helper functions and structs used by layoutBlockChildren. |
364 | 364 |
365 void removeFromGlobalMaps(); | 365 void removeFromGlobalMaps(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 // FIXME: This is temporary as we move code that accesses block flow | 418 // FIXME: This is temporary as we move code that accesses block flow |
419 // member variables out of LayoutBlock and into LayoutBlockFlow. | 419 // member variables out of LayoutBlock and into LayoutBlockFlow. |
420 friend class LayoutBlockFlow; | 420 friend class LayoutBlockFlow; |
421 }; | 421 }; |
422 | 422 |
423 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); | 423 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlock, isLayoutBlock()); |
424 | 424 |
425 } // namespace blink | 425 } // namespace blink |
426 | 426 |
427 #endif // LayoutBlock_h | 427 #endif // LayoutBlock_h |
OLD | NEW |