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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 LayoutUnit positiveMargin() const { return m_positiveMargin; } | 138 LayoutUnit positiveMargin() const { return m_positiveMargin; } |
139 LayoutUnit negativeMargin() const { return m_negativeMargin; } | 139 LayoutUnit negativeMargin() const { return m_negativeMargin; } |
140 bool discardMargin() const { return m_discardMargin; } | 140 bool discardMargin() const { return m_discardMargin; } |
141 LayoutUnit margin() const { return m_positiveMargin - m_negativeMargin; } | 141 LayoutUnit margin() const { return m_positiveMargin - m_negativeMargin; } |
142 }; | 142 }; |
143 static bool inNormalFlow(RenderBox* child) | 143 static bool inNormalFlow(RenderBox* child) |
144 { | 144 { |
145 RenderBlock* curr = child->containingBlock(); | 145 RenderBlock* curr = child->containingBlock(); |
146 RenderView* renderView = child->view(); | 146 RenderView* renderView = child->view(); |
147 while (curr && curr != renderView) { | 147 while (curr && curr != renderView) { |
148 if (curr->hasColumns() || curr->isRenderFlowThread()) | 148 if (curr->isRenderFlowThread()) |
149 return true; | 149 return true; |
150 if (curr->isFloatingOrOutOfFlowPositioned()) | 150 if (curr->isFloatingOrOutOfFlowPositioned()) |
151 return false; | 151 return false; |
152 curr = curr->containingBlock(); | 152 curr = curr->containingBlock(); |
153 } | 153 } |
154 return true; | 154 return true; |
155 } | 155 } |
156 | 156 |
157 RenderBlockFlow::RenderBlockFlow(ContainerNode* node) | 157 RenderBlockFlow::RenderBlockFlow(ContainerNode* node) |
158 : RenderBlock(node) | 158 : RenderBlock(node) |
(...skipping 21 matching lines...) Expand all Loading... |
180 { | 180 { |
181 if (lineGridBox()) | 181 if (lineGridBox()) |
182 lineGridBox()->destroy(); | 182 lineGridBox()->destroy(); |
183 | 183 |
184 if (renderNamedFlowFragment()) | 184 if (renderNamedFlowFragment()) |
185 setRenderNamedFlowFragment(0); | 185 setRenderNamedFlowFragment(0); |
186 | 186 |
187 RenderBlock::willBeDestroyed(); | 187 RenderBlock::willBeDestroyed(); |
188 } | 188 } |
189 | 189 |
190 bool RenderBlockFlow::relayoutForPagination(bool hasSpecifiedPageLogicalHeight,
LayoutUnit pageLogicalHeight, LayoutStateMaintainer& statePusher) | |
191 { | |
192 if (!hasColumns()) | |
193 return false; | |
194 | |
195 OwnPtr<RenderOverflow> savedOverflow = m_overflow.release(); | |
196 if (childrenInline()) | |
197 addOverflowFromInlineChildren(); | |
198 else | |
199 addOverflowFromBlockChildren(); | |
200 LayoutUnit layoutOverflowLogicalBottom = (isHorizontalWritingMode() ? layout
OverflowRect().maxY() : layoutOverflowRect().maxX()) - borderBefore() - paddingB
efore(); | |
201 | |
202 // FIXME: We don't balance properly at all in the presence of forced page br
eaks. We need to understand what | |
203 // the distance between forced page breaks is so that we can avoid making th
e minimum column height too tall. | |
204 ColumnInfo* colInfo = columnInfo(); | |
205 if (!hasSpecifiedPageLogicalHeight) { | |
206 LayoutUnit columnHeight = pageLogicalHeight; | |
207 int minColumnCount = colInfo->forcedBreaks() + 1; | |
208 int desiredColumnCount = colInfo->desiredColumnCount(); | |
209 if (minColumnCount >= desiredColumnCount) { | |
210 // The forced page breaks are in control of the balancing. Just set
the column height to the | |
211 // maximum page break distance. | |
212 if (!pageLogicalHeight) { | |
213 LayoutUnit distanceBetweenBreaks = max<LayoutUnit>(colInfo->maxi
mumDistanceBetweenForcedBreaks(), | |
214 view()->layoutState()->pageLogicalOffset(this, borderBefore(
) + paddingBefore() + layoutOverflowLogicalBottom) - colInfo->forcedBreakOffset(
)); | |
215 columnHeight = max(colInfo->minimumColumnHeight(), distanceBetwe
enBreaks); | |
216 } | |
217 } else if (layoutOverflowLogicalBottom > boundedMultiply(pageLogicalHeig
ht, desiredColumnCount)) { | |
218 // Now that we know the intrinsic height of the columns, we have to
rebalance them. | |
219 columnHeight = max<LayoutUnit>(colInfo->minimumColumnHeight(), ceilf
((float)layoutOverflowLogicalBottom / desiredColumnCount)); | |
220 } | |
221 | |
222 if (columnHeight && columnHeight != pageLogicalHeight) { | |
223 statePusher.pop(); | |
224 setEverHadLayout(true); | |
225 layoutBlockFlow(false, columnHeight); | |
226 return true; | |
227 } | |
228 } | |
229 | |
230 if (pageLogicalHeight) | |
231 colInfo->setColumnCountAndHeight(ceilf((float)layoutOverflowLogicalBotto
m / pageLogicalHeight), pageLogicalHeight); | |
232 | |
233 if (columnCount(colInfo)) { | |
234 setLogicalHeight(borderBefore() + paddingBefore() + colInfo->columnHeigh
t() + borderAfter() + paddingAfter() + scrollbarLogicalHeight()); | |
235 m_overflow.clear(); | |
236 } else { | |
237 m_overflow = savedOverflow.release(); | |
238 } | |
239 | |
240 return false; | |
241 } | |
242 | |
243 bool RenderBlockFlow::isSelfCollapsingBlock() const | 190 bool RenderBlockFlow::isSelfCollapsingBlock() const |
244 { | 191 { |
245 m_hasOnlySelfCollapsingChildren = RenderBlock::isSelfCollapsingBlock(); | 192 m_hasOnlySelfCollapsingChildren = RenderBlock::isSelfCollapsingBlock(); |
246 return m_hasOnlySelfCollapsingChildren; | 193 return m_hasOnlySelfCollapsingChildren; |
247 } | 194 } |
248 | 195 |
249 void RenderBlockFlow::layoutBlock(bool relayoutChildren) | 196 void RenderBlockFlow::layoutBlock(bool relayoutChildren) |
250 { | 197 { |
251 layoutBlockFlow(relayoutChildren); | 198 layoutBlockFlow(relayoutChildren); |
252 } | 199 } |
253 | 200 |
254 inline void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit p
ageLogicalHeight) | 201 inline void RenderBlockFlow::layoutBlockFlow(bool relayoutChildren) |
255 { | 202 { |
256 ASSERT(needsLayout()); | 203 ASSERT(needsLayout()); |
257 ASSERT(isInlineBlockOrInlineTable() || !isInline()); | 204 ASSERT(isInlineBlockOrInlineTable() || !isInline()); |
258 | 205 |
259 // If we are self-collapsing with self-collapsing descendants this will get
set to save us burrowing through our | 206 // If we are self-collapsing with self-collapsing descendants this will get
set to save us burrowing through our |
260 // descendants every time in |isSelfCollapsingBlock|. We reset it here so th
at |isSelfCollapsingBlock| attempts to burrow | 207 // descendants every time in |isSelfCollapsingBlock|. We reset it here so th
at |isSelfCollapsingBlock| attempts to burrow |
261 // at least once and so that it always gives a reliable result reflecting th
e latest layout. | 208 // at least once and so that it always gives a reliable result reflecting th
e latest layout. |
262 m_hasOnlySelfCollapsingChildren = false; | 209 m_hasOnlySelfCollapsingChildren = false; |
263 | 210 |
264 if (!relayoutChildren && simplifiedLayout()) | 211 if (!relayoutChildren && simplifiedLayout()) |
265 return; | 212 return; |
266 | 213 |
267 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); | 214 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); |
268 | 215 |
269 if (updateLogicalWidthAndColumnWidth()) | 216 if (updateLogicalWidthAndColumnWidth()) |
270 relayoutChildren = true; | 217 relayoutChildren = true; |
271 | 218 |
272 rebuildFloatsFromIntruding(); | 219 rebuildFloatsFromIntruding(); |
273 | 220 |
| 221 LayoutUnit pageLogicalHeight; |
274 bool pageLogicalHeightChanged = false; | 222 bool pageLogicalHeightChanged = false; |
275 bool hasSpecifiedPageLogicalHeight = false; | 223 bool hasSpecifiedPageLogicalHeight = false; |
276 checkForPaginationLogicalHeightChange(pageLogicalHeight, pageLogicalHeightCh
anged, hasSpecifiedPageLogicalHeight); | 224 checkForPaginationLogicalHeightChange(pageLogicalHeight, pageLogicalHeightCh
anged, hasSpecifiedPageLogicalHeight); |
277 | 225 |
278 RenderView* renderView = view(); | 226 RenderView* renderView = view(); |
279 LayoutStateMaintainer statePusher(renderView, this, locationOffset(), hasCol
umns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMo
de(), pageLogicalHeight, pageLogicalHeightChanged, columnInfo()); | 227 LayoutStateMaintainer statePusher(renderView, this, locationOffset(), hasTra
nsform() || hasReflection() || style()->isFlippedBlocksWritingMode(), pageLogica
lHeight, pageLogicalHeightChanged); |
280 | 228 |
281 // Regions changing widths can force us to relayout our children. | 229 // Regions changing widths can force us to relayout our children. |
282 RenderFlowThread* flowThread = flowThreadContainingBlock(); | 230 RenderFlowThread* flowThread = flowThreadContainingBlock(); |
283 if (logicalWidthChangedInRegions(flowThread)) | 231 if (logicalWidthChangedInRegions(flowThread)) |
284 relayoutChildren = true; | 232 relayoutChildren = true; |
285 if (updateRegionsAndShapesLogicalSize(flowThread)) | 233 if (updateRegionsAndShapesLogicalSize(flowThread)) |
286 relayoutChildren = true; | 234 relayoutChildren = true; |
287 if (!relayoutChildren && isRenderNamedFlowFragmentContainer()) | 235 if (!relayoutChildren && isRenderNamedFlowFragmentContainer()) |
288 relayoutChildren = true; | 236 relayoutChildren = true; |
289 | 237 |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) | 1471 if (child->isHorizontalWritingMode() == isHorizontalWritingMode()) |
1524 return childStyle->marginBeforeCollapse() == MSEPARATE; | 1472 return childStyle->marginBeforeCollapse() == MSEPARATE; |
1525 | 1473 |
1526 // FIXME: See |mustDiscardMarginBeforeForChild| above. | 1474 // FIXME: See |mustDiscardMarginBeforeForChild| above. |
1527 return false; | 1475 return false; |
1528 } | 1476 } |
1529 | 1477 |
1530 LayoutUnit RenderBlockFlow::applyBeforeBreak(RenderBox* child, LayoutUnit logica
lOffset) | 1478 LayoutUnit RenderBlockFlow::applyBeforeBreak(RenderBox* child, LayoutUnit logica
lOffset) |
1531 { | 1479 { |
1532 // FIXME: Add page break checking here when we support printing. | 1480 // FIXME: Add page break checking here when we support printing. |
1533 bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns(); | 1481 bool checkPageBreaks = view()->layoutState()->m_pageLogicalHeight; // FIXME:
Once columns can print we have to check this. |
1534 bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageLo
gicalHeight; // FIXME: Once columns can print we have to check this. | |
1535 RenderFlowThread* flowThread = flowThreadContainingBlock(); | 1482 RenderFlowThread* flowThread = flowThreadContainingBlock(); |
1536 bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread()
; | 1483 bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread()
; |
1537 bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBe
fore() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakBefore() ==
PBALWAYS) | 1484 bool checkBeforeAlways = (checkPageBreaks && child->style()->pageBreakBefore
() == PBALWAYS) |
1538 || (checkRegionBreaks && child->style()->regionBreakBefore() == PBALWAYS
); | 1485 || (checkRegionBreaks && child->style()->regionBreakBefore() == PBALWAYS
); |
1539 if (checkBeforeAlways && inNormalFlow(child) && hasNextPage(logicalOffset, I
ncludePageBoundary)) { | 1486 if (checkBeforeAlways && inNormalFlow(child) && hasNextPage(logicalOffset, I
ncludePageBoundary)) { |
1540 if (checkColumnBreaks) | |
1541 view()->layoutState()->addForcedColumnBreak(child, logicalOffset); | |
1542 if (checkRegionBreaks) { | 1487 if (checkRegionBreaks) { |
1543 LayoutUnit offsetBreakAdjustment = 0; | 1488 LayoutUnit offsetBreakAdjustment = 0; |
1544 if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirstPage
() + logicalOffset, child, true, &offsetBreakAdjustment)) | 1489 if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirstPage
() + logicalOffset, child, true, &offsetBreakAdjustment)) |
1545 return logicalOffset + offsetBreakAdjustment; | 1490 return logicalOffset + offsetBreakAdjustment; |
1546 } | 1491 } |
1547 return nextPageLogicalTop(logicalOffset, IncludePageBoundary); | 1492 return nextPageLogicalTop(logicalOffset, IncludePageBoundary); |
1548 } | 1493 } |
1549 return logicalOffset; | 1494 return logicalOffset; |
1550 } | 1495 } |
1551 | 1496 |
1552 LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox* child, LayoutUnit logical
Offset, MarginInfo& marginInfo) | 1497 LayoutUnit RenderBlockFlow::applyAfterBreak(RenderBox* child, LayoutUnit logical
Offset, MarginInfo& marginInfo) |
1553 { | 1498 { |
1554 // FIXME: Add page break checking here when we support printing. | 1499 // FIXME: Add page break checking here when we support printing. |
1555 bool checkColumnBreaks = view()->layoutState()->isPaginatingColumns(); | 1500 bool checkPageBreaks = view()->layoutState()->m_pageLogicalHeight; // FIXME:
Once columns can print we have to check this. |
1556 bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->m_pageLo
gicalHeight; // FIXME: Once columns can print we have to check this. | |
1557 RenderFlowThread* flowThread = flowThreadContainingBlock(); | 1501 RenderFlowThread* flowThread = flowThreadContainingBlock(); |
1558 bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread()
; | 1502 bool checkRegionBreaks = flowThread && flowThread->isRenderNamedFlowThread()
; |
1559 bool checkAfterAlways = (checkColumnBreaks && child->style()->columnBreakAft
er() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakAfter() == PBA
LWAYS) | 1503 bool checkAfterAlways = (checkPageBreaks && child->style()->pageBreakAfter()
== PBALWAYS) |
1560 || (checkRegionBreaks && child->style()->regionBreakAfter() == PBALWAYS)
; | 1504 || (checkRegionBreaks && child->style()->regionBreakAfter() == PBALWAYS)
; |
1561 if (checkAfterAlways && inNormalFlow(child) && hasNextPage(logicalOffset, In
cludePageBoundary)) { | 1505 if (checkAfterAlways && inNormalFlow(child) && hasNextPage(logicalOffset, In
cludePageBoundary)) { |
1562 LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? Lay
outUnit() : marginInfo.margin(); | 1506 LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? Lay
outUnit() : marginInfo.margin(); |
1563 | 1507 |
1564 // So our margin doesn't participate in the next collapsing steps. | 1508 // So our margin doesn't participate in the next collapsing steps. |
1565 marginInfo.clearMargin(); | 1509 marginInfo.clearMargin(); |
1566 | 1510 |
1567 if (checkColumnBreaks) | |
1568 view()->layoutState()->addForcedColumnBreak(child, logicalOffset); | |
1569 if (checkRegionBreaks) { | 1511 if (checkRegionBreaks) { |
1570 LayoutUnit offsetBreakAdjustment = 0; | 1512 LayoutUnit offsetBreakAdjustment = 0; |
1571 if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirstPage
() + logicalOffset + marginOffset, child, false, &offsetBreakAdjustment)) | 1513 if (flowThread->addForcedRegionBreak(offsetFromLogicalTopOfFirstPage
() + logicalOffset + marginOffset, child, false, &offsetBreakAdjustment)) |
1572 return logicalOffset + marginOffset + offsetBreakAdjustment; | 1514 return logicalOffset + marginOffset + offsetBreakAdjustment; |
1573 } | 1515 } |
1574 return nextPageLogicalTop(logicalOffset, IncludePageBoundary); | 1516 return nextPageLogicalTop(logicalOffset, IncludePageBoundary); |
1575 } | 1517 } |
1576 return logicalOffset; | 1518 return logicalOffset; |
1577 } | 1519 } |
1578 | 1520 |
1579 void RenderBlockFlow::addOverflowFromFloats() | 1521 void RenderBlockFlow::addOverflowFromFloats() |
1580 { | 1522 { |
1581 if (!m_floatingObjects) | 1523 if (!m_floatingObjects) |
1582 return; | 1524 return; |
1583 | 1525 |
1584 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 1526 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
1585 FloatingObjectSetIterator end = floatingObjectSet.end(); | 1527 FloatingObjectSetIterator end = floatingObjectSet.end(); |
1586 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { | 1528 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++
it) { |
1587 FloatingObject* floatingObject = *it; | 1529 FloatingObject* floatingObject = *it; |
1588 if (floatingObject->isDescendant()) | 1530 if (floatingObject->isDescendant()) |
1589 addOverflowFromChild(floatingObject->renderer(), IntSize(xPositionFo
rFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floating
Object))); | 1531 addOverflowFromChild(floatingObject->renderer(), IntSize(xPositionFo
rFloatIncludingMargin(floatingObject), yPositionForFloatIncludingMargin(floating
Object))); |
1590 } | 1532 } |
1591 } | 1533 } |
1592 | 1534 |
1593 void RenderBlockFlow::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomp
uteFloats) | 1535 void RenderBlockFlow::computeOverflow(LayoutUnit oldClientAfterEdge, bool recomp
uteFloats) |
1594 { | 1536 { |
1595 RenderBlock::computeOverflow(oldClientAfterEdge, recomputeFloats); | 1537 RenderBlock::computeOverflow(oldClientAfterEdge, recomputeFloats); |
1596 if (!hasColumns() && (recomputeFloats || isRoot() || expandsToEncloseOverhan
gingFloats() || hasSelfPaintingLayer())) | 1538 if (recomputeFloats || isRoot() || expandsToEncloseOverhangingFloats() || ha
sSelfPaintingLayer()) |
1597 addOverflowFromFloats(); | 1539 addOverflowFromFloats(); |
1598 } | 1540 } |
1599 | 1541 |
1600 RootInlineBox* RenderBlockFlow::createAndAppendRootInlineBox() | 1542 RootInlineBox* RenderBlockFlow::createAndAppendRootInlineBox() |
1601 { | 1543 { |
1602 RootInlineBox* rootBox = createRootInlineBox(); | 1544 RootInlineBox* rootBox = createRootInlineBox(); |
1603 m_lineBoxes.appendLineBox(rootBox); | 1545 m_lineBoxes.appendLineBox(rootBox); |
1604 | 1546 |
1605 if (UNLIKELY(AXObjectCache::accessibilityEnabled()) && m_lineBoxes.firstLine
Box() == rootBox) { | 1547 if (UNLIKELY(AXObjectCache::accessibilityEnabled()) && m_lineBoxes.firstLine
Box() == rootBox) { |
1606 if (AXObjectCache* cache = document().existingAXObjectCache()) | 1548 if (AXObjectCache* cache = document().existingAXObjectCache()) |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 repaintLogicalLeft = min(repaintLogicalLeft, logicalLeftLayoutOverflow()
); | 1842 repaintLogicalLeft = min(repaintLogicalLeft, logicalLeftLayoutOverflow()
); |
1901 repaintLogicalRight = max(repaintLogicalRight, logicalRightLayoutOverflo
w()); | 1843 repaintLogicalRight = max(repaintLogicalRight, logicalRightLayoutOverflo
w()); |
1902 } | 1844 } |
1903 | 1845 |
1904 LayoutRect repaintRect; | 1846 LayoutRect repaintRect; |
1905 if (isHorizontalWritingMode()) | 1847 if (isHorizontalWritingMode()) |
1906 repaintRect = LayoutRect(repaintLogicalLeft, m_repaintLogicalTop, repain
tLogicalRight - repaintLogicalLeft, m_repaintLogicalBottom - m_repaintLogicalTop
); | 1848 repaintRect = LayoutRect(repaintLogicalLeft, m_repaintLogicalTop, repain
tLogicalRight - repaintLogicalLeft, m_repaintLogicalBottom - m_repaintLogicalTop
); |
1907 else | 1849 else |
1908 repaintRect = LayoutRect(m_repaintLogicalTop, repaintLogicalLeft, m_repa
intLogicalBottom - m_repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft
); | 1850 repaintRect = LayoutRect(m_repaintLogicalTop, repaintLogicalLeft, m_repa
intLogicalBottom - m_repaintLogicalTop, repaintLogicalRight - repaintLogicalLeft
); |
1909 | 1851 |
1910 // The repaint rect may be split across columns, in which case adjustRectFor
Columns() will return the union. | |
1911 adjustRectForColumns(repaintRect); | |
1912 | |
1913 repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline)); | 1852 repaintRect.inflate(maximalOutlineSize(PaintPhaseOutline)); |
1914 | 1853 |
1915 if (hasOverflowClip()) { | 1854 if (hasOverflowClip()) { |
1916 // Adjust repaint rect for scroll offset | 1855 // Adjust repaint rect for scroll offset |
1917 repaintRect.move(-scrolledContentOffset()); | 1856 repaintRect.move(-scrolledContentOffset()); |
1918 | 1857 |
1919 // Don't allow this rect to spill out of our overflow box. | 1858 // Don't allow this rect to spill out of our overflow box. |
1920 repaintRect.intersect(LayoutRect(LayoutPoint(), size())); | 1859 repaintRect.intersect(LayoutRect(LayoutPoint(), size())); |
1921 } | 1860 } |
1922 | 1861 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2390 // If the child moved, we have to repaint it. | 2329 // If the child moved, we have to repaint it. |
2391 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() | 2330 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled() |
2392 && childBox->checkForRepaintDuringLayout()) | 2331 && childBox->checkForRepaintDuringLayout()) |
2393 childBox->repaintDuringLayoutIfMoved(oldRect); | 2332 childBox->repaintDuringLayoutIfMoved(oldRect); |
2394 } | 2333 } |
2395 return true; | 2334 return true; |
2396 } | 2335 } |
2397 | 2336 |
2398 bool RenderBlockFlow::hasOverhangingFloat(RenderBox* renderer) | 2337 bool RenderBlockFlow::hasOverhangingFloat(RenderBox* renderer) |
2399 { | 2338 { |
2400 if (!m_floatingObjects || hasColumns() || !parent()) | 2339 if (!m_floatingObjects || !parent()) |
2401 return false; | 2340 return false; |
2402 | 2341 |
2403 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); | 2342 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); |
2404 FloatingObjectSetIterator it = floatingObjectSet.find<FloatingObjectHashTran
slator>(renderer); | 2343 FloatingObjectSetIterator it = floatingObjectSet.find<FloatingObjectHashTran
slator>(renderer); |
2405 if (it == floatingObjectSet.end()) | 2344 if (it == floatingObjectSet.end()) |
2406 return false; | 2345 return false; |
2407 | 2346 |
2408 return logicalBottomForFloat(*it) > logicalHeight(); | 2347 return logicalBottomForFloat(*it) > logicalHeight(); |
2409 } | 2348 } |
2410 | 2349 |
(...skipping 28 matching lines...) Expand all Loading... |
2439 | 2378 |
2440 m_floatingObjects->add(floatingObject->copyToNewContainer(offset
)); | 2379 m_floatingObjects->add(floatingObject->copyToNewContainer(offset
)); |
2441 } | 2380 } |
2442 } | 2381 } |
2443 } | 2382 } |
2444 } | 2383 } |
2445 | 2384 |
2446 LayoutUnit RenderBlockFlow::addOverhangingFloats(RenderBlockFlow* child, bool ma
keChildPaintOtherFloats) | 2385 LayoutUnit RenderBlockFlow::addOverhangingFloats(RenderBlockFlow* child, bool ma
keChildPaintOtherFloats) |
2447 { | 2386 { |
2448 // Prevent floats from being added to the canvas by the root element, e.g.,
<html>. | 2387 // Prevent floats from being added to the canvas by the root element, e.g.,
<html>. |
2449 if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot()
|| child->hasColumns() || child->isWritingModeRoot()) | 2388 if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot()
|| child->isWritingModeRoot()) |
2450 return 0; | 2389 return 0; |
2451 | 2390 |
2452 LayoutUnit childLogicalTop = child->logicalTop(); | 2391 LayoutUnit childLogicalTop = child->logicalTop(); |
2453 LayoutUnit childLogicalLeft = child->logicalLeft(); | 2392 LayoutUnit childLogicalLeft = child->logicalLeft(); |
2454 LayoutUnit lowestFloatLogicalBottom = 0; | 2393 LayoutUnit lowestFloatLogicalBottom = 0; |
2455 | 2394 |
2456 // Floats that will remain the child's responsibility to paint should factor
into its | 2395 // Floats that will remain the child's responsibility to paint should factor
into its |
2457 // overflow. | 2396 // overflow. |
2458 FloatingObjectSetIterator childEnd = child->m_floatingObjects->set().end(); | 2397 FloatingObjectSetIterator childEnd = child->m_floatingObjects->set().end(); |
2459 for (FloatingObjectSetIterator childIt = child->m_floatingObjects->set().beg
in(); childIt != childEnd; ++childIt) { | 2398 for (FloatingObjectSetIterator childIt = child->m_floatingObjects->set().beg
in(); childIt != childEnd; ++childIt) { |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2825 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() | 2764 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() |
2826 { | 2765 { |
2827 if (m_rareData) | 2766 if (m_rareData) |
2828 return *m_rareData; | 2767 return *m_rareData; |
2829 | 2768 |
2830 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); | 2769 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); |
2831 return *m_rareData; | 2770 return *m_rareData; |
2832 } | 2771 } |
2833 | 2772 |
2834 } // namespace WebCore | 2773 } // namespace WebCore |
OLD | NEW |