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

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

Issue 385583005: For flex items, percent paddings should resolve against their respective dimension Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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
Index: Source/core/rendering/RenderBoxModelObject.cpp
diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
index 4137a965a92118d896305488b3af7c227c1b900b..d272789bea1d8575c005135fcc956ef265c3b6d1 100644
--- a/Source/core/rendering/RenderBoxModelObject.cpp
+++ b/Source/core/rendering/RenderBoxModelObject.cpp
@@ -310,11 +310,11 @@ int RenderBoxModelObject::pixelSnappedOffsetHeight() const
return snapSizeToPixel(offsetHeight(), offsetTop());
}
-LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding) const
+LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding, bool isTopOrBottomOrAfterOrBeforePadding) const
{
LayoutUnit w = 0;
if (padding.isPercent())
- w = containingBlockLogicalWidthForContent();
+ w = (containingBlock()->isFlexibleBox() && isTopOrBottomOrAfterOrBeforePadding)?containingBlockLogicalHeightForContent():containingBlockLogicalWidthForContent();
tony 2014/07/10 17:10:06 There should be spaces around the ? and :.
harpreet.sk 2014/07/14 08:38:07 Done.
return minimumValueForLength(padding, w);
}
@@ -2507,6 +2507,11 @@ LayoutUnit RenderBoxModelObject::containingBlockLogicalWidthForContent() const
return containingBlock()->availableLogicalWidth();
}
+LayoutUnit RenderBoxModelObject::containingBlockLogicalHeightForContent() const
+{
+ return containingBlock()->logicalHeight() - containingBlock()->borderAndPaddingLogicalHeight();
tony 2014/07/10 17:10:06 Does this always work? We might not have computed
harpreet.sk 2014/07/14 08:38:07 This will not work always. Uploaded new solution.
+}
+
RenderBoxModelObject* RenderBoxModelObject::continuation() const
{
if (!continuationMap)
« Source/core/rendering/RenderBoxModelObject.h ('K') | « Source/core/rendering/RenderBoxModelObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698