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( ...@@ -118,25 +118,15 @@ std::unique_ptr<NGExclusionShapeData> CreateExclusionShapeData(
case CSSBoxType::kBorder: case CSSBoxType::kBorder:
break; break;
case CSSBoxType::kPadding: 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: case CSSBoxType::kContent:
const NGConstraintSpace space = CreateConstraintSpaceForFloat( const NGConstraintSpace space = CreateConstraintSpaceForFloat(
float_available_size, float_percentage_size, float_available_size, float_percentage_size,
float_replaced_percentage_size, unpositioned_float, parent_space); float_replaced_percentage_size, unpositioned_float, parent_space);
NGBoxStrut border_padding = NGBoxStrut strut = ComputeBorders(space, style);
ComputeBorders(space, style) + ComputePadding(space, style); if (style.ShapeOutside()->CssBox() == CSSBoxType::kContent)
strut += ComputePadding(space, style);
shape_insets = shape_insets =
border_padding strut.ConvertToPhysical(style.GetWritingMode(), style.Direction())
.ConvertToPhysical(style.GetWritingMode(), style.Direction())
.ConvertToLogical(parent_space.GetWritingMode(), .ConvertToLogical(parent_space.GetWritingMode(),
TextDirection::kLtr); TextDirection::kLtr);
break; 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