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

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
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('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 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()
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 return !hasPercentHeightDescendants() || oldHeight == logicalHeight();
3899 }
3900
3881 #if ENABLE(ASSERT) 3901 #if ENABLE(ASSERT)
3882 void RenderBlock::checkPositionedObjectsNeedLayout() 3902 void RenderBlock::checkPositionedObjectsNeedLayout()
3883 { 3903 {
3884 if (!gPositionedDescendantsMap) 3904 if (!gPositionedDescendantsMap)
3885 return; 3905 return;
3886 3906
3887 if (TrackedRendererListHashSet* positionedDescendantSet = positionedObjects( )) { 3907 if (TrackedRendererListHashSet* positionedDescendantSet = positionedObjects( )) {
3888 TrackedRendererListHashSet::const_iterator end = positionedDescendantSet ->end(); 3908 TrackedRendererListHashSet::const_iterator end = positionedDescendantSet ->end();
3889 for (TrackedRendererListHashSet::const_iterator it = positionedDescendan tSet->begin(); it != end; ++it) { 3909 for (TrackedRendererListHashSet::const_iterator it = positionedDescendan tSet->begin(); it != end; ++it) {
3890 RenderBox* currBox = *it; 3910 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 3933 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
3914 { 3934 {
3915 showRenderObject(); 3935 showRenderObject();
3916 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 3936 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
3917 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 3937 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
3918 } 3938 }
3919 3939
3920 #endif 3940 #endif
3921 3941
3922 } // namespace blink 3942 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698