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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBlock.cpp
diff --git a/Source/core/rendering/RenderBlock.cpp b/Source/core/rendering/RenderBlock.cpp
index bd49f4ad3547517a216814008da89d5912a61957..3528427732d0e58f47274803fcb3b4eaf5a6366c 100644
--- a/Source/core/rendering/RenderBlock.cpp
+++ b/Source/core/rendering/RenderBlock.cpp
@@ -3878,6 +3878,26 @@ bool RenderBlock::recalcOverflowAfterStyleChange()
return !hasOverflowClip();
}
+// Called when a positioned object moves but doesn't necessarily change size. A simplified layout is attempted
+// that just updates the object's position. If the size does change, the object remains dirty.
+bool RenderBlock::tryLayoutDoingPositionedMovementOnly()
+{
+ LayoutUnit oldWidth = logicalWidth();
+ LogicalExtentComputedValues computedValues;
+ logicalExtentAfterUpdatingLogicalWidth(logicalTop(), computedValues);
+ // If we shrink to fit our width may have changed, so we still need full layout.
+ if (oldWidth != computedValues.m_extent)
+ return false;
+ setLogicalWidth(computedValues.m_extent);
+ setLogicalLeft(computedValues.m_position);
+ setMarginStart(computedValues.m_margins.m_start);
+ setMarginEnd(computedValues.m_margins.m_end);
+
+ LayoutUnit oldHeight = logicalHeight();
+ updateLogicalHeight();
+ return !hasPercentHeightDescendants() || oldHeight == logicalHeight();
+}
+
#if ENABLE(ASSERT)
void RenderBlock::checkPositionedObjectsNeedLayout()
{
« 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