Commit a86712ac authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

[LayoutNG] Deduplicate code in CreateExclusionShapeData().

Change-Id: I6017cfa22dd176e88b6b6e64a3f594173e2851a2
Reviewed-on: https://chromium-review.googlesource.com/c/1326141Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606432}
parent da06a02d
......@@ -118,25 +118,15 @@ std::unique_ptr<NGExclusionShapeData> CreateExclusionShapeData(
case CSSBoxType::kBorder:
break;
case CSSBoxType::kPadding:
shape_insets =
ComputeBorders(CreateConstraintSpaceForFloat(
float_available_size, float_percentage_size,
float_replaced_percentage_size, unpositioned_float,
parent_space),
style)
.ConvertToPhysical(style.GetWritingMode(), style.Direction())
.ConvertToLogical(parent_space.GetWritingMode(),
TextDirection::kLtr);
break;
case CSSBoxType::kContent:
const NGConstraintSpace space = CreateConstraintSpaceForFloat(
float_available_size, float_percentage_size,
float_replaced_percentage_size, unpositioned_float, parent_space);
NGBoxStrut border_padding =
ComputeBorders(space, style) + ComputePadding(space, style);
NGBoxStrut strut = ComputeBorders(space, style);
if (style.ShapeOutside()->CssBox() == CSSBoxType::kContent)
strut += ComputePadding(space, style);
shape_insets =
border_padding
.ConvertToPhysical(style.GetWritingMode(), style.Direction())
strut.ConvertToPhysical(style.GetWritingMode(), style.Direction())
.ConvertToLogical(parent_space.GetWritingMode(),
TextDirection::kLtr);
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment