Title: [267142] trunk/Source/WebCore
Revision
267142
Author
za...@apple.com
Date
2020-09-16 07:05:50 -0700 (Wed, 16 Sep 2020)

Log Message

[LFC][FFC] Create a Layout::ContainerBox for flex container
https://bugs.webkit.org/show_bug.cgi?id=216598

Reviewed by Antti Koivisto.

A flex container establishes a flex formatting context.

* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::createFormattingContext):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutBox):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (267141 => 267142)


--- trunk/Source/WebCore/ChangeLog	2020-09-16 13:45:53 UTC (rev 267141)
+++ trunk/Source/WebCore/ChangeLog	2020-09-16 14:05:50 UTC (rev 267142)
@@ -1,3 +1,17 @@
+2020-09-16  Zalan Bujtas  <za...@apple.com>
+
+        [LFC][FFC] Create a Layout::ContainerBox for flex container
+        https://bugs.webkit.org/show_bug.cgi?id=216598
+
+        Reviewed by Antti Koivisto.
+
+        A flex container establishes a flex formatting context.
+
+        * layout/LayoutContext.cpp:
+        (WebCore::Layout::LayoutContext::createFormattingContext):
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::TreeBuilder::createLayoutBox):
+
 2020-09-16  Aditya Keerthi  <akeer...@apple.com>
 
         [Cocoa] Use OTF font features instead of AAT font features when possible

Modified: trunk/Source/WebCore/layout/LayoutContext.cpp (267141 => 267142)


--- trunk/Source/WebCore/layout/LayoutContext.cpp	2020-09-16 13:45:53 UTC (rev 267141)
+++ trunk/Source/WebCore/layout/LayoutContext.cpp	2020-09-16 14:05:50 UTC (rev 267142)
@@ -31,6 +31,8 @@
 #include "BlockFormattingContext.h"
 #include "BlockFormattingState.h"
 #include "DisplayPainter.h"
+#include "FlexFormattingContext.h"
+#include "FlexFormattingState.h"
 #include "InlineFormattingContext.h"
 #include "InlineFormattingState.h"
 #include "InvalidationContext.h"
@@ -129,6 +131,11 @@
         return makeUnique<BlockFormattingContext>(formattingContextRoot, blockFormattingState);
     }
 
+    if (formattingContextRoot.establishesFlexFormattingContext()) {
+        auto& flexFormattingState = layoutState.ensureFlexFormattingState(formattingContextRoot);
+        return makeUnique<FlexFormattingContext>(formattingContextRoot, flexFormattingState);
+    }
+
     if (formattingContextRoot.establishesTableFormattingContext()) {
         auto& tableFormattingState = layoutState.ensureTableFormattingState(formattingContextRoot);
         return makeUnique<TableFormattingContext>(formattingContextRoot, tableFormattingState);

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (267141 => 267142)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2020-09-16 13:45:53 UTC (rev 267141)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2020-09-16 14:05:50 UTC (rev 267142)
@@ -255,8 +255,10 @@
                     childLayoutBox = &createContainer(elementAttributes(renderer), WTFMove(clonedStyle));
                 } else
                     childLayoutBox = &createContainer(elementAttributes(renderer), WTFMove(clonedStyle));
-            } else if (displayType == DisplayType::Inline)
+            } else if (displayType == DisplayType::Flex)
                 childLayoutBox = &createContainer(elementAttributes(renderer), WTFMove(clonedStyle));
+            else if (displayType == DisplayType::Inline)
+                childLayoutBox = &createContainer(elementAttributes(renderer), WTFMove(clonedStyle));
             else if (displayType == DisplayType::InlineBlock)
                 childLayoutBox = &createContainer(elementAttributes(renderer), WTFMove(clonedStyle));
             else if (displayType == DisplayType::TableCaption || displayType == DisplayType::TableCell) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to