| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 return; | 301 return; |
| 302 | 302 |
| 303 SubtreeLayoutScope layoutScope(*this); | 303 SubtreeLayoutScope layoutScope(*this); |
| 304 | 304 |
| 305 // Multiple passes might be required for column and pagination based layout | 305 // Multiple passes might be required for column and pagination based layout |
| 306 // In the case of the old column code the number of passes will only be two | 306 // In the case of the old column code the number of passes will only be two |
| 307 // however, in the newer column code the number of passes could equal the | 307 // however, in the newer column code the number of passes could equal the |
| 308 // number of columns. | 308 // number of columns. |
| 309 bool done = false; | 309 bool done = false; |
| 310 LayoutUnit pageLogicalHeight = 0; | 310 LayoutUnit pageLogicalHeight = 0; |
| 311 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); | 311 LayoutRepainter repainter(*this, checkForPaintInvalidationDuringLayout()); |
| 312 while (!done) | 312 while (!done) |
| 313 done = layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope)
; | 313 done = layoutBlockFlow(relayoutChildren, pageLogicalHeight, layoutScope)
; |
| 314 | 314 |
| 315 fitBorderToLinesIfNeeded(); | 315 fitBorderToLinesIfNeeded(); |
| 316 | 316 |
| 317 RenderView* renderView = view(); | 317 RenderView* renderView = view(); |
| 318 if (renderView->layoutState()->pageLogicalHeight()) | 318 if (renderView->layoutState()->pageLogicalHeight()) |
| 319 setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(*this,
logicalTop())); | 319 setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(*this,
logicalTop())); |
| 320 | 320 |
| 321 updateLayerTransform(); | 321 updateLayerTransform(); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 | 625 |
| 626 if (childOffset.width() || childOffset.height()) { | 626 if (childOffset.width() || childOffset.height()) { |
| 627 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 627 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| 628 view()->addLayoutDelta(childOffset); | 628 view()->addLayoutDelta(childOffset); |
| 629 | 629 |
| 630 // If the child moved, we have to repaint it as well as any floating/pos
itioned | 630 // If the child moved, we have to repaint it as well as any floating/pos
itioned |
| 631 // descendants. An exception is if we need a layout. In this case, we kn
ow we're going to | 631 // descendants. An exception is if we need a layout. In this case, we kn
ow we're going to |
| 632 // repaint ourselves (and the child) anyway. | 632 // repaint ourselves (and the child) anyway. |
| 633 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && childHadLayou
t && !selfNeedsLayout()) | 633 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && childHadLayou
t && !selfNeedsLayout()) |
| 634 child->repaintOverhangingFloats(true); | 634 child->repaintOverhangingFloats(true); |
| 635 else if (childHadLayout && !selfNeedsLayout() && child->checkForRepaintD
uringLayout()) | 635 else if (childHadLayout && !selfNeedsLayout() && child->checkForPaintInv
alidationDuringLayout()) |
| 636 child->repaintDuringLayoutIfMoved(oldRect); | 636 child->repaintDuringLayoutIfMoved(oldRect); |
| 637 } | 637 } |
| 638 | 638 |
| 639 if (!childHadLayout && child->checkForRepaint()) { | 639 if (!childHadLayout && child->checkForPaintInvalidation()) { |
| 640 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 640 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
| 641 child->paintInvalidationForWholeRenderer(); | 641 child->paintInvalidationForWholeRenderer(); |
| 642 child->repaintOverhangingFloats(true); | 642 child->repaintOverhangingFloats(true); |
| 643 } | 643 } |
| 644 | 644 |
| 645 if (paginated) { | 645 if (paginated) { |
| 646 // Check for an after page/column break. | 646 // Check for an after page/column break. |
| 647 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf
o); | 647 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf
o); |
| 648 if (newHeight != height()) | 648 if (newHeight != height()) |
| 649 setLogicalHeight(newHeight); | 649 setLogicalHeight(newHeight); |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 setLogicalHeight(logicalTop); | 1174 setLogicalHeight(logicalTop); |
| 1175 if (!previousBlockFlow->avoidsFloats() && (previousBlockFlow->logicalTop
() + previousBlockFlow->lowestFloatLogicalBottom()) > logicalTop) | 1175 if (!previousBlockFlow->avoidsFloats() && (previousBlockFlow->logicalTop
() + previousBlockFlow->lowestFloatLogicalBottom()) > logicalTop) |
| 1176 addOverhangingFloats(previousBlockFlow, false); | 1176 addOverhangingFloats(previousBlockFlow, false); |
| 1177 setLogicalHeight(oldLogicalHeight); | 1177 setLogicalHeight(oldLogicalHeight); |
| 1178 | 1178 |
| 1179 // If |child|'s previous sibling is a self-collapsing block that cleared
a float and margin collapsing resulted in |child| moving up | 1179 // If |child|'s previous sibling is a self-collapsing block that cleared
a float and margin collapsing resulted in |child| moving up |
| 1180 // into the margin area of the self-collapsing block then the float it c
lears is now intruding into |child|. Layout again so that we can look for | 1180 // into the margin area of the self-collapsing block then the float it c
lears is now intruding into |child|. Layout again so that we can look for |
| 1181 // floats in the parent that overhang |child|'s new logical top. | 1181 // floats in the parent that overhang |child|'s new logical top. |
| 1182 bool logicalTopIntrudesIntoFloat = clearanceForSelfCollapsingBlock > 0 &
& logicalTop < beforeCollapseLogicalTop; | 1182 bool logicalTopIntrudesIntoFloat = clearanceForSelfCollapsingBlock > 0 &
& logicalTop < beforeCollapseLogicalTop; |
| 1183 if (logicalTopIntrudesIntoFloat && containsFloats() && !child->avoidsFlo
ats() && lowestFloatLogicalBottom() > logicalTop) | 1183 if (logicalTopIntrudesIntoFloat && containsFloats() && !child->avoidsFlo
ats() && lowestFloatLogicalBottom() > logicalTop) |
| 1184 child->setNeedsLayoutAndFullRepaint(); | 1184 child->setNeedsLayoutAndFullPaintInvalidation(); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 return logicalTop; | 1187 return logicalTop; |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 void RenderBlockFlow::adjustPositionedBlock(RenderBox* child, const MarginInfo&
marginInfo) | 1190 void RenderBlockFlow::adjustPositionedBlock(RenderBox* child, const MarginInfo&
marginInfo) |
| 1191 { | 1191 { |
| 1192 bool isHorizontal = isHorizontalWritingMode(); | 1192 bool isHorizontal = isHorizontalWritingMode(); |
| 1193 bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(isHoriz
ontal); | 1193 bool hasStaticBlockPosition = child->style()->hasStaticBlockPosition(isHoriz
ontal); |
| 1194 | 1194 |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2382 | 2382 |
| 2383 setLogicalHeightForFloat(floatingObject, logicalHeightForChild(childBox)
+ marginBeforeForChild(childBox) + marginAfterForChild(childBox)); | 2383 setLogicalHeightForFloat(floatingObject, logicalHeightForChild(childBox)
+ marginBeforeForChild(childBox) + marginAfterForChild(childBox)); |
| 2384 | 2384 |
| 2385 m_floatingObjects->addPlacedObject(floatingObject); | 2385 m_floatingObjects->addPlacedObject(floatingObject); |
| 2386 | 2386 |
| 2387 if (ShapeOutsideInfo* shapeOutside = childBox->shapeOutsideInfo()) | 2387 if (ShapeOutsideInfo* shapeOutside = childBox->shapeOutsideInfo()) |
| 2388 shapeOutside->setReferenceBoxLogicalSize(logicalSizeForChild(childBo
x)); | 2388 shapeOutside->setReferenceBoxLogicalSize(logicalSizeForChild(childBo
x)); |
| 2389 | 2389 |
| 2390 // If the child moved, we have to repaint it. | 2390 // If the child moved, we have to repaint it. |
| 2391 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() | 2391 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() |
| 2392 && childBox->checkForRepaintDuringLayout()) | 2392 && childBox->checkForPaintInvalidationDuringLayout()) |
| 2393 childBox->repaintDuringLayoutIfMoved(oldRect); | 2393 childBox->repaintDuringLayoutIfMoved(oldRect); |
| 2394 } | 2394 } |
| 2395 return true; | 2395 return true; |
| 2396 } | 2396 } |
| 2397 | 2397 |
| 2398 bool RenderBlockFlow::hasOverhangingFloat(RenderBox* renderer) | 2398 bool RenderBlockFlow::hasOverhangingFloat(RenderBox* renderer) |
| 2399 { | 2399 { |
| 2400 if (!m_floatingObjects || hasColumns() || !parent()) | 2400 if (!m_floatingObjects || hasColumns() || !parent()) |
| 2401 return false; | 2401 return false; |
| 2402 | 2402 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2803 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2803 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
| 2804 { | 2804 { |
| 2805 if (m_rareData) | 2805 if (m_rareData) |
| 2806 return *m_rareData; | 2806 return *m_rareData; |
| 2807 | 2807 |
| 2808 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2808 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
| 2809 return *m_rareData; | 2809 return *m_rareData; |
| 2810 } | 2810 } |
| 2811 | 2811 |
| 2812 } // namespace WebCore | 2812 } // namespace WebCore |
| OLD | NEW |