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

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

Issue 195363007: Avoid unnecessary descents into nested boxes with floats. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 8 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
OLDNEW
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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 if (heightChanged) 441 if (heightChanged)
442 relayoutChildren = true; 442 relayoutChildren = true;
443 443
444 layoutPositionedObjects(relayoutChildren || isDocumentElement(), oldLeft != logicalLeft() ? ForcedLayoutAfterContainingBlockMoved : DefaultLayout); 444 layoutPositionedObjects(relayoutChildren || isDocumentElement(), oldLeft != logicalLeft() ? ForcedLayoutAfterContainingBlockMoved : DefaultLayout);
445 445
446 computeRegionRangeForBlock(flowThreadContainingBlock()); 446 computeRegionRangeForBlock(flowThreadContainingBlock());
447 447
448 // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway). 448 // Add overflow from children (unless we're multi-column, since in that case all our child overflow is clipped anyway).
449 computeOverflow(oldClientAfterEdge); 449 computeOverflow(oldClientAfterEdge);
450 450
451 m_descendantsWithFloatsMarkedForLayout = false;
451 return true; 452 return true;
452 } 453 }
453 454
454 void RenderBlockFlow::determineLogicalLeftPositionForChild(RenderBox* child, App lyLayoutDeltaMode applyDelta) 455 void RenderBlockFlow::determineLogicalLeftPositionForChild(RenderBox* child, App lyLayoutDeltaMode applyDelta)
455 { 456 {
456 LayoutUnit startPosition = borderStart() + paddingStart(); 457 LayoutUnit startPosition = borderStart() + paddingStart();
457 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 458 if (style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
458 startPosition -= verticalScrollbarWidth(); 459 startPosition -= verticalScrollbarWidth();
459 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + ava ilableLogicalWidth(); 460 LayoutUnit totalAvailableLogicalWidth = borderAndPaddingLogicalWidth() + ava ilableLogicalWidth();
460 461
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1685 if (containsFloats()) 1686 if (containsFloats())
1686 m_floatingObjects->clearLineBoxTreePointers(); 1687 m_floatingObjects->clearLineBoxTreePointers();
1687 RenderBlock::deleteLineBoxTree(); 1688 RenderBlock::deleteLineBoxTree();
1688 } 1689 }
1689 1690
1690 void RenderBlockFlow::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRe move, bool inLayout) 1691 void RenderBlockFlow::markAllDescendantsWithFloatsForLayout(RenderBox* floatToRe move, bool inLayout)
1691 { 1692 {
1692 if (!everHadLayout() && !containsFloats()) 1693 if (!everHadLayout() && !containsFloats())
1693 return; 1694 return;
1694 1695
1696 if (m_descendantsWithFloatsMarkedForLayout && !floatToRemove)
1697 return;
1698 m_descendantsWithFloatsMarkedForLayout = m_descendantsWithFloatsMarkedForLay out || !floatToRemove;
1699
1695 MarkingBehavior markParents = inLayout ? MarkOnlyThis : MarkContainingBlockC hain; 1700 MarkingBehavior markParents = inLayout ? MarkOnlyThis : MarkContainingBlockC hain;
1696 setChildNeedsLayout(markParents); 1701 setChildNeedsLayout(markParents);
1697 1702
1698 if (floatToRemove) 1703 if (floatToRemove)
1699 removeFloatingObject(floatToRemove); 1704 removeFloatingObject(floatToRemove);
1700 1705
1701 // Iterate over our children and mark them as needed. 1706 // Iterate over our children and mark them as needed.
1702 if (!childrenInline()) { 1707 if (!childrenInline()) {
1703 for (RenderObject* child = firstChild(); child; child = child->nextSibli ng()) { 1708 for (RenderObject* child = firstChild(); child; child = child->nextSibli ng()) {
1704 if ((!floatToRemove && child->isFloatingOrOutOfFlowPositioned()) || !child->isRenderBlock()) 1709 if ((!floatToRemove && child->isFloatingOrOutOfFlowPositioned()) || !child->isRenderBlock())
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData() 2802 RenderBlockFlow::RenderBlockFlowRareData& RenderBlockFlow::ensureRareData()
2798 { 2803 {
2799 if (m_rareData) 2804 if (m_rareData)
2800 return *m_rareData; 2805 return *m_rareData;
2801 2806
2802 m_rareData = adoptPtr(new RenderBlockFlowRareData(this)); 2807 m_rareData = adoptPtr(new RenderBlockFlowRareData(this));
2803 return *m_rareData; 2808 return *m_rareData;
2804 } 2809 }
2805 2810
2806 } // namespace WebCore 2811 } // namespace WebCore
OLDNEW
« Source/core/rendering/RenderBlock.h ('K') | « Source/core/rendering/RenderBlock.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698