Title: [295282] trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp
- Revision
- 295282
- Author
- za...@apple.com
- Date
- 2022-06-06 06:08:35 -0700 (Mon, 06 Jun 2022)
Log Message
Populate canUseForFlexLayout with unsupported styles and content
https://bugs.webkit.org/show_bug.cgi?id=241323
Reviewed by Tim Nguyen.
This is in preparation for being able to run WPT tests (filter out unsupported content).
* Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForFlexLayout):
Canonical link: https://commits.webkit.org/251328@main
Modified Paths
Diff
Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (295281 => 295282)
--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp 2022-06-06 12:10:42 UTC (rev 295281)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp 2022-06-06 13:08:35 UTC (rev 295282)
@@ -678,8 +678,33 @@
{
if (!flexBox.document().settings().flexFormattingContextIntegrationEnabled())
return false;
- ASSERT_NOT_IMPLEMENTED_YET();
- return false;
+
+ auto& flexBoxStyle = flexBox.style();
+ if (!flexBoxStyle.isHorizontalWritingMode() || !flexBoxStyle.isLeftToRightDirection())
+ return false;
+ if (flexBoxStyle.flexWrap() == FlexWrap::Reverse)
+ return false;
+ if (flexBoxStyle.alignItems().position() == ItemPosition::Baseline)
+ return false;
+ if (flexBoxStyle.alignContent().position() != ContentPosition::Normal || flexBoxStyle.alignContent().distribution() != ContentDistribution::Default || flexBoxStyle.alignContent().overflow() != OverflowAlignment::Default)
+ return false;
+ if (!flexBoxStyle.rowGap().isNormal() || !flexBoxStyle.columnGap().isNormal())
+ return false;
+
+ for (auto& flexItem : childrenOfType<RenderElement>(flexBox)) {
+ if (!is<RenderBox>(flexItem))
+ return false;
+ if (flexItem.isFloating() || flexItem.isOutOfFlowPositioned())
+ return false;
+ if (flexItem.isSVGRootOrLegacySVGRoot())
+ return false;
+ auto& flexItemStyle = flexItem.style();
+ if (!flexItemStyle.maxWidth().isUndefined() || !flexItemStyle.maxHeight().isUndefined())
+ return false;
+ if (flexItem.hasIntrinsicAspectRatio() || flexItemStyle.hasAspectRatio())
+ return false;
+ }
+ return true;
}
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes