Commit 19004c45 authored by Kent Tamura's avatar Kent Tamura Committed by Commit Bot

Fix a DHCECK failure in NGConstraintSpaceBuilder::AdjustInlineSizeIfNeeded()

We missed to call SetOrthogonalFallbackInlineSizeIfNeeded() for
LayoutNGRubyText.

Bug: 1102186
Change-Id: Ia060b794f13dc51e03c7f715b8d307220b7f5f67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2291923
Commit-Queue: Koji Ishii <kojii@chromium.org>
Auto-Submit: Kent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#787665}
parent b6ce7d05
......@@ -2771,8 +2771,13 @@ void NGBlockLayoutAlgorithm::LayoutRubyText(
}
}
NGConstraintSpaceBuilder builder(
ConstraintSpace(), ruby_text_child->Style().GetWritingMode(), true);
const ComputedStyle& rt_style = ruby_text_child->Style();
NGConstraintSpaceBuilder builder(ConstraintSpace(), rt_style.GetWritingMode(),
true);
SetOrthogonalFallbackInlineSizeIfNeeded(Style(), *ruby_text_child, &builder);
if (!IsParallelWritingMode(Style().GetWritingMode(),
rt_style.GetWritingMode()))
builder.SetIsShrinkToFit(rt_style.LogicalWidth().IsAuto());
builder.SetAvailableSize(ChildAvailableSize());
scoped_refptr<const NGLayoutResult> result =
......
......@@ -2497,5 +2497,13 @@ TEST_F(NGBlockLayoutAlgorithmTest, DetailsFlexDoesntCrash) {
// No crash is good.
}
TEST_F(NGBlockLayoutAlgorithmTest, LayoutRubyTextCrash) {
// crbug.com/1102186. This test passes if no DCHECK failure.
SetBodyInnerHTML(R"HTML(
<ruby>base<rt style="writing-mode:vertical-rl">annotation</ruby>
)HTML");
UpdateAllLifecyclePhasesForTest();
}
} // namespace
} // namespace blink
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