4617#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
4618bool RenderBlockFlow::tryComputePreferredWidthsUsingModernPath(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth)
4619{
4620#if ENABLE_MODERN_PREFERRED_WIDTH_COMPUTATION
4621 computeAndSetLineLayoutPath();
4622
4623 // FIXME: Allow inline boxes.
4624 // FIXME: Pass the replaced and inline block constrainst to IFC.
4625 auto canUseModernPathForPreferredWidthComputation = [&] {
4626 if (lineLayoutPath() != ModernPath)
4627 return false;
4628 for (auto walker = InlineWalker(*this); !walker.atEnd(); walker.advance()) {
4629 auto& renderer = *walker.current();
4630 if (renderer.isText())
4631 continue;
4632 if (is<RenderLineBreak>(renderer))
4633 continue;
4634#if ENABLE_MODERN_PREFERRED_WIDTH_COMPUTATION_FOR_INLINE_BOXES
4635 if (is<RenderInline>(renderer))
4636 continue;
4637#endif
4638 return false;
4639 }
4640 return true;
4641 };
4642
4643 if (!canUseModernPathForPreferredWidthComputation())
4644 return false;
4645
4646 if (!modernLineLayout())
4647 m_lineLayout = makeUnique<LayoutIntegration::LineLayout>(*this);
4648
4649 std::tie(minLogicalWidth, maxLogicalWidth) = modernLineLayout()->computeIntrinsicWidthConstraints();
4650 return true;
4651#else
4652 UNUSED_PARAM(minLogicalWidth);
4653 UNUSED_PARAM(maxLogicalWidth);
4654 return false;
4655#endif
4656}
4657#endif
4658