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

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

Issue 1171703002: Don't let anonymous boxes impede percentage resolution on children. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | « LayoutTests/fast/ruby/percentage-height-child-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBox.cpp
diff --git a/Source/core/layout/LayoutBox.cpp b/Source/core/layout/LayoutBox.cpp
index d1da8e1d29cdeb71fa81a1efc054d765f79cd01c..d94baff60e4baa847a3c3bcd5da2a94e21936d3e 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -2432,17 +2432,14 @@ bool LayoutBox::skipContainingBlockForPercentHeightCalculation(const LayoutBox*
if (isHorizontalWritingMode() != containingBlock->isHorizontalWritingMode())
return false;
- // Flow threads for multicol or paged overflow should be skipped. They are invisible to the DOM,
- // and percent heights of children should be resolved against the multicol or paged container.
- if (containingBlock->isLayoutFlowThread())
+ // Anonymous layout objects are invisible to the DOM, so whatever they're doing there, they
+ // should not impede percentage resolution on a child. Examples of such anonymous layout objects
+ // are multicol flow threads and ruby runs.
+ if (containingBlock->isAnonymous())
return true;
- // For quirks mode and anonymous blocks, we skip auto-height containingBlocks when computing percentages.
- // For standards mode, we treat the percentage as auto if it has an auto-height containing block.
- if (!document().inQuirksMode() && !containingBlock->isAnonymousBlock())
- return false;
-
- return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPositioned() && containingBlock->style()->logicalHeight().isAuto();
+ // For quirks mode, we skip most auto-height containing blocks when computing percentages.
+ return document().inQuirksMode() && !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPositioned() && containingBlock->style()->logicalHeight().isAuto();
}
LayoutUnit LayoutBox::computePercentageLogicalHeight(const Length& height) const
« no previous file with comments | « LayoutTests/fast/ruby/percentage-height-child-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698