Commit f8a6fb04 authored by Oriol Brufau's avatar Oriol Brufau Committed by Commit Bot

Set NGConstraintSpace's direction for inline children of a block container

Currently the NGConstraintSpace's direction for inline children of a
block containeris is LTR even if the block container has RTL direction.

BUG=904951

Change-Id: I271f2e2f4b30df6513d84ea149dc73b9532a4ce0
Reviewed-on: https://chromium-review.googlesource.com/c/1334508Reviewed-by: default avatarChristian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#607833}
parent 0fd98b80
...@@ -2004,8 +2004,9 @@ NGConstraintSpace NGBlockLayoutAlgorithm::CreateConstraintSpaceForChild( ...@@ -2004,8 +2004,9 @@ NGConstraintSpace NGBlockLayoutAlgorithm::CreateConstraintSpaceForChild(
const NGInflowChildData& child_data, const NGInflowChildData& child_data,
const NGLogicalSize child_available_size, const NGLogicalSize child_available_size,
const base::Optional<LayoutUnit> floats_bfc_block_offset) { const base::Optional<LayoutUnit> floats_bfc_block_offset) {
const ComputedStyle& style = Style();
WritingMode child_writing_mode = child.IsInline() WritingMode child_writing_mode = child.IsInline()
? Style().GetWritingMode() ? style.GetWritingMode()
: child.Style().GetWritingMode(); : child.Style().GetWritingMode();
NGConstraintSpaceBuilder space_builder(ConstraintSpace(), child_writing_mode, NGConstraintSpaceBuilder space_builder(ConstraintSpace(), child_writing_mode,
...@@ -2056,8 +2057,10 @@ NGConstraintSpace NGBlockLayoutAlgorithm::CreateConstraintSpaceForChild( ...@@ -2056,8 +2057,10 @@ NGConstraintSpace NGBlockLayoutAlgorithm::CreateConstraintSpaceForChild(
// PositionListMarker() requires a first line baseline. // PositionListMarker() requires a first line baseline.
if (container_builder_.UnpositionedListMarker()) { if (container_builder_.UnpositionedListMarker()) {
space_builder.AddBaselineRequest( space_builder.AddBaselineRequest(
{NGBaselineAlgorithmType::kFirstLine, Style().GetFontBaseline()}); {NGBaselineAlgorithmType::kFirstLine, style.GetFontBaseline()});
} }
} else {
space_builder.SetTextDirection(style.Direction());
} }
space_builder.SetClearanceOffset(clearance_offset); space_builder.SetClearanceOffset(clearance_offset);
if (child_data.force_clearance) if (child_data.force_clearance)
......
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