| 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, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 StackStats::LayoutCheckPoint layoutCheckPoint; | 1400 StackStats::LayoutCheckPoint layoutCheckPoint; |
| 1401 OverflowEventDispatcher dispatcher(this); | 1401 OverflowEventDispatcher dispatcher(this); |
| 1402 | 1402 |
| 1403 // Update our first letter info now. | 1403 // Update our first letter info now. |
| 1404 updateFirstLetter(); | 1404 updateFirstLetter(); |
| 1405 | 1405 |
| 1406 // Table cells call layoutBlock directly, so don't add any logic here. Put
code into | 1406 // Table cells call layoutBlock directly, so don't add any logic here. Put
code into |
| 1407 // layoutBlock(). | 1407 // layoutBlock(). |
| 1408 layoutBlock(false); | 1408 layoutBlock(false); |
| 1409 | 1409 |
| 1410 if (document()->view()->canStopPartialLayout()) |
| 1411 return; |
| 1412 |
| 1410 // It's safe to check for control clip here, since controls can never be tab
le cells. | 1413 // It's safe to check for control clip here, since controls can never be tab
le cells. |
| 1411 // If we have a lightweight clip, there can never be any overflow from child
ren. | 1414 // If we have a lightweight clip, there can never be any overflow from child
ren. |
| 1412 if (hasControlClip() && m_overflow) | 1415 if (hasControlClip() && m_overflow) |
| 1413 clearLayoutOverflow(); | 1416 clearLayoutOverflow(); |
| 1414 | 1417 |
| 1415 invalidateBackgroundObscurationStatus(); | 1418 invalidateBackgroundObscurationStatus(); |
| 1416 } | 1419 } |
| 1417 | 1420 |
| 1418 void RenderBlock::updateShapeInsideInfoAfterStyleChange(const ShapeValue* shapeI
nside, const ShapeValue* oldShapeInside) | 1421 void RenderBlock::updateShapeInsideInfoAfterStyleChange(const ShapeValue* shapeI
nside, const ShapeValue* oldShapeInside) |
| 1419 { | 1422 { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 colInfo->setPaginationUnit(paginationUnit()); | 1533 colInfo->setPaginationUnit(paginationUnit()); |
| 1531 } else if (isRenderFlowThread()) { | 1534 } else if (isRenderFlowThread()) { |
| 1532 pageLogicalHeight = 1; // This is just a hack to always make sure we hav
e a page logical height. | 1535 pageLogicalHeight = 1; // This is just a hack to always make sure we hav
e a page logical height. |
| 1533 pageLogicalHeightChanged = toRenderFlowThread(this)->pageLogicalSizeChan
ged(); | 1536 pageLogicalHeightChanged = toRenderFlowThread(this)->pageLogicalSizeChan
ged(); |
| 1534 } | 1537 } |
| 1535 } | 1538 } |
| 1536 | 1539 |
| 1537 void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
t) | 1540 void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
t) |
| 1538 { | 1541 { |
| 1539 ASSERT(needsLayout()); | 1542 ASSERT(needsLayout()); |
| 1543 // if (document()->view()->canStopPartialLayout()) |
| 1544 // return; |
| 1540 | 1545 |
| 1541 if (isInline() && !isInlineBlockOrInlineTable()) // Inline <form>s inside va
rious table elements can | 1546 if (isInline() && !isInlineBlockOrInlineTable()) // Inline <form>s inside va
rious table elements can |
| 1542 return; // cause us to come in here
. Just bail. | 1547 return; // cause us to come in here
. Just bail. |
| 1543 | 1548 |
| 1544 if (!relayoutChildren && simplifiedLayout()) | 1549 if (!relayoutChildren && simplifiedLayout()) |
| 1545 return; | 1550 return; |
| 1546 | 1551 |
| 1547 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); | 1552 LayoutRepainter repainter(*this, checkForRepaintDuringLayout()); |
| 1548 | 1553 |
| 1549 if (updateLogicalWidthAndColumnWidth()) | 1554 if (updateLogicalWidthAndColumnWidth()) |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 LayoutUnit repaintLogicalTop = 0; | 1598 LayoutUnit repaintLogicalTop = 0; |
| 1594 LayoutUnit repaintLogicalBottom = 0; | 1599 LayoutUnit repaintLogicalBottom = 0; |
| 1595 LayoutUnit maxFloatLogicalBottom = 0; | 1600 LayoutUnit maxFloatLogicalBottom = 0; |
| 1596 if (!firstChild() && !isAnonymousBlock()) | 1601 if (!firstChild() && !isAnonymousBlock()) |
| 1597 setChildrenInline(true); | 1602 setChildrenInline(true); |
| 1598 if (childrenInline()) | 1603 if (childrenInline()) |
| 1599 layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogical
Bottom); | 1604 layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogical
Bottom); |
| 1600 else | 1605 else |
| 1601 layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom); | 1606 layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom); |
| 1602 | 1607 |
| 1608 // If layout was just for one of our children, stop early (before setting se
tNeedsLayout=false!) |
| 1609 if (document()->view()->canStopPartialLayout()) { |
| 1610 statePusher.pop(); |
| 1611 return; |
| 1612 } |
| 1613 |
| 1603 // Expand our intrinsic height to encompass floats. | 1614 // Expand our intrinsic height to encompass floats. |
| 1604 LayoutUnit toAdd = borderAfter() + paddingAfter() + scrollbarLogicalHeight()
; | 1615 LayoutUnit toAdd = borderAfter() + paddingAfter() + scrollbarLogicalHeight()
; |
| 1605 if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEnclo
seOverhangingFloats()) | 1616 if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEnclo
seOverhangingFloats()) |
| 1606 setLogicalHeight(lowestFloatLogicalBottom() + toAdd); | 1617 setLogicalHeight(lowestFloatLogicalBottom() + toAdd); |
| 1607 | 1618 |
| 1608 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight,
statePusher)) | 1619 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight,
statePusher)) |
| 1609 return; | 1620 return; |
| 1610 | 1621 |
| 1611 // Calculate our new height. | 1622 // Calculate our new height. |
| 1612 LayoutUnit oldHeight = logicalHeight(); | 1623 LayoutUnit oldHeight = logicalHeight(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1640 | 1651 |
| 1641 updateRegionsAndShapesAfterChildLayout(flowThread, heightChanged); | 1652 updateRegionsAndShapesAfterChildLayout(flowThread, heightChanged); |
| 1642 | 1653 |
| 1643 // Add overflow from children (unless we're multi-column, since in that case
all our child overflow is clipped anyway). | 1654 // Add overflow from children (unless we're multi-column, since in that case
all our child overflow is clipped anyway). |
| 1644 computeOverflow(oldClientAfterEdge); | 1655 computeOverflow(oldClientAfterEdge); |
| 1645 | 1656 |
| 1646 statePusher.pop(); | 1657 statePusher.pop(); |
| 1647 | 1658 |
| 1648 fitBorderToLinesIfNeeded(); | 1659 fitBorderToLinesIfNeeded(); |
| 1649 | 1660 |
| 1661 if (document()->view()->canStopPartialLayout()) |
| 1662 return; |
| 1663 |
| 1650 if (renderView->layoutState()->m_pageLogicalHeight) | 1664 if (renderView->layoutState()->m_pageLogicalHeight) |
| 1651 setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(this,
logicalTop())); | 1665 setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(this,
logicalTop())); |
| 1652 | 1666 |
| 1653 updateLayerTransform(); | 1667 updateLayerTransform(); |
| 1654 | 1668 |
| 1655 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if | 1669 // Update our scroll information if we're overflow:auto/scroll/hidden now th
at we know if |
| 1656 // we overflow or not. | 1670 // we overflow or not. |
| 1657 updateScrollInfoAfterLayout(); | 1671 updateScrollInfoAfterLayout(); |
| 1658 | 1672 |
| 1659 // FIXME: This repaint logic should be moved into a separate helper function
! | 1673 // FIXME: This repaint logic should be moved into a separate helper function
! |
| (...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2512 continue; | 2526 continue; |
| 2513 } | 2527 } |
| 2514 if (child->isFloating()) { | 2528 if (child->isFloating()) { |
| 2515 insertFloatingObject(child); | 2529 insertFloatingObject(child); |
| 2516 adjustFloatingBlock(marginInfo); | 2530 adjustFloatingBlock(marginInfo); |
| 2517 continue; | 2531 continue; |
| 2518 } | 2532 } |
| 2519 | 2533 |
| 2520 // Lay out the child. | 2534 // Lay out the child. |
| 2521 layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloat
LogicalBottom); | 2535 layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloat
LogicalBottom); |
| 2536 |
| 2537 document()->view()->checkPartialLayoutComplete(child); |
| 2538 if (document()->view()->canStopPartialLayout()) |
| 2539 break; |
| 2522 } | 2540 } |
| 2523 | 2541 |
| 2524 // Now do the handling of the bottom of the block, adding in our bottom bord
er/padding and | 2542 // Now do the handling of the bottom of the block, adding in our bottom bord
er/padding and |
| 2525 // determining the correct collapsed bottom margin information. | 2543 // determining the correct collapsed bottom margin information. |
| 2526 handleAfterSideOfBlock(beforeEdge, afterEdge, marginInfo); | 2544 handleAfterSideOfBlock(beforeEdge, afterEdge, marginInfo); |
| 2527 } | 2545 } |
| 2528 | 2546 |
| 2529 void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay
outUnit& previousFloatLogicalBottom, LayoutUnit& maxFloatLogicalBottom) | 2547 void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay
outUnit& previousFloatLogicalBottom, LayoutUnit& maxFloatLogicalBottom) |
| 2530 { | 2548 { |
| 2531 LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore(); | 2549 LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 } | 2594 } |
| 2577 | 2595 |
| 2578 if (!child->needsLayout()) | 2596 if (!child->needsLayout()) |
| 2579 child->markForPaginationRelayoutIfNeeded(); | 2597 child->markForPaginationRelayoutIfNeeded(); |
| 2580 | 2598 |
| 2581 bool childHadLayout = child->everHadLayout(); | 2599 bool childHadLayout = child->everHadLayout(); |
| 2582 bool childNeededLayout = child->needsLayout(); | 2600 bool childNeededLayout = child->needsLayout(); |
| 2583 if (childNeededLayout) | 2601 if (childNeededLayout) |
| 2584 child->layout(); | 2602 child->layout(); |
| 2585 | 2603 |
| 2604 if (document()->view()->canStopPartialLayout()) |
| 2605 return; |
| 2606 |
| 2586 // Cache if we are at the top of the block right now. | 2607 // Cache if we are at the top of the block right now. |
| 2587 bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock(); | 2608 bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock(); |
| 2588 | 2609 |
| 2589 // Now determine the correct ypos based off examination of collapsing margin | 2610 // Now determine the correct ypos based off examination of collapsing margin |
| 2590 // values. | 2611 // values. |
| 2591 LayoutUnit logicalTopBeforeClear = collapseMargins(child, marginInfo); | 2612 LayoutUnit logicalTopBeforeClear = collapseMargins(child, marginInfo); |
| 2592 | 2613 |
| 2593 // Now check for clear. | 2614 // Now check for clear. |
| 2594 LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, old
PosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear); | 2615 LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, old
PosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear); |
| 2595 | 2616 |
| (...skipping 5567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8163 | 8184 |
| 8164 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 8185 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
| 8165 { | 8186 { |
| 8166 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); | 8187 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->fr
ameRect().pixelSnappedX(), floatingObject->frameRect().pixelSnappedY(), floating
Object->frameRect().pixelSnappedMaxX(), floatingObject->frameRect().pixelSnapped
MaxY()); |
| 8167 } | 8188 } |
| 8168 | 8189 |
| 8169 | 8190 |
| 8170 #endif | 8191 #endif |
| 8171 | 8192 |
| 8172 } // namespace WebCore | 8193 } // namespace WebCore |
| OLD | NEW |