Title: [293233] trunk/Source
Revision
293233
Author
za...@apple.com
Date
2022-04-22 11:25:20 -0700 (Fri, 22 Apr 2022)

Log Message

[LFC][Integration] Add FlexFormattingContextIntegrationEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=239654

Reviewed by Antti Koivisto.

Source/WebCore:

This is in preparation for supporting flex formatting context through integration.

* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForFlexLayout):
* layout/integration/LayoutIntegrationCoverage.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::layoutUsingFlexFormattingContext):
* rendering/RenderFlexibleBox.h:

Source/WTF:

* Scripts/Preferences/WebPreferencesInternal.yaml:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (293232 => 293233)


--- trunk/Source/WTF/ChangeLog	2022-04-22 18:02:38 UTC (rev 293232)
+++ trunk/Source/WTF/ChangeLog	2022-04-22 18:25:20 UTC (rev 293233)
@@ -1,3 +1,12 @@
+2022-04-22  Alan Bujtas  <za...@apple.com>
+
+        [LFC][Integration] Add FlexFormattingContextIntegrationEnabled setting
+        https://bugs.webkit.org/show_bug.cgi?id=239654
+
+        Reviewed by Antti Koivisto.
+
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2022-04-20  Yusuke Suzuki  <ysuz...@apple.com>
 
         [WTF] Add string concatenate adapter for UUID

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (293232 => 293233)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2022-04-22 18:02:38 UTC (rev 293232)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2022-04-22 18:25:20 UTC (rev 293233)
@@ -303,6 +303,19 @@
     WebKit:
       default: true
 
+FlexFormattingContextIntegrationEnabled:
+  type: bool
+  humanReadableName: "Next-generation flex layout integration (FFC)"
+  humanReadableDescription: "Enable next-generation flex layout integration (FFC)"
+  condition: ENABLE(LAYOUT_FORMATTING_CONTEXT)
+  defaultValue:
+    WebKitLegacy:
+      default: false
+    WebKit:
+      default: false
+    WebCore:
+      default: false
+
 # FIXME: This should be reconciled with 'FrameFlattening' in WebPreferences.yaml .
 FrameFlatteningEnabled:
   type: bool

Modified: trunk/Source/WebCore/ChangeLog (293232 => 293233)


--- trunk/Source/WebCore/ChangeLog	2022-04-22 18:02:38 UTC (rev 293232)
+++ trunk/Source/WebCore/ChangeLog	2022-04-22 18:25:20 UTC (rev 293233)
@@ -1,3 +1,20 @@
+2022-04-22  Alan Bujtas  <za...@apple.com>
+
+        [LFC][Integration] Add FlexFormattingContextIntegrationEnabled setting
+        https://bugs.webkit.org/show_bug.cgi?id=239654
+
+        Reviewed by Antti Koivisto.
+
+        This is in preparation for supporting flex formatting context through integration.
+
+        * layout/integration/LayoutIntegrationCoverage.cpp:
+        (WebCore::LayoutIntegration::canUseForFlexLayout):
+        * layout/integration/LayoutIntegrationCoverage.h:
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::layoutFlexItems):
+        (WebCore::RenderFlexibleBox::layoutUsingFlexFormattingContext):
+        * rendering/RenderFlexibleBox.h:
+
 2022-04-22  Brandon Stewart  <brandonstew...@apple.com>
 
         Store StyleScope during CSSStyleSheet Creation

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (293232 => 293233)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2022-04-22 18:02:38 UTC (rev 293232)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2022-04-22 18:25:20 UTC (rev 293233)
@@ -674,7 +674,15 @@
     return canUseForRenderInlineChild(renderer, IncludeReasons::First).isEmpty();
 }
 
+bool canUseForFlexLayout(const RenderFlexibleBox& flexBox)
+{
+    if (!flexBox.document().settings().flexFormattingContextIntegrationEnabled())
+        return false;
+    ASSERT_NOT_IMPLEMENTED_YET();
+    return false;
 }
+
 }
+}
 
 #endif

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h (293232 => 293233)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h	2022-04-22 18:02:38 UTC (rev 293232)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.h	2022-04-22 18:25:20 UTC (rev 293233)
@@ -33,6 +33,7 @@
 namespace WebCore {
 
 class RenderBlockFlow;
+class RenderFlexibleBox;
 class RenderInline;
 
 namespace LayoutIntegration {
@@ -107,6 +108,8 @@
 bool canUseForLineLayoutAfterStyleChange(const RenderBlockFlow&, StyleDifference);
 bool canUseForLineLayoutAfterInlineBoxStyleChange(const RenderInline&, StyleDifference);
 
+bool canUseForFlexLayout(const RenderFlexibleBox&);
+
 enum class IncludeReasons { First , All };
 OptionSet<AvoidanceReason> canUseForLineLayoutWithReason(const RenderBlockFlow&, IncludeReasons);
 

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (293232 => 293233)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2022-04-22 18:02:38 UTC (rev 293232)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2022-04-22 18:25:20 UTC (rev 293233)
@@ -34,6 +34,7 @@
 #include "FlexibleBoxAlgorithm.h"
 #include "HitTestResult.h"
 #include "InspectorInstrumentation.h"
+#include "LayoutIntegrationCoverage.h"
 #include "LayoutRepainter.h"
 #include "RenderChildIterator.h"
 #include "RenderLayer.h"
@@ -1122,6 +1123,10 @@
 
 void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren)
 {
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+    if (LayoutIntegration::canUseForFlexLayout(*this))
+        return layoutUsingFlexFormattingContext();
+#endif
     Vector<LineContext> lineContexts;
     LayoutUnit sumFlexBaseSize;
     double totalFlexGrow;
@@ -2335,4 +2340,11 @@
     auto availableSize = usesRowGap ? availableLogicalHeightForPercentageComputation().value_or(0_lu) : contentLogicalWidth();
     return minimumValueForLength(gapLength.length(), availableSize);
 }
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+void RenderFlexibleBox::layoutUsingFlexFormattingContext()
+{
 }
+#endif
+
+}

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.h (293232 => 293233)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.h	2022-04-22 18:02:38 UTC (rev 293232)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.h	2022-04-22 18:25:20 UTC (rev 293233)
@@ -208,6 +208,10 @@
 
     void resetHasDefiniteHeight() { m_hasDefiniteHeight = SizeDefiniteness::Unknown; }
 
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+    void layoutUsingFlexFormattingContext();
+#endif
+
     // This is used to cache the preferred size for orthogonal flow children so we
     // don't have to relayout to get it
     HashMap<const RenderBox*, LayoutUnit> m_intrinsicSizeAlongMainAxis;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to