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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1530303003: Implement Layout Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add additional test case and descriptions Created 5 years 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
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index f8986d141ca7888851c88322342aabb4c99afd06..d6460b0f6535dde544c7d6903d8edba2aa4afb82 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2064,7 +2064,7 @@ static float getMaxWidthListMarker(const LayoutBox* layoutObject)
void LayoutBox::computeLogicalWidth(LogicalExtentComputedValues& computedValues) const
{
- computedValues.m_extent = logicalWidth();
+ computedValues.m_extent = style()->containsLayout() ? borderAndPaddingLogicalWidth() : logicalWidth();
computedValues.m_position = logicalLeft();
computedValues.m_margins.m_start = marginStart();
computedValues.m_margins.m_end = marginEnd();
@@ -2379,7 +2379,10 @@ void LayoutBox::updateLogicalHeight()
m_intrinsicContentLogicalHeight = contentLogicalHeight();
LogicalExtentComputedValues computedValues;
- computeLogicalHeight(logicalHeight(), logicalTop(), computedValues);
+ if (style()->containsLayout())
ojan 2015/12/18 18:21:14 Nit: I might have written this as: LayoutUnit heig
+ computeLogicalHeight(borderAndPaddingLogicalHeight(), logicalTop(), computedValues);
+ else
+ computeLogicalHeight(logicalHeight(), logicalTop(), computedValues);
setLogicalHeight(computedValues.m_extent);
setLogicalTop(computedValues.m_position);
@@ -4058,7 +4061,7 @@ static bool shouldBeConsideredAsReplaced(Node* node)
bool LayoutBox::avoidsFloats() const
{
- return isAtomicInlineLevel() || shouldBeConsideredAsReplaced(node()) || hasOverflowClip() || isHR() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated() || style()->containsPaint();
+ return isAtomicInlineLevel() || shouldBeConsideredAsReplaced(node()) || hasOverflowClip() || isHR() || isLegend() || isWritingModeRoot() || isFlexItemIncludingDeprecated() || style()->containsPaint() || style()->containsLayout();
}
bool LayoutBox::hasNonCompositedScrollbars() const

Powered by Google App Engine
This is Rietveld 408576698