| 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 18 matching lines...) Expand all Loading... |
| 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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 RenderBlockFlow_h | 36 #ifndef RenderBlockFlow_h |
| 37 #define RenderBlockFlow_h | 37 #define RenderBlockFlow_h |
| 38 | 38 |
| 39 #include "core/rendering/FloatingObjects.h" | |
| 40 #include "core/rendering/RenderBlock.h" | 39 #include "core/rendering/RenderBlock.h" |
| 41 #include "core/rendering/line/TrailingObjects.h" | 40 #include "core/rendering/line/TrailingObjects.h" |
| 42 #include "core/rendering/style/RenderStyleConstants.h" | 41 #include "core/rendering/style/RenderStyleConstants.h" |
| 43 | 42 |
| 44 namespace blink { | 43 namespace blink { |
| 45 | 44 |
| 46 class MarginInfo; | 45 class MarginInfo; |
| 47 class LineBreaker; | 46 class LineBreaker; |
| 48 class LineWidth; | 47 class LineWidth; |
| 48 class FloatingObject; |
| 49 | 49 |
| 50 class RenderBlockFlow : public RenderBlock { | 50 class RenderBlockFlow : public RenderBlock { |
| 51 public: | 51 public: |
| 52 explicit RenderBlockFlow(ContainerNode*); | 52 explicit RenderBlockFlow(ContainerNode*); |
| 53 virtual ~RenderBlockFlow(); | 53 virtual ~RenderBlockFlow(); |
| 54 virtual void trace(Visitor*) override; | 54 virtual void trace(Visitor*) override; |
| 55 | 55 |
| 56 static RenderBlockFlow* createAnonymous(Document*); | 56 static RenderBlockFlow* createAnonymous(Document*); |
| 57 | 57 |
| 58 virtual bool isRenderBlockFlow() const override final { return true; } | 58 virtual bool isRenderBlockFlow() const override final { return true; } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 using RenderBlock::lastRootBox; | 95 using RenderBlock::lastRootBox; |
| 96 | 96 |
| 97 virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, Layout
Unit position) override; | 97 virtual LayoutUnit logicalLeftSelectionOffset(RenderBlock* rootBlock, Layout
Unit position) override; |
| 98 virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, Layou
tUnit position) override; | 98 virtual LayoutUnit logicalRightSelectionOffset(RenderBlock* rootBlock, Layou
tUnit position) override; |
| 99 | 99 |
| 100 RootInlineBox* createAndAppendRootInlineBox(); | 100 RootInlineBox* createAndAppendRootInlineBox(); |
| 101 | 101 |
| 102 void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0, boo
l inLayout = true); | 102 void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0, boo
l inLayout = true); |
| 103 void markSiblingsWithFloatsForLayout(RenderBox* floatToRemove = 0); | 103 void markSiblingsWithFloatsForLayout(RenderBox* floatToRemove = 0); |
| 104 | 104 |
| 105 bool containsFloats() const { return m_floatingObjects && !m_floatingObjects
->set().isEmpty(); } | 105 bool containsFloats() const { return false; } |
| 106 bool containsFloat(RenderBox*) const; | 106 bool containsFloat(RenderBox*) const { return false; } |
| 107 | |
| 108 void removeFloatingObjects(); | |
| 109 | 107 |
| 110 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
override; | 108 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
override; |
| 111 | 109 |
| 112 void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveI
nsert); | 110 void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveI
nsert); |
| 113 | 111 |
| 114 bool generatesLineBoxesForInlineChild(RenderObject*); | 112 bool generatesLineBoxesForInlineChild(RenderObject*); |
| 115 | 113 |
| 116 LayoutUnit logicalTopForFloat(const FloatingObject* floatingObject) const {
return isHorizontalWritingMode() ? floatingObject->y() : floatingObject->x(); } | |
| 117 LayoutUnit logicalBottomForFloat(const FloatingObject* floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject->maxY() : floatingObject->m
axX(); } | |
| 118 LayoutUnit logicalLeftForFloat(const FloatingObject* floatingObject) const {
return isHorizontalWritingMode() ? floatingObject->x() : floatingObject->y(); } | |
| 119 LayoutUnit logicalRightForFloat(const FloatingObject* floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject->maxX() : floatingObject->ma
xY(); } | |
| 120 LayoutUnit logicalWidthForFloat(const FloatingObject* floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject->width() : floatingObject->h
eight(); } | |
| 121 LayoutUnit logicalHeightForFloat(const FloatingObject* floatingObject) const
{ return isHorizontalWritingMode() ? floatingObject->height() : floatingObject-
>width(); } | |
| 122 LayoutSize logicalSizeForFloat(const FloatingObject* floatingObject) const {
return isHorizontalWritingMode() ? LayoutSize(floatingObject->width(), floating
Object->height()) : LayoutSize(floatingObject->height(), floatingObject->width()
); } | |
| 123 | |
| 124 int pixelSnappedLogicalTopForFloat(const FloatingObject* floatingObject) con
st { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnapped
Y() : floatingObject->frameRect().pixelSnappedX(); } | |
| 125 int pixelSnappedLogicalBottomForFloat(const FloatingObject* floatingObject)
const { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnap
pedMaxY() : floatingObject->frameRect().pixelSnappedMaxX(); } | |
| 126 int pixelSnappedLogicalLeftForFloat(const FloatingObject* floatingObject) co
nst { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnappe
dX() : floatingObject->frameRect().pixelSnappedY(); } | |
| 127 int pixelSnappedLogicalRightForFloat(const FloatingObject* floatingObject) c
onst { return isHorizontalWritingMode() ? floatingObject->frameRect().pixelSnapp
edMaxX() : floatingObject->frameRect().pixelSnappedMaxY(); } | |
| 128 | |
| 129 void setLogicalTopForFloat(FloatingObject* floatingObject, LayoutUnit logica
lTop) | |
| 130 { | |
| 131 if (isHorizontalWritingMode()) | |
| 132 floatingObject->setY(logicalTop); | |
| 133 else | |
| 134 floatingObject->setX(logicalTop); | |
| 135 } | |
| 136 void setLogicalLeftForFloat(FloatingObject* floatingObject, LayoutUnit logic
alLeft) | |
| 137 { | |
| 138 if (isHorizontalWritingMode()) | |
| 139 floatingObject->setX(logicalLeft); | |
| 140 else | |
| 141 floatingObject->setY(logicalLeft); | |
| 142 } | |
| 143 void setLogicalHeightForFloat(FloatingObject* floatingObject, LayoutUnit log
icalHeight) | |
| 144 { | |
| 145 if (isHorizontalWritingMode()) | |
| 146 floatingObject->setHeight(logicalHeight); | |
| 147 else | |
| 148 floatingObject->setWidth(logicalHeight); | |
| 149 } | |
| 150 void setLogicalWidthForFloat(FloatingObject* floatingObject, LayoutUnit logi
calWidth) | |
| 151 { | |
| 152 if (isHorizontalWritingMode()) | |
| 153 floatingObject->setWidth(logicalWidth); | |
| 154 else | |
| 155 floatingObject->setHeight(logicalWidth); | |
| 156 } | |
| 157 | |
| 158 LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentT
ext); | 114 LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentT
ext); |
| 159 | 115 |
| 160 void setStaticInlinePositionForChild(RenderBox*, LayoutUnit inlinePosition); | 116 void setStaticInlinePositionForChild(RenderBox*, LayoutUnit inlinePosition); |
| 161 void updateStaticInlinePositionForChild(RenderBox*, LayoutUnit logicalTop); | 117 void updateStaticInlinePositionForChild(RenderBox*, LayoutUnit logicalTop); |
| 162 | 118 |
| 163 static bool shouldSkipCreatingRunsForObject(RenderObject* obj) | 119 static bool shouldSkipCreatingRunsForObject(RenderObject* obj) |
| 164 { | 120 { |
| 165 return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style
()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline()); | 121 return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style
()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline()); |
| 166 } | 122 } |
| 167 | 123 |
| 168 void addOverflowFromInlineChildren(); | 124 void addOverflowFromInlineChildren(); |
| 169 | 125 |
| 170 // FIXME: This should be const to avoid a const_cast, but can modify child d
irty bits and RenderCombineText | 126 // FIXME: This should be const to avoid a const_cast, but can modify child d
irty bits and RenderCombineText |
| 171 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout
Unit& maxLogicalWidth); | 127 void computeInlinePreferredLogicalWidths(LayoutUnit& minLogicalWidth, Layout
Unit& maxLogicalWidth); |
| 172 | 128 |
| 173 GapRects inlineSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, | 129 GapRects inlineSelectionGaps(RenderBlock* rootBlock, const LayoutPoint& root
BlockPhysicalPosition, const LayoutSize& offsetFromRootBlock, |
| 174 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*); | 130 LayoutUnit& lastLogicalTop, LayoutUnit& lastLogicalLeft, LayoutUnit& las
tLogicalRight, const PaintInfo*); |
| 175 | 131 |
| 176 virtual bool avoidsFloats() const override; | 132 virtual bool avoidsFloats() const override; |
| 177 | 133 |
| 178 protected: | 134 protected: |
| 179 void rebuildFloatsFromIntruding(); | 135 void rebuildFloatsFromIntruding(); |
| 180 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); | 136 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); |
| 181 | 137 |
| 182 void createFloatingObjects(); | |
| 183 | |
| 184 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o
verride; | 138 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o
verride; |
| 185 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; | 139 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; |
| 186 | 140 |
| 187 void addOverflowFromFloats(); | 141 void addOverflowFromFloats(); |
| 188 | 142 |
| 189 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed
Offset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const | 143 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed
Offset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const |
| 190 { | 144 { |
| 191 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo
gicalTop, fixedOffset, logicalHeight), applyTextIndent); | 145 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo
gicalTop, fixedOffset, logicalHeight), applyTextIndent); |
| 192 } | 146 } |
| 193 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO
ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const | 147 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO
ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const |
| (...skipping 10 matching lines...) Expand all Loading... |
| 204 private: | 158 private: |
| 205 bool layoutBlockFlow(bool relayoutChildren, SubtreeLayoutScope&); | 159 bool layoutBlockFlow(bool relayoutChildren, SubtreeLayoutScope&); |
| 206 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); | 160 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); |
| 207 | 161 |
| 208 void layoutBlockChild(RenderBox* child, MarginInfo&, LayoutUnit& previousFlo
atLogicalBottom); | 162 void layoutBlockChild(RenderBox* child, MarginInfo&, LayoutUnit& previousFlo
atLogicalBottom); |
| 209 void adjustPositionedBlock(RenderBox* child, const MarginInfo&); | 163 void adjustPositionedBlock(RenderBox* child, const MarginInfo&); |
| 210 void adjustFloatingBlock(const MarginInfo&); | 164 void adjustFloatingBlock(const MarginInfo&); |
| 211 | 165 |
| 212 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const Lay
outPoint&) const; | 166 LayoutPoint flipFloatForWritingModeForChild(const FloatingObject*, const Lay
outPoint&) const; |
| 213 | 167 |
| 214 LayoutUnit xPositionForFloatIncludingMargin(const FloatingObject* child) con
st | |
| 215 { | |
| 216 if (isHorizontalWritingMode()) | |
| 217 return child->x() + child->renderer()->marginLeft(); | |
| 218 | |
| 219 return child->x() + marginBeforeForChild(child->renderer()); | |
| 220 } | |
| 221 | |
| 222 LayoutUnit yPositionForFloatIncludingMargin(const FloatingObject* child) con
st | |
| 223 { | |
| 224 if (isHorizontalWritingMode()) | |
| 225 return child->y() + marginBeforeForChild(child->renderer()); | |
| 226 | |
| 227 return child->y() + child->renderer()->marginTop(); | |
| 228 } | |
| 229 | |
| 230 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit
logicalTopOffset) const; | 168 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit
logicalTopOffset) const; |
| 231 | 169 |
| 232 FloatingObject* insertFloatingObject(RenderBox*); | |
| 233 void removeFloatingObject(RenderBox*); | |
| 234 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); | |
| 235 | |
| 236 // Called from lineWidth, to position the floats added in the last line. | 170 // Called from lineWidth, to position the floats added in the last line. |
| 237 // Returns true if and only if it has positioned any floats. | 171 // Returns true if and only if it has positioned any floats. |
| 238 bool positionNewFloats(); | 172 bool positionNewFloats(); |
| 239 | 173 |
| 240 LayoutUnit getClearDelta(RenderBox* child, LayoutUnit yPos); | 174 LayoutUnit getClearDelta(RenderBox* child, LayoutUnit yPos); |
| 241 | 175 |
| 242 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF
loatLogicalBottom() > logicalHeight(); } | 176 bool hasOverhangingFloats() { return parent() && containsFloats() && lowestF
loatLogicalBottom() > logicalHeight(); } |
| 243 bool hasOverhangingFloat(RenderBox*); | 177 bool hasOverhangingFloat(RenderBox*); |
| 244 void addIntrudingFloats(RenderBlockFlow* prev, LayoutUnit xoffset, LayoutUni
t yoffset); | 178 void addIntrudingFloats(RenderBlockFlow* prev, LayoutUnit xoffset, LayoutUni
t yoffset); |
| 245 void addOverhangingFloats(RenderBlockFlow* child, bool makeChildPaintOtherFl
oats); | 179 void addOverhangingFloats(RenderBlockFlow* child, bool makeChildPaintOtherFl
oats); |
| 246 | 180 |
| 247 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F
loatLeftRight) const; | 181 // FIXME(sky): Remove this. |
| 248 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMo
de = ShapeOutsideFloatMarginBoxOffset) const; | 182 LayoutUnit lowestFloatLogicalBottom() const { return 0; } |
| 249 | 183 |
| 250 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation& locationInContainer, const LayoutPoint& accumulatedOffset) override
final; | 184 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation& locationInContainer, const LayoutPoint& accumulatedOffset) override
final; |
| 251 | 185 |
| 252 virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants) o
verride final; | 186 virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants) o
verride final; |
| 253 virtual void invalidatePaintForOverflow() override final; | 187 virtual void invalidatePaintForOverflow() override final; |
| 254 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool preservePhase
= false) override final; | 188 virtual void paintFloats(PaintInfo&, const LayoutPoint&, bool preservePhase
= false) override final; |
| 255 virtual void clipOutFloatingObjects(RenderBlock*, const PaintInfo*, const La
youtPoint&, const LayoutSize&) override; | |
| 256 void clearFloats(EClear); | 189 void clearFloats(EClear); |
| 257 | 190 |
| 258 LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit
fixedOffset, LayoutUnit logicalHeight) const; | 191 LayoutUnit logicalRightFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit
fixedOffset, LayoutUnit logicalHeight) const; |
| 259 LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit f
ixedOffset, LayoutUnit logicalHeight) const; | 192 LayoutUnit logicalLeftFloatOffsetForLine(LayoutUnit logicalTop, LayoutUnit f
ixedOffset, LayoutUnit logicalHeight) const; |
| 260 | 193 |
| 261 LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit logicalTop, Layo
utUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; | 194 LayoutUnit logicalRightOffsetForPositioningFloat(LayoutUnit logicalTop, Layo
utUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; |
| 262 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, Layou
tUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; | 195 LayoutUnit logicalLeftOffsetForPositioningFloat(LayoutUnit logicalTop, Layou
tUnit fixedOffset, bool applyTextIndent, LayoutUnit* heightRemaining) const; |
| 263 | 196 |
| 264 LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool
applyTextIndent) const; | 197 LayoutUnit adjustLogicalRightOffsetForLine(LayoutUnit offsetFromFloats, bool
applyTextIndent) const; |
| 265 LayoutUnit adjustLogicalLeftOffsetForLine(LayoutUnit offsetFromFloats, bool
applyTextIndent) const; | 198 LayoutUnit adjustLogicalLeftOffsetForLine(LayoutUnit offsetFromFloats, bool
applyTextIndent) const; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 342 |
| 410 RenderBlockFlowRareData& ensureRareData(); | 343 RenderBlockFlowRareData& ensureRareData(); |
| 411 | 344 |
| 412 LayoutUnit m_paintInvalidationLogicalTop; | 345 LayoutUnit m_paintInvalidationLogicalTop; |
| 413 LayoutUnit m_paintInvalidationLogicalBottom; | 346 LayoutUnit m_paintInvalidationLogicalBottom; |
| 414 | 347 |
| 415 virtual bool isSelfCollapsingBlock() const override; | 348 virtual bool isSelfCollapsingBlock() const override; |
| 416 | 349 |
| 417 protected: | 350 protected: |
| 418 OwnPtr<RenderBlockFlowRareData> m_rareData; | 351 OwnPtr<RenderBlockFlowRareData> m_rareData; |
| 419 OwnPtr<FloatingObjects> m_floatingObjects; | |
| 420 | 352 |
| 421 friend class BreakingContext; // FIXME: It uses insertFloatingObject and pos
itionNewFloatOnLine, if we move those out from the private scope/add a helper to
LineBreaker, we can remove this friend | 353 friend class BreakingContext; // FIXME: It uses insertFloatingObject and pos
itionNewFloatOnLine, if we move those out from the private scope/add a helper to
LineBreaker, we can remove this friend |
| 422 friend class MarginInfo; | 354 friend class MarginInfo; |
| 423 friend class LineBreaker; | 355 friend class LineBreaker; |
| 424 friend class LineWidth; // needs to know FloatingObject | |
| 425 | 356 |
| 426 // FIXME-BLOCKFLOW: These methods have implementations in | 357 // FIXME-BLOCKFLOW: These methods have implementations in |
| 427 // RenderBlockLineLayout. They should be moved to the proper header once the | 358 // RenderBlockLineLayout. They should be moved to the proper header once the |
| 428 // line layout code is separated from RenderBlock and RenderBlockFlow. | 359 // line layout code is separated from RenderBlock and RenderBlockFlow. |
| 429 // START METHODS DEFINED IN RenderBlockLineLayout | 360 // START METHODS DEFINED IN RenderBlockLineLayout |
| 430 private: | 361 private: |
| 431 InlineFlowBox* createLineBoxes(RenderObject*, const LineInfo&, InlineBox* ch
ildBox); | 362 InlineFlowBox* createLineBoxes(RenderObject*, const LineInfo&, InlineBox* ch
ildBox); |
| 432 RootInlineBox* constructLine(BidiRunList<BidiRun>&, const LineInfo&); | 363 RootInlineBox* constructLine(BidiRunList<BidiRun>&, const LineInfo&); |
| 433 void computeInlineDirectionPositionsForLine(RootInlineBox*, const LineInfo&,
BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAnd
FallbackFontsMap&, VerticalPositionCache&, WordMeasurements&); | 364 void computeInlineDirectionPositionsForLine(RootInlineBox*, const LineInfo&,
BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAnd
FallbackFontsMap&, VerticalPositionCache&, WordMeasurements&); |
| 434 BidiRun* computeInlineDirectionPositionsForSegment(RootInlineBox*, const Lin
eInfo&, ETextAlign, float& logicalLeft, | 365 BidiRun* computeInlineDirectionPositionsForSegment(RootInlineBox*, const Lin
eInfo&, ETextAlign, float& logicalLeft, |
| 435 float& availableLogicalWidth, BidiRun* firstRun, BidiRun* trailingSpaceR
un, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache&, Wo
rdMeasurements&); | 366 float& availableLogicalWidth, BidiRun* firstRun, BidiRun* trailingSpaceR
un, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, VerticalPositionCache&, Wo
rdMeasurements&); |
| 436 void computeBlockDirectionPositionsForLine(RootInlineBox*, BidiRun*, GlyphOv
erflowAndFallbackFontsMap&, VerticalPositionCache&); | 367 void computeBlockDirectionPositionsForLine(RootInlineBox*, BidiRun*, GlyphOv
erflowAndFallbackFontsMap&, VerticalPositionCache&); |
| 437 BidiRun* handleTrailingSpaces(BidiRunList<BidiRun>&, BidiContext*); | 368 BidiRun* handleTrailingSpaces(BidiRunList<BidiRun>&, BidiContext*); |
| 438 void appendFloatingObjectToLastLine(FloatingObject*); | |
| 439 // Helper function for layoutInlineChildren() | 369 // Helper function for layoutInlineChildren() |
| 440 RootInlineBox* createLineBoxesFromBidiRuns(unsigned bidiLevel, BidiRunList<B
idiRun>&, const InlineIterator& end, LineInfo&, VerticalPositionCache&, BidiRun*
trailingSpaceRun, WordMeasurements&); | 370 RootInlineBox* createLineBoxesFromBidiRuns(unsigned bidiLevel, BidiRunList<B
idiRun>&, const InlineIterator& end, LineInfo&, VerticalPositionCache&, BidiRun*
trailingSpaceRun, WordMeasurements&); |
| 441 void layoutRunsAndFloats(LineLayoutState&); | 371 void layoutRunsAndFloats(LineLayoutState&); |
| 442 const InlineIterator& restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogica
lHeight, LayoutUnit newLogicalHeight, FloatingObject* lastFloatFromPreviousLine
, InlineBidiResolver&, const InlineIterator&); | 372 const InlineIterator& restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogica
lHeight, LayoutUnit newLogicalHeight, FloatingObject* lastFloatFromPreviousLine
, InlineBidiResolver&, const InlineIterator&); |
| 443 void layoutRunsAndFloatsInRange(LineLayoutState&, InlineBidiResolver&, | 373 void layoutRunsAndFloatsInRange(LineLayoutState&, InlineBidiResolver&, |
| 444 const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiSta
tus); | 374 const InlineIterator& cleanLineStart, const BidiStatus& cleanLineBidiSta
tus); |
| 445 void linkToEndLineIfNeeded(LineLayoutState&); | 375 void linkToEndLineIfNeeded(LineLayoutState&); |
| 446 static void markDirtyFloatsForPaintInvalidation(Vector<FloatWithRect>& float
s); | 376 static void markDirtyFloatsForPaintInvalidation(Vector<FloatWithRect>& float
s); |
| 447 void checkFloatsInCleanLine(RootInlineBox*, Vector<FloatWithRect>&, size_t&
floatIndex, bool& encounteredNewFloat, bool& dirtiedByFloat); | 377 void checkFloatsInCleanLine(RootInlineBox*, Vector<FloatWithRect>&, size_t&
floatIndex, bool& encounteredNewFloat, bool& dirtiedByFloat); |
| 448 RootInlineBox* determineStartPosition(LineLayoutState&, InlineBidiResolver&)
; | 378 RootInlineBox* determineStartPosition(LineLayoutState&, InlineBidiResolver&)
; |
| 449 void determineEndPosition(LineLayoutState&, RootInlineBox* startBox, InlineI
terator& cleanLineStart, BidiStatus& cleanLineBidiStatus); | 379 void determineEndPosition(LineLayoutState&, RootInlineBox* startBox, InlineI
terator& cleanLineStart, BidiStatus& cleanLineBidiStatus); |
| 450 bool checkPaginationAndFloatsAtEndLine(LineLayoutState&); | 380 bool checkPaginationAndFloatsAtEndLine(LineLayoutState&); |
| 451 bool matchedEndLine(LineLayoutState&, const InlineBidiResolver&, const Inlin
eIterator& endLineStart, const BidiStatus& endLineStatus); | 381 bool matchedEndLine(LineLayoutState&, const InlineBidiResolver&, const Inlin
eIterator& endLineStart, const BidiStatus& endLineStatus); |
| 452 void deleteEllipsisLineBoxes(); | 382 void deleteEllipsisLineBoxes(); |
| 453 void checkLinesForTextOverflow(); | 383 void checkLinesForTextOverflow(); |
| 454 // Positions new floats and also adjust all floats encountered on the line i
f any of them | |
| 455 // have to move to the next page/column. | |
| 456 bool positionNewFloatOnLine(FloatingObject* newFloat, FloatingObject* lastFl
oatFromPreviousLine, LineInfo&, LineWidth&); | |
| 457 | 384 |
| 458 | 385 |
| 459 // END METHODS DEFINED IN RenderBlockLineLayout | 386 // END METHODS DEFINED IN RenderBlockLineLayout |
| 460 | 387 |
| 461 }; | 388 }; |
| 462 | 389 |
| 463 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); | 390 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); |
| 464 | 391 |
| 465 } // namespace blink | 392 } // namespace blink |
| 466 | 393 |
| 467 #endif // RenderBlockFlow_h | 394 #endif // RenderBlockFlow_h |
| OLD | NEW |