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

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

Issue 1289463002: Auto-height table cells must stop percentage resolution of child heights. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Right.. anonymous inline-blocks too. Created 5 years, 4 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/table/percent-height-inside-anonymous-cell-expected.txt ('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 85a09953e31bb812f5783c5b460969d1c3ed16fa..82bde7e69164df0063623b8a83b209648da038f2 100644
--- a/Source/core/layout/LayoutBox.cpp
+++ b/Source/core/layout/LayoutBox.cpp
@@ -2408,11 +2408,15 @@ bool LayoutBox::skipContainingBlockForPercentHeightCalculation(const LayoutBox*
if (isHorizontalWritingMode() != containingBlock->isHorizontalWritingMode())
return false;
- // 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;
+ // Anonymous blocks should not impede percentage resolution on a child. Examples of such
+ // anonymous blocks are blocks wrapped around inlines that have block siblings (from the CSS
+ // spec) and multicol flow threads (an implementation detail). Another implementation detail,
+ // ruby runs, create anonymous inline-blocks, so skip those too. All other types of anonymous
+ // objects, such as table-cells, will be treated just as if they were non-anonymous.
+ if (containingBlock->isAnonymous()) {
+ EDisplay display = containingBlock->styleRef().display();
+ return display == BLOCK || display == INLINE_BLOCK;
+ }
// For quirks mode, we skip most auto-height containing blocks when computing percentages.
return document().inQuirksMode() && !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPositioned() && containingBlock->style()->logicalHeight().isAuto();
« no previous file with comments | « LayoutTests/fast/table/percent-height-inside-anonymous-cell-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698