| 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-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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class LineInfo; | 50 class LineInfo; |
| 51 class LineWidth; | 51 class LineWidth; |
| 52 class LayoutMultiColumnFlowThread; | 52 class LayoutMultiColumnFlowThread; |
| 53 class LayoutMultiColumnSpannerPlaceholder; | 53 class LayoutMultiColumnSpannerPlaceholder; |
| 54 class LayoutRubyRun; | 54 class LayoutRubyRun; |
| 55 template <class Run> class BidiRunList; | 55 template <class Run> class BidiRunList; |
| 56 | 56 |
| 57 class CORE_EXPORT LayoutBlockFlow : public LayoutBlock { | 57 class CORE_EXPORT LayoutBlockFlow : public LayoutBlock { |
| 58 public: | 58 public: |
| 59 explicit LayoutBlockFlow(ContainerNode*); | 59 explicit LayoutBlockFlow(ContainerNode*); |
| 60 virtual ~LayoutBlockFlow(); | 60 ~LayoutBlockFlow() override; |
| 61 | 61 |
| 62 static LayoutBlockFlow* createAnonymous(Document*); | 62 static LayoutBlockFlow* createAnonymous(Document*); |
| 63 | 63 |
| 64 virtual bool isLayoutBlockFlow() const override final { return true; } | 64 bool isLayoutBlockFlow() const final { return true; } |
| 65 | 65 |
| 66 virtual void layoutBlock(bool relayoutChildren) override; | 66 void layoutBlock(bool relayoutChildren) override; |
| 67 | 67 |
| 68 virtual void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFl
oats = false) override; | 68 void computeOverflow(LayoutUnit oldClientAfterEdge, bool recomputeFloats = f
alse) override; |
| 69 | 69 |
| 70 virtual void deleteLineBoxTree() override final; | 70 void deleteLineBoxTree() final; |
| 71 | 71 |
| 72 LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool shouldInde
ntText, LayoutUnit logicalHeight = 0) const | 72 LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool shouldInde
ntText, LayoutUnit logicalHeight = 0) const |
| 73 { | 73 { |
| 74 return max<LayoutUnit>(0, logicalRightOffsetForLine(position, shouldInde
ntText, logicalHeight) - logicalLeftOffsetForLine(position, shouldIndentText, lo
gicalHeight)); | 74 return max<LayoutUnit>(0, logicalRightOffsetForLine(position, shouldInde
ntText, logicalHeight) - logicalLeftOffsetForLine(position, shouldIndentText, lo
gicalHeight)); |
| 75 } | 75 } |
| 76 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentT
ext, LayoutUnit logicalHeight = 0) const | 76 LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentT
ext, LayoutUnit logicalHeight = 0) const |
| 77 { | 77 { |
| 78 return logicalRightOffsetForLine(position, logicalRightOffsetForContent(
), shouldIndentText, logicalHeight); | 78 return logicalRightOffsetForLine(position, logicalRightOffsetForContent(
), shouldIndentText, logicalHeight); |
| 79 } | 79 } |
| 80 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentTe
xt, LayoutUnit logicalHeight = 0) const | 80 LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentTe
xt, LayoutUnit logicalHeight = 0) const |
| (...skipping 12 matching lines...) Expand all Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 // FIXME-BLOCKFLOW: Move this into LayoutBlockFlow once there are no calls | 95 // FIXME-BLOCKFLOW: Move this into LayoutBlockFlow once there are no calls |
| 96 // in LayoutBlock. http://crbug.com/393945, http://crbug.com/302024 | 96 // in LayoutBlock. http://crbug.com/393945, http://crbug.com/302024 |
| 97 using LayoutBlock::lineBoxes; | 97 using LayoutBlock::lineBoxes; |
| 98 using LayoutBlock::firstLineBox; | 98 using LayoutBlock::firstLineBox; |
| 99 using LayoutBlock::lastLineBox; | 99 using LayoutBlock::lastLineBox; |
| 100 using LayoutBlock::firstRootBox; | 100 using LayoutBlock::firstRootBox; |
| 101 using LayoutBlock::lastRootBox; | 101 using LayoutBlock::lastRootBox; |
| 102 | 102 |
| 103 virtual LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const override; | 103 LayoutUnit logicalLeftSelectionOffset(const LayoutBlock* rootBlock, LayoutUn
it position) const override; |
| 104 virtual LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock,
LayoutUnit position) const override; | 104 LayoutUnit logicalRightSelectionOffset(const LayoutBlock* rootBlock, LayoutU
nit position) const override; |
| 105 | 105 |
| 106 RootInlineBox* createAndAppendRootInlineBox(); | 106 RootInlineBox* createAndAppendRootInlineBox(); |
| 107 | 107 |
| 108 void markAllDescendantsWithFloatsForLayout(LayoutBox* floatToRemove = nullpt
r, bool inLayout = true); | 108 void markAllDescendantsWithFloatsForLayout(LayoutBox* floatToRemove = nullpt
r, bool inLayout = true); |
| 109 void markSiblingsWithFloatsForLayout(LayoutBox* floatToRemove = nullptr); | 109 void markSiblingsWithFloatsForLayout(LayoutBox* floatToRemove = nullptr); |
| 110 | 110 |
| 111 bool containsFloats() const { return m_floatingObjects && !m_floatingObjects
->set().isEmpty(); } | 111 bool containsFloats() const { return m_floatingObjects && !m_floatingObjects
->set().isEmpty(); } |
| 112 bool containsFloat(LayoutBox*) const; | 112 bool containsFloat(LayoutBox*) const; |
| 113 | 113 |
| 114 void removeFloatingObjects(); | 114 void removeFloatingObjects(); |
| 115 | 115 |
| 116 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nu
llptr) override; | 116 void addChild(LayoutObject* newChild, LayoutObject* beforeChild = nullptr) o
verride; |
| 117 | 117 |
| 118 void moveAllChildrenIncludingFloatsTo(LayoutBlock* toBlock, bool fullRemoveI
nsert); | 118 void moveAllChildrenIncludingFloatsTo(LayoutBlock* toBlock, bool fullRemoveI
nsert); |
| 119 | 119 |
| 120 bool generatesLineBoxesForInlineChild(LayoutObject*); | 120 bool generatesLineBoxesForInlineChild(LayoutObject*); |
| 121 | 121 |
| 122 LayoutUnit logicalTopForFloat(const FloatingObject& floatingObject) const {
return isHorizontalWritingMode() ? floatingObject.y() : floatingObject.x(); } | 122 LayoutUnit logicalTopForFloat(const FloatingObject& floatingObject) const {
return isHorizontalWritingMode() ? floatingObject.y() : floatingObject.x(); } |
| 123 LayoutUnit logicalBottomForFloat(const FloatingObject& floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject.maxY() : floatingObject.max
X(); } | 123 LayoutUnit logicalBottomForFloat(const FloatingObject& floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject.maxY() : floatingObject.max
X(); } |
| 124 LayoutUnit logicalLeftForFloat(const FloatingObject& floatingObject) const {
return isHorizontalWritingMode() ? floatingObject.x() : floatingObject.y(); } | 124 LayoutUnit logicalLeftForFloat(const FloatingObject& floatingObject) const {
return isHorizontalWritingMode() ? floatingObject.x() : floatingObject.y(); } |
| 125 LayoutUnit logicalRightForFloat(const FloatingObject& floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject.maxX() : floatingObject.maxY
(); } | 125 LayoutUnit logicalRightForFloat(const FloatingObject& floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject.maxX() : floatingObject.maxY
(); } |
| 126 LayoutUnit logicalWidthForFloat(const FloatingObject& floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject.width() : floatingObject.hei
ght(); } | 126 LayoutUnit logicalWidthForFloat(const FloatingObject& floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject.width() : floatingObject.hei
ght(); } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 { | 172 { |
| 173 if (m_rareData) | 173 if (m_rareData) |
| 174 m_rareData->m_multiColumnFlowThread = nullptr; | 174 m_rareData->m_multiColumnFlowThread = nullptr; |
| 175 } | 175 } |
| 176 | 176 |
| 177 void addOverflowFromInlineChildren(); | 177 void addOverflowFromInlineChildren(); |
| 178 | 178 |
| 179 // FIXME: This should be const to avoid a const_cast, but can modify child d
irty bits and LayoutTextCombine | 179 // FIXME: This should be const to avoid a const_cast, but can modify child d
irty bits and LayoutTextCombine |
| 180 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout
Unit& maxLogicalWidth); | 180 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout
Unit& maxLogicalWidth); |
| 181 | 181 |
| 182 virtual bool shouldPaintSelectionGaps() const override final; | 182 bool shouldPaintSelectionGaps() const final; |
| 183 LayoutRect logicalLeftSelectionGap(const LayoutBlock* rootBlock, const Layou
tPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 183 LayoutRect logicalLeftSelectionGap(const LayoutBlock* rootBlock, const Layou
tPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 184 const LayoutObject* selObj, LayoutUnit logicalLeft, LayoutUnit logicalTo
p, LayoutUnit logicalHeight, const PaintInfo*) const; | 184 const LayoutObject* selObj, LayoutUnit logicalLeft, LayoutUnit logicalTo
p, LayoutUnit logicalHeight, const PaintInfo*) const; |
| 185 LayoutRect logicalRightSelectionGap(const LayoutBlock* rootBlock, const Layo
utPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 185 LayoutRect logicalRightSelectionGap(const LayoutBlock* rootBlock, const Layo
utPoint& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 186 const LayoutObject* selObj, LayoutUnit logicalRight, LayoutUnit logicalT
op, LayoutUnit logicalHeight, const PaintInfo*) const; | 186 const LayoutObject* selObj, LayoutUnit logicalRight, LayoutUnit logicalT
op, LayoutUnit logicalHeight, const PaintInfo*) const; |
| 187 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap) cons
t; | 187 void getSelectionGapInfo(SelectionState, bool& leftGap, bool& rightGap) cons
t; |
| 188 | 188 |
| 189 virtual LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObj
ect* paintInvalidationContainer) const override final; | 189 LayoutRect selectionRectForPaintInvalidation(const LayoutBoxModelObject* pai
ntInvalidationContainer) const final; |
| 190 GapRects selectionGapRectsForPaintInvalidation(const LayoutBoxModelObject* p
aintInvalidationContainer) const; | 190 GapRects selectionGapRectsForPaintInvalidation(const LayoutBoxModelObject* p
aintInvalidationContainer) const; |
| 191 GapRects selectionGaps(const LayoutBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 191 GapRects selectionGaps(const LayoutBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 192 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, | 192 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, |
| 193 const PaintInfo* = nullptr, ClipScope* = nullptr) const; | 193 const PaintInfo* = nullptr, ClipScope* = nullptr) const; |
| 194 GapRects inlineSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 194 GapRects inlineSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 195 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*) const; | 195 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*) const; |
| 196 GapRects blockSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint&
rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 196 GapRects blockSelectionGaps(const LayoutBlock* rootBlock, const LayoutPoint&
rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 197 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*) const; | 197 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*) const; |
| 198 LayoutRect blockSelectionGap(const LayoutBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 198 LayoutRect blockSelectionGap(const LayoutBlock* rootBlock, const LayoutPoint
& rootBlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 199 LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLo
gicalRight, LayoutUnit logicalBottom, const PaintInfo*) const; | 199 LayoutUnit lastLogicalTop, LayoutUnit lastLogicalLeft, LayoutUnit lastLo
gicalRight, LayoutUnit logicalBottom, const PaintInfo*) const; |
| 200 | 200 |
| 201 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin
ationStrut : LayoutUnit(); } | 201 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_pagin
ationStrut : LayoutUnit(); } |
| 202 void setPaginationStrut(LayoutUnit); | 202 void setPaginationStrut(LayoutUnit); |
| 203 | 203 |
| 204 void positionSpannerDescendant(LayoutMultiColumnSpannerPlaceholder& child); | 204 void positionSpannerDescendant(LayoutMultiColumnSpannerPlaceholder& child); |
| 205 | 205 |
| 206 virtual bool avoidsFloats() const override; | 206 bool avoidsFloats() const override; |
| 207 | 207 |
| 208 using LayoutBoxModelObject::moveChildrenTo; | 208 using LayoutBoxModelObject::moveChildrenTo; |
| 209 virtual void moveChildrenTo(LayoutBoxModelObject* toBoxModelObject, LayoutOb
ject* startChild, LayoutObject* endChild, LayoutObject* beforeChild, bool fullRe
moveInsert = false) override; | 209 void moveChildrenTo(LayoutBoxModelObject* toBoxModelObject, LayoutObject* st
artChild, LayoutObject* endChild, LayoutObject* beforeChild, bool fullRemoveInse
rt = false) override; |
| 210 | 210 |
| 211 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject& child) con
st | 211 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject& child) con
st |
| 212 { | 212 { |
| 213 if (isHorizontalWritingMode()) | 213 if (isHorizontalWritingMode()) |
| 214 return child.x() + child.layoutObject()->marginLeft(); | 214 return child.x() + child.layoutObject()->marginLeft(); |
| 215 | 215 |
| 216 return child.x() + marginBeforeForChild(*child.layoutObject()); | 216 return child.x() + marginBeforeForChild(*child.layoutObject()); |
| 217 } | 217 } |
| 218 | 218 |
| 219 LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject& child) con
st | 219 LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject& child) con
st |
| (...skipping 10 matching lines...) Expand all Loading... |
| 230 return LayoutSize(child.x() + child.layoutObject()->marginLeft(), | 230 return LayoutSize(child.x() + child.layoutObject()->marginLeft(), |
| 231 child.y() + marginBeforeForChild(*child.layoutObject())); | 231 child.y() + marginBeforeForChild(*child.layoutObject())); |
| 232 } | 232 } |
| 233 | 233 |
| 234 return LayoutSize(child.x() + marginBeforeForChild(*child.layoutObject()
), | 234 return LayoutSize(child.x() + marginBeforeForChild(*child.layoutObject()
), |
| 235 child.y() + child.layoutObject()->marginTop()); | 235 child.y() + child.layoutObject()->marginTop()); |
| 236 } | 236 } |
| 237 | 237 |
| 238 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject&, const Lay
outPoint&) const; | 238 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject&, const Lay
outPoint&) const; |
| 239 | 239 |
| 240 virtual const char* name() const override { return "LayoutBlockFlow"; } | 240 const char* name() const override { return "LayoutBlockFlow"; } |
| 241 | 241 |
| 242 FloatingObject* insertFloatingObject(LayoutBox&); | 242 FloatingObject* insertFloatingObject(LayoutBox&); |
| 243 | 243 |
| 244 // Called from lineWidth, to position the floats added in the last line. | 244 // Called from lineWidth, to position the floats added in the last line. |
| 245 // Returns true if and only if it has positioned any floats. | 245 // Returns true if and only if it has positioned any floats. |
| 246 bool positionNewFloats(LineWidth* = nullptr); | 246 bool positionNewFloats(LineWidth* = nullptr); |
| 247 | 247 |
| 248 bool positionNewFloatOnLine(FloatingObject& newFloat, FloatingObject* lastFl
oatFromPreviousLine, LineInfo&, LineWidth&); | 248 bool positionNewFloatOnLine(FloatingObject& newFloat, FloatingObject* lastFl
oatFromPreviousLine, LineInfo&, LineWidth&); |
| 249 | 249 |
| 250 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMo
de = ShapeOutsideFloatMarginBoxOffset) const; | 250 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMo
de = ShapeOutsideFloatMarginBoxOffset) const; |
| 251 | 251 |
| 252 FloatingObject* lastFloatFromPreviousLine() const | 252 FloatingObject* lastFloatFromPreviousLine() const |
| 253 { | 253 { |
| 254 return containsFloats() ? m_floatingObjects->set().last().get() : nullpt
r; | 254 return containsFloats() ? m_floatingObjects->set().last().get() : nullpt
r; |
| 255 } | 255 } |
| 256 | 256 |
| 257 protected: | 257 protected: |
| 258 void rebuildFloatsFromIntruding(); | 258 void rebuildFloatsFromIntruding(); |
| 259 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); | 259 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); |
| 260 void addLowestFloatFromChildren(LayoutBlockFlow*); | 260 void addLowestFloatFromChildren(LayoutBlockFlow*); |
| 261 | 261 |
| 262 void createFloatingObjects(); | 262 void createFloatingObjects(); |
| 263 | 263 |
| 264 virtual void styleWillChange(StyleDifference, const ComputedStyle& newStyle)
override; | 264 void styleWillChange(StyleDifference, const ComputedStyle& newStyle) overrid
e; |
| 265 virtual void styleDidChange(StyleDifference, const ComputedStyle* oldStyle)
override; | 265 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
| 266 | 266 |
| 267 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox&
); | 267 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox&
); |
| 268 | 268 |
| 269 void addOverflowFromFloats(); | 269 void addOverflowFromFloats(); |
| 270 | 270 |
| 271 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed
Offset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const | 271 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed
Offset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const |
| 272 { | 272 { |
| 273 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo
gicalTop, fixedOffset, logicalHeight), applyTextIndent); | 273 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo
gicalTop, fixedOffset, logicalHeight), applyTextIndent); |
| 274 } | 274 } |
| 275 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO
ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const | 275 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO
ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const |
| 276 { | 276 { |
| 277 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi
calTop, fixedOffset, logicalHeight), applyTextIndent); | 277 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi
calTop, fixedOffset, logicalHeight), applyTextIndent); |
| 278 } | 278 } |
| 279 | 279 |
| 280 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/,
SubtreeLayoutScope&); | 280 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/,
SubtreeLayoutScope&); |
| 281 virtual bool updateLogicalWidthAndColumnWidth() override; | 281 bool updateLogicalWidthAndColumnWidth() override; |
| 282 | 282 |
| 283 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); | 283 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); |
| 284 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); | 284 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); |
| 285 void determineLogicalLeftPositionForChild(LayoutBox& child); | 285 void determineLogicalLeftPositionForChild(LayoutBox& child); |
| 286 | 286 |
| 287 private: | 287 private: |
| 288 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S
ubtreeLayoutScope&); | 288 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S
ubtreeLayoutScope&); |
| 289 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); | 289 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); |
| 290 | 290 |
| 291 void layoutBlockChild(LayoutBox& child, MarginInfo&, LayoutUnit& previousFlo
atLogicalBottom); | 291 void layoutBlockChild(LayoutBox& child, MarginInfo&, LayoutUnit& previousFlo
atLogicalBottom); |
| 292 void adjustPositionedBlock(LayoutBox& child, const MarginInfo&); | 292 void adjustPositionedBlock(LayoutBox& child, const MarginInfo&); |
| 293 void adjustFloatingBlock(const MarginInfo&); | 293 void adjustFloatingBlock(const MarginInfo&); |
| 294 | 294 |
| 295 LayoutPoint computeLogicalLocationForFloat(const FloatingObject&, LayoutUnit
logicalTopOffset) const; | 295 LayoutPoint computeLogicalLocationForFloat(const FloatingObject&, LayoutUnit
logicalTopOffset) const; |
| 296 | 296 |
| 297 void removeFloatingObject(LayoutBox*); | 297 void removeFloatingObject(LayoutBox*); |
| 298 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); | 298 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); |
| 299 | 299 |
| 300 LayoutUnit getClearDelta(LayoutBox* child, LayoutUnit yPos); | 300 LayoutUnit getClearDelta(LayoutBox* child, LayoutUnit yPos); |
| 301 | 301 |
| 302 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF
loatLogicalBottom() > logicalHeight(); } | 302 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF
loatLogicalBottom() > logicalHeight(); } |
| 303 bool hasOverhangingFloat(LayoutBox*); | 303 bool hasOverhangingFloat(LayoutBox*); |
| 304 void addIntrudingFloats(LayoutBlockFlow* prev, LayoutUnit xoffset, LayoutUni
t yoffset); | 304 void addIntrudingFloats(LayoutBlockFlow* prev, LayoutUnit xoffset, LayoutUni
t yoffset); |
| 305 void addOverhangingFloats(LayoutBlockFlow* child, bool makeChildPaintOtherFl
oats); | 305 void addOverhangingFloats(LayoutBlockFlow* child, bool makeChildPaintOtherFl
oats); |
| 306 | 306 |
| 307 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F
loatLeftRight) const; | 307 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F
loatLeftRight) const; |
| 308 | 308 |
| 309 virtual bool hitTestFloats(HitTestResult&, const HitTestLocation& locationIn
Container, const LayoutPoint& accumulatedOffset) override final; | 309 bool hitTestFloats(HitTestResult&, const HitTestLocation& locationInContaine
r, const LayoutPoint& accumulatedOffset) final; |
| 310 | 310 |
| 311 virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants) o
verride final; | 311 void invalidatePaintForOverhangingFloats(bool paintAllDescendants) final; |
| 312 virtual void invalidatePaintForOverflow() override final; | 312 void invalidatePaintForOverflow() final; |
| 313 virtual void paintFloats(const PaintInfo&, const LayoutPoint&, bool preserve
Phase = false) override final; | 313 void paintFloats(const PaintInfo&, const LayoutPoint&, bool preservePhase =
false) final; |
| 314 virtual void paintSelection(const PaintInfo&, const LayoutPoint&) override f
inal; | 314 void paintSelection(const PaintInfo&, const LayoutPoint&) final; |
| 315 virtual void clipOutFloatingObjects(const LayoutBlock*, ClipScope&, const La
youtPoint&, const LayoutSize&) const; | 315 virtual void clipOutFloatingObjects(const LayoutBlock*, ClipScope&, const La
youtPoint&, const LayoutSize&) const; |
| 316 void clearFloats(EClear); | 316 void clearFloats(EClear); |
| 317 | 317 |
| 318 LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit
fixedOffset, LayoutUnit logicalHeight) const; | 318 LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit
fixedOffset, LayoutUnit logicalHeight) const; |
| 319 LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit f
ixedOffset, LayoutUnit logicalHeight) const; | 319 LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit f
ixedOffset, LayoutUnit logicalHeight) const; |
| 320 | 320 |
| 321 LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit logicalTop, Layo
utUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; | 321 LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit logicalTop, Layo
utUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; |
| 322 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, Layou
tUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; | 322 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, Layou
tUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; |
| 323 | 323 |
| 324 LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool
applyTextIndent) const; | 324 LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool
applyTextIndent) const; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 m_rareData->m_margins = MarginValues(LayoutBlockFlowRareData::positi
veMarginBeforeDefault(this) , LayoutBlockFlowRareData::negativeMarginBeforeDefau
lt(this), | 465 m_rareData->m_margins = MarginValues(LayoutBlockFlowRareData::positi
veMarginBeforeDefault(this) , LayoutBlockFlowRareData::negativeMarginBeforeDefau
lt(this), |
| 466 LayoutBlockFlowRareData::positiveMarginAfterDefault(this), Layou
tBlockFlowRareData::negativeMarginAfterDefault(this)); | 466 LayoutBlockFlowRareData::positiveMarginAfterDefault(this), Layou
tBlockFlowRareData::negativeMarginAfterDefault(this)); |
| 467 | 467 |
| 468 m_rareData->m_discardMarginBefore = false; | 468 m_rareData->m_discardMarginBefore = false; |
| 469 m_rareData->m_discardMarginAfter = false; | 469 m_rareData->m_discardMarginAfter = false; |
| 470 } | 470 } |
| 471 } | 471 } |
| 472 | 472 |
| 473 virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const; | 473 virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const; |
| 474 private: | 474 private: |
| 475 virtual LayoutUnit collapsedMarginBefore() const override final { return max
PositiveMarginBefore() - maxNegativeMarginBefore(); } | 475 LayoutUnit collapsedMarginBefore() const final { return maxPositiveMarginBef
ore() - maxNegativeMarginBefore(); } |
| 476 virtual LayoutUnit collapsedMarginAfter() const override final { return maxP
ositiveMarginAfter() - maxNegativeMarginAfter(); } | 476 LayoutUnit collapsedMarginAfter() const final { return maxPositiveMarginAfte
r() - maxNegativeMarginAfter(); } |
| 477 | 477 |
| 478 LayoutUnit collapseMargins(LayoutBox& child, MarginInfo&, bool childIsSelfCo
llapsing); | 478 LayoutUnit collapseMargins(LayoutBox& child, MarginInfo&, bool childIsSelfCo
llapsing); |
| 479 LayoutUnit clearFloatsIfNeeded(LayoutBox& child, MarginInfo&, LayoutUnit old
TopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPos, bool childIsSelfColla
psing); | 479 LayoutUnit clearFloatsIfNeeded(LayoutBox& child, MarginInfo&, LayoutUnit old
TopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPos, bool childIsSelfColla
psing); |
| 480 LayoutUnit estimateLogicalTopPosition(LayoutBox& child, const MarginInfo&, L
ayoutUnit& estimateWithoutPagination); | 480 LayoutUnit estimateLogicalTopPosition(LayoutBox& child, const MarginInfo&, L
ayoutUnit& estimateWithoutPagination); |
| 481 void marginBeforeEstimateForChild(LayoutBox&, LayoutUnit&, LayoutUnit&, bool
&) const; | 481 void marginBeforeEstimateForChild(LayoutBox&, LayoutUnit&, LayoutUnit&, bool
&) const; |
| 482 void handleAfterSideOfBlock(LayoutBox* lastChild, LayoutUnit top, LayoutUnit
bottom, MarginInfo&); | 482 void handleAfterSideOfBlock(LayoutBox* lastChild, LayoutUnit top, LayoutUnit
bottom, MarginInfo&); |
| 483 void setCollapsedBottomMargin(const MarginInfo&); | 483 void setCollapsedBottomMargin(const MarginInfo&); |
| 484 | 484 |
| 485 LayoutUnit applyBeforeBreak(LayoutBox& child, LayoutUnit logicalOffset); //
If the child has a before break, then return a new yPos that shifts to the top o
f the next page/column. | 485 LayoutUnit applyBeforeBreak(LayoutBox& child, LayoutUnit logicalOffset); //
If the child has a before break, then return a new yPos that shifts to the top o
f the next page/column. |
| 486 LayoutUnit applyAfterBreak(LayoutBox& child, LayoutUnit logicalOffset, Margi
nInfo&); // If the child has an after break, then return a new offset that shift
s to the top of the next page/column. | 486 LayoutUnit applyAfterBreak(LayoutBox& child, LayoutUnit logicalOffset, Margi
nInfo&); // If the child has an after break, then return a new offset that shift
s to the top of the next page/column. |
| 487 | 487 |
| 488 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, La
youtUnit estimateWithoutPagination, LayoutBox& child, bool atBeforeSideOfBlock); | 488 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, La
youtUnit estimateWithoutPagination, LayoutBox& child, bool atBeforeSideOfBlock); |
| 489 // Computes a deltaOffset value that put a line at the top of the next page
if it doesn't fit on the current page. | 489 // Computes a deltaOffset value that put a line at the top of the next page
if it doesn't fit on the current page. |
| 490 void adjustLinePositionForPagination(RootInlineBox&, LayoutUnit& deltaOffset
); | 490 void adjustLinePositionForPagination(RootInlineBox&, LayoutUnit& deltaOffset
); |
| 491 // If the child is unsplittable and can't fit on the current page, return th
e top of the next page/column. | 491 // If the child is unsplittable and can't fit on the current page, return th
e top of the next page/column. |
| 492 LayoutUnit adjustForUnsplittableChild(LayoutBox&, LayoutUnit logicalOffset,
bool includeMargins = false); | 492 LayoutUnit adjustForUnsplittableChild(LayoutBox&, LayoutUnit logicalOffset,
bool includeMargins = false); |
| 493 | 493 |
| 494 // Used to store state between styleWillChange and styleDidChange | 494 // Used to store state between styleWillChange and styleDidChange |
| 495 static bool s_canPropagateFloatIntoSibling; | 495 static bool s_canPropagateFloatIntoSibling; |
| 496 | 496 |
| 497 LayoutBlockFlowRareData& ensureRareData(); | 497 LayoutBlockFlowRareData& ensureRareData(); |
| 498 | 498 |
| 499 LayoutUnit m_paintInvalidationLogicalTop; | 499 LayoutUnit m_paintInvalidationLogicalTop; |
| 500 LayoutUnit m_paintInvalidationLogicalBottom; | 500 LayoutUnit m_paintInvalidationLogicalBottom; |
| 501 | 501 |
| 502 virtual bool isSelfCollapsingBlock() const override; | 502 bool isSelfCollapsingBlock() const override; |
| 503 | 503 |
| 504 protected: | 504 protected: |
| 505 OwnPtr<LayoutBlockFlowRareData> m_rareData; | 505 OwnPtr<LayoutBlockFlowRareData> m_rareData; |
| 506 OwnPtr<FloatingObjects> m_floatingObjects; | 506 OwnPtr<FloatingObjects> m_floatingObjects; |
| 507 | 507 |
| 508 friend class MarginInfo; | 508 friend class MarginInfo; |
| 509 friend class LineBreaker; | 509 friend class LineBreaker; |
| 510 friend class LineWidth; // needs to know FloatingObject | 510 friend class LineWidth; // needs to know FloatingObject |
| 511 | 511 |
| 512 // FIXME-BLOCKFLOW: These methods have implementations in | 512 // FIXME-BLOCKFLOW: These methods have implementations in |
| (...skipping 30 matching lines...) Expand all Loading... |
| 543 | 543 |
| 544 // END METHODS DEFINED IN LayoutBlockFlowLine | 544 // END METHODS DEFINED IN LayoutBlockFlowLine |
| 545 | 545 |
| 546 }; | 546 }; |
| 547 | 547 |
| 548 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow()); | 548 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBlockFlow, isLayoutBlockFlow()); |
| 549 | 549 |
| 550 } // namespace blink | 550 } // namespace blink |
| 551 | 551 |
| 552 #endif // LayoutBlockFlow_h | 552 #endif // LayoutBlockFlow_h |
| OLD | NEW |