Skip to content
Permalink
Browse files
[FFC][Integration] Add "fixed sized/all default value" flex layout
https://bugs.webkit.org/show_bug.cgi?id=240414

Reviewed by Antti Koivisto.

This patch adds support for the simplest possible flex layout (fixed size, no-wrap, no-reversed etc).

* layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntegration):

Canonical link: https://commits.webkit.org/250564@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed May 14, 2022
1 parent e0cd946 commit 6bbc4f5cbd9df232a3e48d1f28c0b6257b7377ee
Showing 2 changed files with 22 additions and 1 deletion.
@@ -1,3 +1,15 @@
2022-05-14 Alan Bujtas <zalan@apple.com>

[FFC][Integration] Add "fixed sized/all default value" flex layout
https://bugs.webkit.org/show_bug.cgi?id=240414

Reviewed by Antti Koivisto.

This patch adds support for the simplest possible flex layout (fixed size, no-wrap, no-reversed etc).

* layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntegration):

2022-05-14 Kimmo Kinnunen <kkinnunen@apple.com>

WebCore::IOSurface refers to unused context size
@@ -118,8 +118,17 @@ void FlexFormattingContext::computeIntrinsicWidthConstraintsForFlexItems()
}
}

void FlexFormattingContext::layoutInFlowContentForIntegration(const ConstraintsForInFlowContent&)
void FlexFormattingContext::layoutInFlowContentForIntegration(const ConstraintsForInFlowContent& constraints)
{
auto& formattingState = this->formattingState();
auto mainAxisPosition = constraints.horizontal().logicalLeft;
auto crossAxisPosition = constraints.logicalTop();
for (auto& flexItem : childrenOfType<ContainerBox>(root())) {
auto& flexItemGeometry = formattingState.boxGeometry(flexItem);

flexItemGeometry.setLogicalTopLeft({ mainAxisPosition, crossAxisPosition });
mainAxisPosition = BoxGeometry::borderBoxRect(flexItemGeometry).right();
}
}

IntrinsicWidthConstraints FlexFormattingContext::computedIntrinsicWidthConstraintsForIntegration()

0 comments on commit 6bbc4f5

Please sign in to comment.