Changeset 294198 in webkit


Ignore:
Timestamp:
May 14, 2022 9:56:07 AM (2 years ago)
Author:
Alan Bujtas
Message:

[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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r294197 r294198  
     12022-05-14  Alan Bujtas  <zalan@apple.com>
     2
     3        [FFC][Integration] Add "fixed sized/all default value" flex layout
     4        https://bugs.webkit.org/show_bug.cgi?id=240414
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This patch adds support for the simplest possible flex layout (fixed size, no-wrap, no-reversed etc).
     9
     10        * layout/formattingContexts/flex/FlexFormattingContext.cpp:
     11        (WebCore::Layout::FlexFormattingContext::layoutInFlowContentForIntegration):
     12
    1132022-05-14  Kimmo Kinnunen  <kkinnunen@apple.com>
    214
  • trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp

    r293303 r294198  
    119119}
    120120
    121 void FlexFormattingContext::layoutInFlowContentForIntegration(const ConstraintsForInFlowContent&)
     121void FlexFormattingContext::layoutInFlowContentForIntegration(const ConstraintsForInFlowContent& constraints)
    122122{
     123    auto& formattingState = this->formattingState();
     124    auto mainAxisPosition = constraints.horizontal().logicalLeft;
     125    auto crossAxisPosition = constraints.logicalTop();
     126    for (auto& flexItem : childrenOfType<ContainerBox>(root())) {
     127        auto& flexItemGeometry = formattingState.boxGeometry(flexItem);
     128
     129        flexItemGeometry.setLogicalTopLeft({ mainAxisPosition, crossAxisPosition });
     130        mainAxisPosition = BoxGeometry::borderBoxRect(flexItemGeometry).right();
     131    }
    123132}
    124133
Note: See TracChangeset for help on using the changeset viewer.