Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: Source/core/rendering/RenderBlock.cpp

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: define RenderObject::frameView in the header Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 { 1379 {
1380 OverflowEventDispatcher dispatcher(this); 1380 OverflowEventDispatcher dispatcher(this);
1381 1381
1382 // Update our first letter info now. 1382 // Update our first letter info now.
1383 updateFirstLetter(); 1383 updateFirstLetter();
1384 1384
1385 // Table cells call layoutBlock directly, so don't add any logic here. Put code into 1385 // Table cells call layoutBlock directly, so don't add any logic here. Put code into
1386 // layoutBlock(). 1386 // layoutBlock().
1387 layoutBlock(false); 1387 layoutBlock(false);
1388 1388
1389 if (frameView()->partialLayout().isStopping())
1390 return;
1391
1389 // It's safe to check for control clip here, since controls can never be tab le cells. 1392 // It's safe to check for control clip here, since controls can never be tab le cells.
1390 // If we have a lightweight clip, there can never be any overflow from child ren. 1393 // If we have a lightweight clip, there can never be any overflow from child ren.
1391 if (hasControlClip() && m_overflow) 1394 if (hasControlClip() && m_overflow)
1392 clearLayoutOverflow(); 1395 clearLayoutOverflow();
1393 1396
1394 invalidateBackgroundObscurationStatus(); 1397 invalidateBackgroundObscurationStatus();
1395 } 1398 }
1396 1399
1397 void RenderBlock::imageChanged(WrappedImagePtr image, const IntRect*) 1400 void RenderBlock::imageChanged(WrappedImagePtr image, const IntRect*)
1398 { 1401 {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 LayoutUnit repaintLogicalTop = 0; 1592 LayoutUnit repaintLogicalTop = 0;
1590 LayoutUnit repaintLogicalBottom = 0; 1593 LayoutUnit repaintLogicalBottom = 0;
1591 LayoutUnit maxFloatLogicalBottom = 0; 1594 LayoutUnit maxFloatLogicalBottom = 0;
1592 if (!firstChild() && !isAnonymousBlock()) 1595 if (!firstChild() && !isAnonymousBlock())
1593 setChildrenInline(true); 1596 setChildrenInline(true);
1594 if (childrenInline()) 1597 if (childrenInline())
1595 layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogical Bottom); 1598 layoutInlineChildren(relayoutChildren, repaintLogicalTop, repaintLogical Bottom);
1596 else 1599 else
1597 layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom, layoutScope ); 1600 layoutBlockChildren(relayoutChildren, maxFloatLogicalBottom, layoutScope );
1598 1601
1602 if (frameView()->partialLayout().isStopping()) {
1603 statePusher.pop();
1604 return;
1605 }
1606
1599 // Expand our intrinsic height to encompass floats. 1607 // Expand our intrinsic height to encompass floats.
1600 LayoutUnit toAdd = borderAfter() + paddingAfter() + scrollbarLogicalHeight() ; 1608 LayoutUnit toAdd = borderAfter() + paddingAfter() + scrollbarLogicalHeight() ;
1601 if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEnclo seOverhangingFloats()) 1609 if (lowestFloatLogicalBottom() > (logicalHeight() - toAdd) && expandsToEnclo seOverhangingFloats())
1602 setLogicalHeight(lowestFloatLogicalBottom() + toAdd); 1610 setLogicalHeight(lowestFloatLogicalBottom() + toAdd);
1603 1611
1604 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight, statePusher)) 1612 if (relayoutForPagination(hasSpecifiedPageLogicalHeight, pageLogicalHeight, statePusher))
1605 return; 1613 return;
1606 1614
1607 // Calculate our new height. 1615 // Calculate our new height.
1608 LayoutUnit oldHeight = logicalHeight(); 1616 LayoutUnit oldHeight = logicalHeight();
(...skipping 27 matching lines...) Expand all
1636 1644
1637 updateRegionsAndShapesAfterChildLayout(flowThread, heightChanged); 1645 updateRegionsAndShapesAfterChildLayout(flowThread, heightChanged);
1638 1646
1639 // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway). 1647 // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
1640 computeOverflow(oldClientAfterEdge); 1648 computeOverflow(oldClientAfterEdge);
1641 1649
1642 statePusher.pop(); 1650 statePusher.pop();
1643 1651
1644 fitBorderToLinesIfNeeded(); 1652 fitBorderToLinesIfNeeded();
1645 1653
1654 if (frameView()->partialLayout().isStopping())
1655 return;
1656
1646 if (renderView->layoutState()->m_pageLogicalHeight) 1657 if (renderView->layoutState()->m_pageLogicalHeight)
1647 setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(this, logicalTop())); 1658 setPageLogicalOffset(renderView->layoutState()->pageLogicalOffset(this, logicalTop()));
1648 1659
1649 updateLayerTransform(); 1660 updateLayerTransform();
1650 1661
1651 // Update our scroll information if we're overflow:auto/scroll/hidden now th at we know if 1662 // Update our scroll information if we're overflow:auto/scroll/hidden now th at we know if
1652 // we overflow or not. 1663 // we overflow or not.
1653 updateScrollInfoAfterLayout(); 1664 updateScrollInfoAfterLayout();
1654 1665
1655 // FIXME: This repaint logic should be moved into a separate helper function ! 1666 // FIXME: This repaint logic should be moved into a separate helper function !
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
2508 continue; 2519 continue;
2509 } 2520 }
2510 if (child->isFloating()) { 2521 if (child->isFloating()) {
2511 insertFloatingObject(child); 2522 insertFloatingObject(child);
2512 adjustFloatingBlock(marginInfo); 2523 adjustFloatingBlock(marginInfo);
2513 continue; 2524 continue;
2514 } 2525 }
2515 2526
2516 // Lay out the child. 2527 // Lay out the child.
2517 layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloat LogicalBottom); 2528 layoutBlockChild(child, marginInfo, previousFloatLogicalBottom, maxFloat LogicalBottom);
2529
2530 // If doing a partial layout and the child was the target renderer, earl y exit here.
2531 if (frameView()->partialLayout().checkPartialLayoutComplete(child))
2532 break;
2518 } 2533 }
2519 2534
2520 // Now do the handling of the bottom of the block, adding in our bottom bord er/padding and 2535 // Now do the handling of the bottom of the block, adding in our bottom bord er/padding and
2521 // determining the correct collapsed bottom margin information. 2536 // determining the correct collapsed bottom margin information.
2522 handleAfterSideOfBlock(beforeEdge, afterEdge, marginInfo); 2537 handleAfterSideOfBlock(beforeEdge, afterEdge, marginInfo);
2523 } 2538 }
2524 2539
2525 void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay outUnit& previousFloatLogicalBottom, LayoutUnit& maxFloatLogicalBottom) 2540 void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, Lay outUnit& previousFloatLogicalBottom, LayoutUnit& maxFloatLogicalBottom)
2526 { 2541 {
2527 LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore(); 2542 LayoutUnit oldPosMarginBefore = maxPositiveMarginBefore();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 2588
2574 SubtreeLayoutScope layoutScope(child); 2589 SubtreeLayoutScope layoutScope(child);
2575 if (!child->needsLayout()) 2590 if (!child->needsLayout())
2576 child->markForPaginationRelayoutIfNeeded(layoutScope); 2591 child->markForPaginationRelayoutIfNeeded(layoutScope);
2577 2592
2578 bool childHadLayout = child->everHadLayout(); 2593 bool childHadLayout = child->everHadLayout();
2579 bool childNeededLayout = child->needsLayout(); 2594 bool childNeededLayout = child->needsLayout();
2580 if (childNeededLayout) 2595 if (childNeededLayout)
2581 child->layout(); 2596 child->layout();
2582 2597
2598 if (frameView()->partialLayout().isStopping())
2599 return;
2600
2583 // Cache if we are at the top of the block right now. 2601 // Cache if we are at the top of the block right now.
2584 bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock(); 2602 bool atBeforeSideOfBlock = marginInfo.atBeforeSideOfBlock();
2585 2603
2586 // Now determine the correct ypos based off examination of collapsing margin 2604 // Now determine the correct ypos based off examination of collapsing margin
2587 // values. 2605 // values.
2588 LayoutUnit logicalTopBeforeClear = collapseMargins(child, marginInfo); 2606 LayoutUnit logicalTopBeforeClear = collapseMargins(child, marginInfo);
2589 2607
2590 // Now check for clear. 2608 // Now check for clear.
2591 LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, old PosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear); 2609 LayoutUnit logicalTopAfterClear = clearFloatsIfNeeded(child, marginInfo, old PosMarginBefore, oldNegMarginBefore, logicalTopBeforeClear);
2592 2610
(...skipping 5445 matching lines...) Expand 10 before | Expand all | Expand 10 after
8038 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 8056 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
8039 { 8057 {
8040 showRenderObject(); 8058 showRenderObject();
8041 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 8059 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
8042 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 8060 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
8043 } 8061 }
8044 8062
8045 #endif 8063 #endif
8046 8064
8047 } // namespace WebCore 8065 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockLineLayout.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698