| Index: Source/core/rendering/RenderBoxModelObject.cpp
|
| diff --git a/Source/core/rendering/RenderBoxModelObject.cpp b/Source/core/rendering/RenderBoxModelObject.cpp
|
| index d8e6b964a86ff8542c214b0063fbfc997faca326..063f480b0453c4ea07fb125489b92f9e1490d477 100644
|
| --- a/Source/core/rendering/RenderBoxModelObject.cpp
|
| +++ b/Source/core/rendering/RenderBoxModelObject.cpp
|
| @@ -312,11 +312,19 @@ int RenderBoxModelObject::pixelSnappedOffsetHeight() const
|
| return snapSizeToPixel(offsetHeight(), offsetTop());
|
| }
|
|
|
| -LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding) const
|
| +LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding, PaddingType type) const
|
| {
|
| LayoutUnit w = 0;
|
| - if (padding.isPercent())
|
| - w = containingBlockLogicalWidthForContent();
|
| + if (padding.isPercent()) {
|
| + if (containingBlock()->isFlexibleBox() && RuntimeEnabledFeatures::verticalPaddingEnabled()) {
|
| + if (type == TopPadding || type == BottomPadding || type == BeforePadding || type == AfterPadding)
|
| + w = containingBlockLogicalHeightForPadding();
|
| + else
|
| + w = containingBlockLogicalWidthForContent();
|
| + } else {
|
| + w = containingBlockLogicalWidthForContent();
|
| + }
|
| + }
|
| return minimumValueForLength(padding, w);
|
| }
|
|
|
| @@ -2503,6 +2511,32 @@ LayoutUnit RenderBoxModelObject::containingBlockLogicalWidthForContent() const
|
| return containingBlock()->availableLogicalWidth();
|
| }
|
|
|
| +LayoutUnit RenderBoxModelObject::containingBlockLogicalHeightForPadding() const
|
| +{
|
| + switch (containingBlock()->style()->logicalHeight().type()) {
|
| + case Auto:
|
| + case MinContent:
|
| + case MaxContent:
|
| + case FitContent:
|
| + case FillAvailable:
|
| + case Intrinsic:
|
| + case MinIntrinsic:
|
| + case MaxSizeNone:
|
| + case ExtendToZoom:
|
| + case DeviceWidth:
|
| + case DeviceHeight:
|
| + return 0;
|
| + case Fixed:
|
| + case Calculated:
|
| + return containingBlock()->style()->logicalHeight().value();
|
| + case Percent:
|
| + return std::max<LayoutUnit>(containingBlock()->computePercentageLogicalHeight(containingBlock()->style()->logicalHeight()), 0);
|
| + }
|
| +
|
| + ASSERT_NOT_REACHED();
|
| + return 0;
|
| +}
|
| +
|
| RenderBoxModelObject* RenderBoxModelObject::continuation() const
|
| {
|
| if (!continuationMap)
|
|
|