| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 using RenderBlock::firstLineBox; | 96 using RenderBlock::firstLineBox; |
| 97 using RenderBlock::lastLineBox; | 97 using RenderBlock::lastLineBox; |
| 98 using RenderBlock::firstRootBox; | 98 using RenderBlock::firstRootBox; |
| 99 using RenderBlock::lastRootBox; | 99 using RenderBlock::lastRootBox; |
| 100 | 100 |
| 101 virtual LayoutUnit logicalLeftSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const override; | 101 virtual LayoutUnit logicalLeftSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const override; |
| 102 virtual LayoutUnit logicalRightSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const override; | 102 virtual LayoutUnit logicalRightSelectionOffset(const RenderBlock* rootBlock,
LayoutUnit position) const override; |
| 103 | 103 |
| 104 RootInlineBox* createAndAppendRootInlineBox(); | 104 RootInlineBox* createAndAppendRootInlineBox(); |
| 105 | 105 |
| 106 void markAllDescendantsWithFloatsForLayout(RenderBox* floatToRemove = 0, boo
l inLayout = true); | 106 void markAllDescendantsWithFloatsForLayout(LayoutBox* floatToRemove = 0, boo
l inLayout = true); |
| 107 void markSiblingsWithFloatsForLayout(RenderBox* floatToRemove = 0); | 107 void markSiblingsWithFloatsForLayout(LayoutBox* floatToRemove = 0); |
| 108 | 108 |
| 109 bool containsFloats() const { return m_floatingObjects && !m_floatingObjects
->set().isEmpty(); } | 109 bool containsFloats() const { return m_floatingObjects && !m_floatingObjects
->set().isEmpty(); } |
| 110 bool containsFloat(RenderBox*) const; | 110 bool containsFloat(LayoutBox*) const; |
| 111 | 111 |
| 112 void removeFloatingObjects(); | 112 void removeFloatingObjects(); |
| 113 | 113 |
| 114 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0)
override; | 114 virtual void addChild(LayoutObject* newChild, LayoutObject* beforeChild = 0)
override; |
| 115 | 115 |
| 116 void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveI
nsert); | 116 void moveAllChildrenIncludingFloatsTo(RenderBlock* toBlock, bool fullRemoveI
nsert); |
| 117 | 117 |
| 118 bool generatesLineBoxesForInlineChild(LayoutObject*); | 118 bool generatesLineBoxesForInlineChild(LayoutObject*); |
| 119 | 119 |
| 120 LayoutUnit logicalTopForFloat(const FloatingObject* floatingObject) const {
return isHorizontalWritingMode() ? floatingObject->y() : floatingObject->x(); } | 120 LayoutUnit logicalTopForFloat(const FloatingObject* floatingObject) const {
return isHorizontalWritingMode() ? floatingObject->y() : floatingObject->x(); } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void setLogicalWidthForFloat(FloatingObject* floatingObject, LayoutUnit logi
calWidth) | 154 void setLogicalWidthForFloat(FloatingObject* floatingObject, LayoutUnit logi
calWidth) |
| 155 { | 155 { |
| 156 if (isHorizontalWritingMode()) | 156 if (isHorizontalWritingMode()) |
| 157 floatingObject->setWidth(logicalWidth); | 157 floatingObject->setWidth(logicalWidth); |
| 158 else | 158 else |
| 159 floatingObject->setHeight(logicalWidth); | 159 floatingObject->setHeight(logicalWidth); |
| 160 } | 160 } |
| 161 | 161 |
| 162 LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentT
ext); | 162 LayoutUnit startAlignedOffsetForLine(LayoutUnit position, bool shouldIndentT
ext); |
| 163 | 163 |
| 164 void setStaticInlinePositionForChild(RenderBox&, LayoutUnit inlinePosition); | 164 void setStaticInlinePositionForChild(LayoutBox&, LayoutUnit inlinePosition); |
| 165 void updateStaticInlinePositionForChild(RenderBox&, LayoutUnit logicalTop); | 165 void updateStaticInlinePositionForChild(LayoutBox&, LayoutUnit logicalTop); |
| 166 | 166 |
| 167 static bool shouldSkipCreatingRunsForObject(LayoutObject* obj) | 167 static bool shouldSkipCreatingRunsForObject(LayoutObject* obj) |
| 168 { | 168 { |
| 169 return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style
()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline()); | 169 return obj->isFloating() || (obj->isOutOfFlowPositioned() && !obj->style
()->isOriginalDisplayInlineType() && !obj->container()->isRenderInline()); |
| 170 } | 170 } |
| 171 | 171 |
| 172 LayoutMultiColumnFlowThread* multiColumnFlowThread() const { return m_rareDa
ta ? m_rareData->m_multiColumnFlowThread : 0; } | 172 LayoutMultiColumnFlowThread* multiColumnFlowThread() const { return m_rareDa
ta ? m_rareData->m_multiColumnFlowThread : 0; } |
| 173 void resetMultiColumnFlowThread() | 173 void resetMultiColumnFlowThread() |
| 174 { | 174 { |
| 175 if (m_rareData) | 175 if (m_rareData) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 protected: | 241 protected: |
| 242 void rebuildFloatsFromIntruding(); | 242 void rebuildFloatsFromIntruding(); |
| 243 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); | 243 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& paintInvalidati
onLogicalTop, LayoutUnit& paintInvalidationLogicalBottom, LayoutUnit afterEdge); |
| 244 | 244 |
| 245 void createFloatingObjects(); | 245 void createFloatingObjects(); |
| 246 | 246 |
| 247 virtual void styleWillChange(StyleDifference, const LayoutStyle& newStyle) o
verride; | 247 virtual void styleWillChange(StyleDifference, const LayoutStyle& newStyle) o
verride; |
| 248 virtual void styleDidChange(StyleDifference, const LayoutStyle* oldStyle) ov
erride; | 248 virtual void styleDidChange(StyleDifference, const LayoutStyle* oldStyle) ov
erride; |
| 249 | 249 |
| 250 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, RenderBox&
); | 250 void updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, LayoutBox&
); |
| 251 | 251 |
| 252 void addOverflowFromFloats(); | 252 void addOverflowFromFloats(); |
| 253 | 253 |
| 254 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed
Offset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const | 254 LayoutUnit logicalRightOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixed
Offset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const |
| 255 { | 255 { |
| 256 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo
gicalTop, fixedOffset, logicalHeight), applyTextIndent); | 256 return adjustLogicalRightOffsetForLine(logicalRightFloatOffsetForLine(lo
gicalTop, fixedOffset, logicalHeight), applyTextIndent); |
| 257 } | 257 } |
| 258 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO
ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const | 258 LayoutUnit logicalLeftOffsetForLine(LayoutUnit logicalTop, LayoutUnit fixedO
ffset, bool applyTextIndent, LayoutUnit logicalHeight = 0) const |
| 259 { | 259 { |
| 260 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi
calTop, fixedOffset, logicalHeight), applyTextIndent); | 260 return adjustLogicalLeftOffsetForLine(logicalLeftFloatOffsetForLine(logi
calTop, fixedOffset, logicalHeight), applyTextIndent); |
| 261 } | 261 } |
| 262 | 262 |
| 263 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/,
SubtreeLayoutScope&); | 263 virtual LayoutObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/,
SubtreeLayoutScope&); |
| 264 virtual bool updateLogicalWidthAndColumnWidth() override; | 264 virtual bool updateLogicalWidthAndColumnWidth() override; |
| 265 | 265 |
| 266 void setLogicalLeftForChild(RenderBox& child, LayoutUnit logicalLeft); | 266 void setLogicalLeftForChild(LayoutBox& child, LayoutUnit logicalLeft); |
| 267 void setLogicalTopForChild(RenderBox& child, LayoutUnit logicalTop); | 267 void setLogicalTopForChild(LayoutBox& child, LayoutUnit logicalTop); |
| 268 void determineLogicalLeftPositionForChild(RenderBox& child); | 268 void determineLogicalLeftPositionForChild(LayoutBox& child); |
| 269 | 269 |
| 270 private: | 270 private: |
| 271 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S
ubtreeLayoutScope&); | 271 bool layoutBlockFlow(bool relayoutChildren, LayoutUnit& pageLogicalHeight, S
ubtreeLayoutScope&); |
| 272 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); | 272 void layoutBlockChildren(bool relayoutChildren, SubtreeLayoutScope&, LayoutU
nit beforeEdge, LayoutUnit afterEdge); |
| 273 | 273 |
| 274 void layoutBlockChild(RenderBox& child, MarginInfo&, LayoutUnit& previousFlo
atLogicalBottom); | 274 void layoutBlockChild(LayoutBox& child, MarginInfo&, LayoutUnit& previousFlo
atLogicalBottom); |
| 275 void adjustPositionedBlock(RenderBox& child, const MarginInfo&); | 275 void adjustPositionedBlock(LayoutBox& child, const MarginInfo&); |
| 276 void adjustFloatingBlock(const MarginInfo&); | 276 void adjustFloatingBlock(const MarginInfo&); |
| 277 | 277 |
| 278 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit
logicalTopOffset) const; | 278 LayoutPoint computeLogicalLocationForFloat(const FloatingObject*, LayoutUnit
logicalTopOffset) const; |
| 279 | 279 |
| 280 FloatingObject* insertFloatingObject(RenderBox&); | 280 FloatingObject* insertFloatingObject(LayoutBox&); |
| 281 void removeFloatingObject(RenderBox*); | 281 void removeFloatingObject(LayoutBox*); |
| 282 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); | 282 void removeFloatingObjectsBelow(FloatingObject*, int logicalOffset); |
| 283 | 283 |
| 284 // Called from lineWidth, to position the floats added in the last line. | 284 // Called from lineWidth, to position the floats added in the last line. |
| 285 // Returns true if and only if it has positioned any floats. | 285 // Returns true if and only if it has positioned any floats. |
| 286 bool positionNewFloats(LineWidth* = 0); | 286 bool positionNewFloats(LineWidth* = 0); |
| 287 | 287 |
| 288 LayoutUnit getClearDelta(RenderBox* child, LayoutUnit yPos); | 288 LayoutUnit getClearDelta(LayoutBox* child, LayoutUnit yPos); |
| 289 | 289 |
| 290 bool hasOverhangingFloats() { return parent() && !hasColumns() && containsFl
oats() && lowestFloatLogicalBottom() > logicalHeight(); } | 290 bool hasOverhangingFloats() { return parent() && !hasColumns() && containsFl
oats() && lowestFloatLogicalBottom() > logicalHeight(); } |
| 291 bool hasOverhangingFloat(RenderBox*); | 291 bool hasOverhangingFloat(LayoutBox*); |
| 292 void addIntrudingFloats(RenderBlockFlow* prev, LayoutUnit xoffset, LayoutUni
t yoffset); | 292 void addIntrudingFloats(RenderBlockFlow* prev, LayoutUnit xoffset, LayoutUni
t yoffset); |
| 293 void addOverhangingFloats(RenderBlockFlow* child, bool makeChildPaintOtherFl
oats); | 293 void addOverhangingFloats(RenderBlockFlow* child, bool makeChildPaintOtherFl
oats); |
| 294 | 294 |
| 295 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F
loatLeftRight) const; | 295 LayoutUnit lowestFloatLogicalBottom(FloatingObject::Type = FloatingObject::F
loatLeftRight) const; |
| 296 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMo
de = ShapeOutsideFloatMarginBoxOffset) const; | 296 LayoutUnit nextFloatLogicalBottomBelow(LayoutUnit, ShapeOutsideFloatOffsetMo
de = ShapeOutsideFloatMarginBoxOffset) const; |
| 297 | 297 |
| 298 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation& locationInContainer, const LayoutPoint& accumulatedOffset) override
final; | 298 virtual bool hitTestFloats(const HitTestRequest&, HitTestResult&, const HitT
estLocation& locationInContainer, const LayoutPoint& accumulatedOffset) override
final; |
| 299 | 299 |
| 300 virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants) o
verride final; | 300 virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants) o
verride final; |
| 301 virtual void invalidatePaintForOverflow() override final; | 301 virtual void invalidatePaintForOverflow() override final; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 bool shouldBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData
->m_lineBreakToAvoidWidow >= 0; } | 336 bool shouldBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData
->m_lineBreakToAvoidWidow >= 0; } |
| 337 void clearShouldBreakAtLineToAvoidWidow() const; | 337 void clearShouldBreakAtLineToAvoidWidow() const; |
| 338 int lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBr
eakToAvoidWidow : -1; } | 338 int lineBreakToAvoidWidow() const { return m_rareData ? m_rareData->m_lineBr
eakToAvoidWidow : -1; } |
| 339 void setBreakAtLineToAvoidWidow(int); | 339 void setBreakAtLineToAvoidWidow(int); |
| 340 void clearDidBreakAtLineToAvoidWidow(); | 340 void clearDidBreakAtLineToAvoidWidow(); |
| 341 void setDidBreakAtLineToAvoidWidow(); | 341 void setDidBreakAtLineToAvoidWidow(); |
| 342 bool didBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m
_didBreakAtLineToAvoidWidow; } | 342 bool didBreakAtLineToAvoidWidow() const { return m_rareData && m_rareData->m
_didBreakAtLineToAvoidWidow; } |
| 343 | 343 |
| 344 public: | 344 public: |
| 345 struct FloatWithRect { | 345 struct FloatWithRect { |
| 346 FloatWithRect(RenderBox* f) | 346 FloatWithRect(LayoutBox* f) |
| 347 : object(f) | 347 : object(f) |
| 348 , rect(f->frameRect()) | 348 , rect(f->frameRect()) |
| 349 , everHadLayout(f->everHadLayout()) | 349 , everHadLayout(f->everHadLayout()) |
| 350 { | 350 { |
| 351 rect.expand(f->marginBoxOutsets()); | 351 rect.expand(f->marginBoxOutsets()); |
| 352 } | 352 } |
| 353 | 353 |
| 354 RenderBox* object; | 354 LayoutBox* object; |
| 355 LayoutRect rect; | 355 LayoutRect rect; |
| 356 bool everHadLayout; | 356 bool everHadLayout; |
| 357 }; | 357 }; |
| 358 | 358 |
| 359 class MarginValues { | 359 class MarginValues { |
| 360 public: | 360 public: |
| 361 MarginValues(LayoutUnit beforePos, LayoutUnit beforeNeg, LayoutUnit afte
rPos, LayoutUnit afterNeg) | 361 MarginValues(LayoutUnit beforePos, LayoutUnit beforeNeg, LayoutUnit afte
rPos, LayoutUnit afterNeg) |
| 362 : m_positiveMarginBefore(beforePos) | 362 : m_positiveMarginBefore(beforePos) |
| 363 , m_negativeMarginBefore(beforeNeg) | 363 , m_negativeMarginBefore(beforeNeg) |
| 364 , m_positiveMarginAfter(afterPos) | 364 , m_positiveMarginAfter(afterPos) |
| 365 , m_negativeMarginAfter(afterNeg) | 365 , m_negativeMarginAfter(afterNeg) |
| 366 { } | 366 { } |
| 367 | 367 |
| 368 LayoutUnit positiveMarginBefore() const { return m_positiveMarginBefore;
} | 368 LayoutUnit positiveMarginBefore() const { return m_positiveMarginBefore;
} |
| 369 LayoutUnit negativeMarginBefore() const { return m_negativeMarginBefore;
} | 369 LayoutUnit negativeMarginBefore() const { return m_negativeMarginBefore;
} |
| 370 LayoutUnit positiveMarginAfter() const { return m_positiveMarginAfter; } | 370 LayoutUnit positiveMarginAfter() const { return m_positiveMarginAfter; } |
| 371 LayoutUnit negativeMarginAfter() const { return m_negativeMarginAfter; } | 371 LayoutUnit negativeMarginAfter() const { return m_negativeMarginAfter; } |
| 372 | 372 |
| 373 void setPositiveMarginBefore(LayoutUnit pos) { m_positiveMarginBefore =
pos; } | 373 void setPositiveMarginBefore(LayoutUnit pos) { m_positiveMarginBefore =
pos; } |
| 374 void setNegativeMarginBefore(LayoutUnit neg) { m_negativeMarginBefore =
neg; } | 374 void setNegativeMarginBefore(LayoutUnit neg) { m_negativeMarginBefore =
neg; } |
| 375 void setPositiveMarginAfter(LayoutUnit pos) { m_positiveMarginAfter = po
s; } | 375 void setPositiveMarginAfter(LayoutUnit pos) { m_positiveMarginAfter = po
s; } |
| 376 void setNegativeMarginAfter(LayoutUnit neg) { m_negativeMarginAfter = ne
g; } | 376 void setNegativeMarginAfter(LayoutUnit neg) { m_negativeMarginAfter = ne
g; } |
| 377 | 377 |
| 378 private: | 378 private: |
| 379 LayoutUnit m_positiveMarginBefore; | 379 LayoutUnit m_positiveMarginBefore; |
| 380 LayoutUnit m_negativeMarginBefore; | 380 LayoutUnit m_negativeMarginBefore; |
| 381 LayoutUnit m_positiveMarginAfter; | 381 LayoutUnit m_positiveMarginAfter; |
| 382 LayoutUnit m_negativeMarginAfter; | 382 LayoutUnit m_negativeMarginAfter; |
| 383 }; | 383 }; |
| 384 MarginValues marginValuesForChild(RenderBox& child) const; | 384 MarginValues marginValuesForChild(LayoutBox& child) const; |
| 385 | 385 |
| 386 // Allocated only when some of these fields have non-default values | 386 // Allocated only when some of these fields have non-default values |
| 387 struct RenderBlockFlowRareData { | 387 struct RenderBlockFlowRareData { |
| 388 WTF_MAKE_NONCOPYABLE(RenderBlockFlowRareData); WTF_MAKE_FAST_ALLOCATED; | 388 WTF_MAKE_NONCOPYABLE(RenderBlockFlowRareData); WTF_MAKE_FAST_ALLOCATED; |
| 389 public: | 389 public: |
| 390 RenderBlockFlowRareData(const RenderBlockFlow* block) | 390 RenderBlockFlowRareData(const RenderBlockFlow* block) |
| 391 : m_margins(positiveMarginBeforeDefault(block), negativeMarginBefore
Default(block), positiveMarginAfterDefault(block), negativeMarginAfterDefault(bl
ock)) | 391 : m_margins(positiveMarginBeforeDefault(block), negativeMarginBefore
Default(block), positiveMarginAfterDefault(block), negativeMarginAfterDefault(bl
ock)) |
| 392 , m_paginationStrut(0) | 392 , m_paginationStrut(0) |
| 393 , m_multiColumnFlowThread(nullptr) | 393 , m_multiColumnFlowThread(nullptr) |
| 394 , m_lineBreakToAvoidWidow(-1) | 394 , m_lineBreakToAvoidWidow(-1) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 void setMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg); | 439 void setMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg); |
| 440 void setMaxMarginAfterValues(LayoutUnit pos, LayoutUnit neg); | 440 void setMaxMarginAfterValues(LayoutUnit pos, LayoutUnit neg); |
| 441 | 441 |
| 442 void setMustDiscardMarginBefore(bool = true); | 442 void setMustDiscardMarginBefore(bool = true); |
| 443 void setMustDiscardMarginAfter(bool = true); | 443 void setMustDiscardMarginAfter(bool = true); |
| 444 | 444 |
| 445 bool mustDiscardMarginBefore() const; | 445 bool mustDiscardMarginBefore() const; |
| 446 bool mustDiscardMarginAfter() const; | 446 bool mustDiscardMarginAfter() const; |
| 447 | 447 |
| 448 bool mustDiscardMarginBeforeForChild(const RenderBox&) const; | 448 bool mustDiscardMarginBeforeForChild(const LayoutBox&) const; |
| 449 bool mustDiscardMarginAfterForChild(const RenderBox&) const; | 449 bool mustDiscardMarginAfterForChild(const LayoutBox&) const; |
| 450 | 450 |
| 451 bool mustSeparateMarginBeforeForChild(const RenderBox&) const; | 451 bool mustSeparateMarginBeforeForChild(const LayoutBox&) const; |
| 452 bool mustSeparateMarginAfterForChild(const RenderBox&) const; | 452 bool mustSeparateMarginAfterForChild(const LayoutBox&) const; |
| 453 | 453 |
| 454 void initMaxMarginValues() | 454 void initMaxMarginValues() |
| 455 { | 455 { |
| 456 if (m_rareData) { | 456 if (m_rareData) { |
| 457 m_rareData->m_margins = MarginValues(RenderBlockFlowRareData::positi
veMarginBeforeDefault(this) , RenderBlockFlowRareData::negativeMarginBeforeDefau
lt(this), | 457 m_rareData->m_margins = MarginValues(RenderBlockFlowRareData::positi
veMarginBeforeDefault(this) , RenderBlockFlowRareData::negativeMarginBeforeDefau
lt(this), |
| 458 RenderBlockFlowRareData::positiveMarginAfterDefault(this), Rende
rBlockFlowRareData::negativeMarginAfterDefault(this)); | 458 RenderBlockFlowRareData::positiveMarginAfterDefault(this), Rende
rBlockFlowRareData::negativeMarginAfterDefault(this)); |
| 459 | 459 |
| 460 m_rareData->m_discardMarginBefore = false; | 460 m_rareData->m_discardMarginBefore = false; |
| 461 m_rareData->m_discardMarginAfter = false; | 461 m_rareData->m_discardMarginAfter = false; |
| 462 } | 462 } |
| 463 } | 463 } |
| 464 | 464 |
| 465 virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const; | 465 virtual ETextAlign textAlignmentForLine(bool endsWithSoftBreak) const; |
| 466 private: | 466 private: |
| 467 virtual LayoutUnit collapsedMarginBefore() const override final { return max
PositiveMarginBefore() - maxNegativeMarginBefore(); } | 467 virtual LayoutUnit collapsedMarginBefore() const override final { return max
PositiveMarginBefore() - maxNegativeMarginBefore(); } |
| 468 virtual LayoutUnit collapsedMarginAfter() const override final { return maxP
ositiveMarginAfter() - maxNegativeMarginAfter(); } | 468 virtual LayoutUnit collapsedMarginAfter() const override final { return maxP
ositiveMarginAfter() - maxNegativeMarginAfter(); } |
| 469 | 469 |
| 470 LayoutUnit collapseMargins(RenderBox& child, MarginInfo&, bool childIsSelfCo
llapsing); | 470 LayoutUnit collapseMargins(LayoutBox& child, MarginInfo&, bool childIsSelfCo
llapsing); |
| 471 LayoutUnit clearFloatsIfNeeded(RenderBox& child, MarginInfo&, LayoutUnit old
TopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPos, bool childIsSelfColla
psing); | 471 LayoutUnit clearFloatsIfNeeded(LayoutBox& child, MarginInfo&, LayoutUnit old
TopPosMargin, LayoutUnit oldTopNegMargin, LayoutUnit yPos, bool childIsSelfColla
psing); |
| 472 LayoutUnit estimateLogicalTopPosition(RenderBox& child, const MarginInfo&, L
ayoutUnit& estimateWithoutPagination); | 472 LayoutUnit estimateLogicalTopPosition(LayoutBox& child, const MarginInfo&, L
ayoutUnit& estimateWithoutPagination); |
| 473 void marginBeforeEstimateForChild(RenderBox&, LayoutUnit&, LayoutUnit&, bool
&) const; | 473 void marginBeforeEstimateForChild(LayoutBox&, LayoutUnit&, LayoutUnit&, bool
&) const; |
| 474 void handleAfterSideOfBlock(RenderBox* lastChild, LayoutUnit top, LayoutUnit
bottom, MarginInfo&); | 474 void handleAfterSideOfBlock(LayoutBox* lastChild, LayoutUnit top, LayoutUnit
bottom, MarginInfo&); |
| 475 void setCollapsedBottomMargin(const MarginInfo&); | 475 void setCollapsedBottomMargin(const MarginInfo&); |
| 476 | 476 |
| 477 LayoutUnit applyBeforeBreak(RenderBox& 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. | 477 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. |
| 478 LayoutUnit applyAfterBreak(RenderBox& 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. | 478 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. |
| 479 | 479 |
| 480 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, La
youtUnit estimateWithoutPagination, RenderBox& child, bool atBeforeSideOfBlock); | 480 LayoutUnit adjustBlockChildForPagination(LayoutUnit logicalTopAfterClear, La
youtUnit estimateWithoutPagination, LayoutBox& child, bool atBeforeSideOfBlock); |
| 481 // Computes a deltaOffset value that put a line at the top of the next page
if it doesn't fit on the current page. | 481 // Computes a deltaOffset value that put a line at the top of the next page
if it doesn't fit on the current page. |
| 482 void adjustLinePositionForPagination(RootInlineBox&, LayoutUnit& deltaOffset
, LayoutFlowThread*); | 482 void adjustLinePositionForPagination(RootInlineBox&, LayoutUnit& deltaOffset
, LayoutFlowThread*); |
| 483 // If the child is unsplittable and can't fit on the current page, return th
e top of the next page/column. | 483 // If the child is unsplittable and can't fit on the current page, return th
e top of the next page/column. |
| 484 LayoutUnit adjustForUnsplittableChild(RenderBox&, LayoutUnit logicalOffset,
bool includeMargins = false); | 484 LayoutUnit adjustForUnsplittableChild(LayoutBox&, LayoutUnit logicalOffset,
bool includeMargins = false); |
| 485 | 485 |
| 486 // Used to store state between styleWillChange and styleDidChange | 486 // Used to store state between styleWillChange and styleDidChange |
| 487 static bool s_canPropagateFloatIntoSibling; | 487 static bool s_canPropagateFloatIntoSibling; |
| 488 | 488 |
| 489 RenderBlockFlowRareData& ensureRareData(); | 489 RenderBlockFlowRareData& ensureRareData(); |
| 490 | 490 |
| 491 LayoutUnit m_paintInvalidationLogicalTop; | 491 LayoutUnit m_paintInvalidationLogicalTop; |
| 492 LayoutUnit m_paintInvalidationLogicalBottom; | 492 LayoutUnit m_paintInvalidationLogicalBottom; |
| 493 | 493 |
| 494 virtual bool isSelfCollapsingBlock() const override; | 494 virtual bool isSelfCollapsingBlock() const override; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 537 |
| 538 // END METHODS DEFINED IN RenderBlockLineLayout | 538 // END METHODS DEFINED IN RenderBlockLineLayout |
| 539 | 539 |
| 540 }; | 540 }; |
| 541 | 541 |
| 542 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); | 542 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(RenderBlockFlow, isRenderBlockFlow()); |
| 543 | 543 |
| 544 } // namespace blink | 544 } // namespace blink |
| 545 | 545 |
| 546 #endif // RenderBlockFlow_h | 546 #endif // RenderBlockFlow_h |
| OLD | NEW |