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

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

Issue 802813003: Skip PositionedMovementLayout when descendants depend on element's height (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 5 years, 11 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) 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 3860 matching lines...) Expand 10 before | Expand all | Expand 10 after
3871 3871
3872 LayoutUnit oldClientAfterEdge = hasRenderOverflow() ? m_overflow->layoutClie ntAfterEdge() : clientLogicalBottom(); 3872 LayoutUnit oldClientAfterEdge = hasRenderOverflow() ? m_overflow->layoutClie ntAfterEdge() : clientLogicalBottom();
3873 computeOverflow(oldClientAfterEdge, true); 3873 computeOverflow(oldClientAfterEdge, true);
3874 3874
3875 if (hasOverflowClip()) 3875 if (hasOverflowClip())
3876 layer()->scrollableArea()->updateAfterOverflowRecalc(); 3876 layer()->scrollableArea()->updateAfterOverflowRecalc();
3877 3877
3878 return !hasOverflowClip(); 3878 return !hasOverflowClip();
3879 } 3879 }
3880 3880
3881 // Called when a positioned object moves but doesn't necessarily change size. A simplified layout is attempted
3882 // that just updates the object's position. If the size does change, the object remains dirty.
3883 bool RenderBlock::tryLayoutDoingPositionedMovementOnly()
Julien - ping for review 2015/01/06 14:35:09 I can understand why only blocks use this function
rhogan 2015/01/06 21:43:45 The other reason I moved it is that hasPercentageH
Julien - ping for review 2015/01/07 09:41:39 I think we have no other option then as hasPercent
3884 {
3885 LayoutUnit oldWidth = logicalWidth();
3886 LogicalExtentComputedValues computedValues;
3887 logicalExtentAfterUpdatingLogicalWidth(logicalTop(), computedValues);
3888 // If we shrink to fit our width may have changed, so we still need full lay out.
3889 if (oldWidth != computedValues.m_extent)
3890 return false;
3891 setLogicalWidth(computedValues.m_extent);
3892 setLogicalLeft(computedValues.m_position);
3893 setMarginStart(computedValues.m_margins.m_start);
3894 setMarginEnd(computedValues.m_margins.m_end);
3895
3896 LayoutUnit oldHeight = logicalHeight();
3897 updateLogicalHeight();
3898 if (hasPercentHeightDescendants() && oldHeight != logicalHeight())
Julien - ping for review 2015/01/06 14:35:09 The percentage height descendant map is filled dur
3899 return false;
3900 return true;
Julien - ping for review 2015/01/06 14:35:09 The past 3 lines can be combined into a single lin
3901 }
3902
3881 #if ENABLE(ASSERT) 3903 #if ENABLE(ASSERT)
3882 void RenderBlock::checkPositionedObjectsNeedLayout() 3904 void RenderBlock::checkPositionedObjectsNeedLayout()
3883 { 3905 {
3884 if (!gPositionedDescendantsMap) 3906 if (!gPositionedDescendantsMap)
3885 return; 3907 return;
3886 3908
3887 if (TrackedRendererListHashSet* positionedDescendantSet = positionedObjects( )) { 3909 if (TrackedRendererListHashSet* positionedDescendantSet = positionedObjects( )) {
3888 TrackedRendererListHashSet::const_iterator end = positionedDescendantSet ->end(); 3910 TrackedRendererListHashSet::const_iterator end = positionedDescendantSet ->end();
3889 for (TrackedRendererListHashSet::const_iterator it = positionedDescendan tSet->begin(); it != end; ++it) { 3911 for (TrackedRendererListHashSet::const_iterator it = positionedDescendan tSet->begin(); it != end; ++it) {
3890 RenderBox* currBox = *it; 3912 RenderBox* currBox = *it;
(...skipping 22 matching lines...) Expand all
3913 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 3935 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
3914 { 3936 {
3915 showRenderObject(); 3937 showRenderObject();
3916 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3938 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3917 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3939 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3918 } 3940 }
3919 3941
3920 #endif 3942 #endif
3921 3943
3922 } // namespace blink 3944 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698