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

Unified Diff: Source/core/rendering/RenderBox.cpp

Issue 846483002: Percentage heights can be resolved against any parent if writing mode is orthogonal. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Un-skip the same test for virtual/slimmingpaint. 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 | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index b4c3939d511b886855b77a039883d27d13d96512..35903b0646fefd71d9e8bc154b950046068b4261 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -2359,6 +2359,11 @@ LayoutUnit RenderBox::computeContentAndScrollbarLogicalHeightUsing(const Length&
bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox* containingBlock) const
{
+ // If the writing mode of the containing block is orthogonal to ours, it means that we shouldn't
+ // skip anything, since we're going to resolve the percentage height against a containing block *width*.
+ 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->isRenderFlowThread())
@@ -2368,7 +2373,8 @@ bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox*
// 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() && isHorizontalWritingMode() == containingBlock->isHorizontalWritingMode();
+
+ return !containingBlock->isTableCell() && !containingBlock->isOutOfFlowPositioned() && containingBlock->style()->logicalHeight().isAuto();
}
LayoutUnit RenderBox::computePercentageLogicalHeight(const Length& height) const
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698