Title: [277550] trunk/Source/WebCore
Revision
277550
Author
[email protected]
Date
2021-05-15 16:03:02 -0700 (Sat, 15 May 2021)

Log Message

[LFC] Move flex formatting geometry to its own class
https://bugs.webkit.org/show_bug.cgi?id=225755

Reviewed by Antti Koivisto.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::geometry const):
* layout/formattingContexts/flex/FlexFormattingContext.h:
(WebCore::Layout::FlexFormattingContext::Geometry::Geometry): Deleted.
* layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (277549 => 277550)


--- trunk/Source/WebCore/ChangeLog	2021-05-15 22:30:39 UTC (rev 277549)
+++ trunk/Source/WebCore/ChangeLog	2021-05-15 23:03:02 UTC (rev 277550)
@@ -1,5 +1,20 @@
 2021-05-15  Alan Bujtas  <[email protected]>
 
+        [LFC] Move flex formatting geometry to its own class
+        https://bugs.webkit.org/show_bug.cgi?id=225755
+
+        Reviewed by Antti Koivisto.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * layout/formattingContexts/flex/FlexFormattingContext.cpp:
+        (WebCore::Layout::FlexFormattingContext::geometry const):
+        * layout/formattingContexts/flex/FlexFormattingContext.h:
+        (WebCore::Layout::FlexFormattingContext::Geometry::Geometry): Deleted.
+        * layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp: Removed.
+
+2021-05-15  Alan Bujtas  <[email protected]>
+
         [LFC] Move block formatting geometry to its own class
         https://bugs.webkit.org/show_bug.cgi?id=225756
 

Modified: trunk/Source/WebCore/Sources.txt (277549 => 277550)


--- trunk/Source/WebCore/Sources.txt	2021-05-15 22:30:39 UTC (rev 277549)
+++ trunk/Source/WebCore/Sources.txt	2021-05-15 23:03:02 UTC (rev 277550)
@@ -1527,7 +1527,7 @@
 layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp
 layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.cpp
 layout/formattingContexts/flex/FlexFormattingContext.cpp
-layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp
+layout/formattingContexts/flex/FlexFormattingGeometry.cpp
 layout/formattingContexts/flex/FlexFormattingState.cpp
 layout/floats/FloatAvoider.cpp
 layout/floats/FloatingContext.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (277549 => 277550)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-05-15 22:30:39 UTC (rev 277549)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-05-15 23:03:02 UTC (rev 277550)
@@ -2168,6 +2168,7 @@
 		6FE198172178397C00446F08 /* InlineContentBreaker.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE198152178397C00446F08 /* InlineContentBreaker.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FE636E82647962900F0951E /* InlineFormattingQuirks.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE636E72647962900F0951E /* InlineFormattingQuirks.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FE7CFA22177EEF2005B1573 /* InlineItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FE7CFA02177EEF1005B1573 /* InlineItem.h */; };
+		6FF911F726487FC8002021DF /* FlexFormattingGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FF911F626487FC8002021DF /* FlexFormattingGeometry.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FFA4C0123F2FED9007E4EBC /* LayoutLineBreakBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FFA4C0023F2FED9007E4EBC /* LayoutLineBreakBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6FFDC442212EFF1700A9CA91 /* FloatAvoider.h in Headers */ = {isa = PBXBuildFile; fileRef = 6FFDC440212EFF1600A9CA91 /* FloatAvoider.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		709A01FE1E3D0BDD006B0D4C /* ModuleFetchFailureKind.h in Headers */ = {isa = PBXBuildFile; fileRef = 709A01FD1E3D0BCC006B0D4C /* ModuleFetchFailureKind.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -9976,7 +9977,7 @@
 		6F6638D4249E268B001925FC /* TableWrapperBlockFormattingQuirks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableWrapperBlockFormattingQuirks.cpp; sourceTree = "<group>"; };
 		6F69A79924D6FAB800E6B85D /* InlineLineBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineLineBox.cpp; sourceTree = "<group>"; };
 		6F6DF36E264722EA0093E834 /* BlockMarginCollapse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockMarginCollapse.h; sourceTree = "<group>"; };
-		6F70DEDD251126F300F0FC78 /* FlexFormattingContextGeometry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FlexFormattingContextGeometry.cpp; sourceTree = "<group>"; };
+		6F70DEDD251126F300F0FC78 /* FlexFormattingGeometry.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FlexFormattingGeometry.cpp; sourceTree = "<group>"; };
 		6F73918C2106CEDD006AF262 /* LayoutUnits.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutUnits.h; sourceTree = "<group>"; };
 		6F7B8CEC23626E6600C9FF15 /* InlineItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineItem.cpp; sourceTree = "<group>"; };
 		6F7CA3C4208C2956002F29AB /* LayoutState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutState.h; sourceTree = "<group>"; };
@@ -10043,6 +10044,7 @@
 		6FE8E6F8237BA6B200758D26 /* InvalidationState.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InvalidationState.cpp; sourceTree = "<group>"; };
 		6FE9F09222211035004C5082 /* ContentChangeObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentChangeObserver.cpp; sourceTree = "<group>"; };
 		6FEFE81D22F9D22A00114927 /* LayoutPhase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LayoutPhase.h; sourceTree = "<group>"; };
+		6FF911F626487FC8002021DF /* FlexFormattingGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlexFormattingGeometry.h; sourceTree = "<group>"; };
 		6FF9F1BE246D966C00435083 /* TableLayout.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableLayout.cpp; sourceTree = "<group>"; };
 		6FFA4BFE23F2FECD007E4EBC /* LayoutLineBreakBox.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutLineBreakBox.cpp; sourceTree = "<group>"; };
 		6FFA4C0023F2FED9007E4EBC /* LayoutLineBreakBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutLineBreakBox.h; sourceTree = "<group>"; };
@@ -22661,7 +22663,8 @@
 			children = (
 				6FB7D2D7250FD7E5000207AA /* FlexFormattingContext.cpp */,
 				6FB7D2D9250FD7FC000207AA /* FlexFormattingContext.h */,
-				6F70DEDD251126F300F0FC78 /* FlexFormattingContextGeometry.cpp */,
+				6F70DEDD251126F300F0FC78 /* FlexFormattingGeometry.cpp */,
+				6FF911F626487FC8002021DF /* FlexFormattingGeometry.h */,
 				6FB7D2D8250FD7EF000207AA /* FlexFormattingState.cpp */,
 				6FB7D2DA250FD7FC000207AA /* FlexFormattingState.h */,
 			);
@@ -32491,6 +32494,7 @@
 				372C00D9129619F8005C9575 /* FindOptions.h in Headers */,
 				A8CFF04F0A154F09000A4234 /* FixedTableLayout.h in Headers */,
 				6FB7D2DD250FD828000207AA /* FlexFormattingContext.h in Headers */,
+				6FF911F726487FC8002021DF /* FlexFormattingGeometry.h in Headers */,
 				6FB7D2DE250FD82E000207AA /* FlexFormattingState.h in Headers */,
 				6FFDC442212EFF1700A9CA91 /* FloatAvoider.h in Headers */,
 				BC073BAA0C399B1F000F5979 /* FloatConversion.h in Headers */,

Modified: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp (277549 => 277550)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp	2021-05-15 22:30:39 UTC (rev 277549)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp	2021-05-15 23:03:02 UTC (rev 277550)
@@ -28,6 +28,7 @@
 
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
 
+#include "FlexFormattingGeometry.h"
 #include "FlexFormattingState.h"
 #include "InlineRect.h"
 #include "InvalidationState.h"
@@ -117,7 +118,12 @@
     }
 }
 
+FlexFormattingGeometry FlexFormattingContext::geometry() const
+{
+    return FlexFormattingGeometry(*this);
 }
+
 }
+}
 
 #endif

Modified: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h (277549 => 277550)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h	2021-05-15 22:30:39 UTC (rev 277549)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.h	2021-05-15 23:03:02 UTC (rev 277550)
@@ -34,6 +34,7 @@
 namespace WebCore {
 namespace Layout {
 
+class FlexFormattingGeometry;
 class InvalidationState;
 // This class implements the layout logic for flex formatting contexts.
 // https://www.w3.org/TR/css-flexbox-1/
@@ -47,18 +48,8 @@
     IntrinsicWidthConstraints computedIntrinsicWidthConstraints() override;
 
 private:
-    // This class implements positioning and sizing for flex items.
-    class Geometry : public FormattingContext::Geometry {
-    public:
-        Geometry(const FlexFormattingContext&);
+    FlexFormattingGeometry geometry() const;
 
-        IntrinsicWidthConstraints intrinsicWidthConstraints(const ContainerBox&);
-
-    private:
-        const FlexFormattingContext& formattingContext() const { return downcast<FlexFormattingContext>(FormattingContext::Geometry::formattingContext()); }
-    };
-    FlexFormattingContext::Geometry geometry() const { return Geometry(*this); }
-
     void sizeAndPlaceFlexItems(const ConstraintsForInFlowContent&);
     void computeIntrinsicWidthConstraintsForFlexItems();
 
@@ -66,13 +57,8 @@
     FlexFormattingState& formattingState() { return downcast<FlexFormattingState>(FormattingContext::formattingState()); }
 };
 
-inline FlexFormattingContext::Geometry::Geometry(const FlexFormattingContext& flexFormattingContext)
-    : FormattingContext::Geometry(flexFormattingContext)
-{
 }
-
 }
-}
 
 SPECIALIZE_TYPE_TRAITS_LAYOUT_FORMATTING_CONTEXT(FlexFormattingContext, isFlexFormattingContext())
 

Deleted: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp (277549 => 277550)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp	2021-05-15 22:30:39 UTC (rev 277549)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp	2021-05-15 23:03:02 UTC (rev 277550)
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FlexFormattingContext.h"
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "FlexFormattingState.h"
-#include "FormattingContext.h"
-#include "LayoutContext.h"
-
-namespace WebCore {
-namespace Layout {
-
-FormattingContext::IntrinsicWidthConstraints FlexFormattingContext::Geometry::intrinsicWidthConstraints(const ContainerBox& flexItem)
-{
-    auto fixedMarginBorderAndPadding = [&](auto& layoutBox) {
-        auto& style = layoutBox.style();
-        return fixedValue(style.marginStart()).valueOr(0)
-            + LayoutUnit { style.borderLeftWidth() }
-            + fixedValue(style.paddingLeft()).valueOr(0)
-            + fixedValue(style.paddingRight()).valueOr(0)
-            + LayoutUnit { style.borderRightWidth() }
-            + fixedValue(style.marginEnd()).valueOr(0);
-    };
-
-    auto computedIntrinsicWidthConstraints = [&]() -> IntrinsicWidthConstraints {
-        auto logicalWidth = flexItem.style().logicalWidth();
-        // Minimum/maximum width can't be depending on the containing block's width.
-        auto needsResolvedContainingBlockWidth = logicalWidth.isCalculated() || logicalWidth.isPercent() || logicalWidth.isRelative();
-        if (needsResolvedContainingBlockWidth)
-            return { };
-
-        if (auto width = fixedValue(logicalWidth))
-            return { *width, *width };
-
-        ASSERT(flexItem.establishesFormattingContext());
-        auto intrinsicWidthConstraints = LayoutContext::createFormattingContext(flexItem, layoutState())->computedIntrinsicWidthConstraints();
-        if (logicalWidth.isMinContent())
-            return { intrinsicWidthConstraints.minimum, intrinsicWidthConstraints.minimum };
-        if (logicalWidth.isMaxContent())
-            return { intrinsicWidthConstraints.maximum, intrinsicWidthConstraints.maximum };
-        return intrinsicWidthConstraints;
-    };
-    auto intrinsicWidthConstraints = constrainByMinMaxWidth(flexItem, computedIntrinsicWidthConstraints());
-    intrinsicWidthConstraints.expand(fixedMarginBorderAndPadding(flexItem));
-    return intrinsicWidthConstraints;
-}
-
-}
-}
-
-#endif

Copied: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingGeometry.cpp (from rev 277549, trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp) (0 => 277550)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingGeometry.cpp	                        (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingGeometry.cpp	2021-05-15 23:03:02 UTC (rev 277550)
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FlexFormattingGeometry.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "FlexFormattingState.h"
+#include "FormattingContext.h"
+#include "LayoutContext.h"
+
+namespace WebCore {
+namespace Layout {
+
+FlexFormattingGeometry::FlexFormattingGeometry(const FlexFormattingContext& flexFormattingContext)
+    : FormattingContext::Geometry(flexFormattingContext)
+{
+}
+
+FormattingContext::IntrinsicWidthConstraints FlexFormattingGeometry::intrinsicWidthConstraints(const ContainerBox& flexItem)
+{
+    auto fixedMarginBorderAndPadding = [&](auto& layoutBox) {
+        auto& style = layoutBox.style();
+        return fixedValue(style.marginStart()).valueOr(0)
+            + LayoutUnit { style.borderLeftWidth() }
+            + fixedValue(style.paddingLeft()).valueOr(0)
+            + fixedValue(style.paddingRight()).valueOr(0)
+            + LayoutUnit { style.borderRightWidth() }
+            + fixedValue(style.marginEnd()).valueOr(0);
+    };
+
+    auto computedIntrinsicWidthConstraints = [&]() -> FormattingContext::IntrinsicWidthConstraints {
+        auto logicalWidth = flexItem.style().logicalWidth();
+        // Minimum/maximum width can't be depending on the containing block's width.
+        auto needsResolvedContainingBlockWidth = logicalWidth.isCalculated() || logicalWidth.isPercent() || logicalWidth.isRelative();
+        if (needsResolvedContainingBlockWidth)
+            return { };
+
+        if (auto width = fixedValue(logicalWidth))
+            return { *width, *width };
+
+        ASSERT(flexItem.establishesFormattingContext());
+        auto intrinsicWidthConstraints = LayoutContext::createFormattingContext(flexItem, layoutState())->computedIntrinsicWidthConstraints();
+        if (logicalWidth.isMinContent())
+            return { intrinsicWidthConstraints.minimum, intrinsicWidthConstraints.minimum };
+        if (logicalWidth.isMaxContent())
+            return { intrinsicWidthConstraints.maximum, intrinsicWidthConstraints.maximum };
+        return intrinsicWidthConstraints;
+    };
+    auto intrinsicWidthConstraints = constrainByMinMaxWidth(flexItem, computedIntrinsicWidthConstraints());
+    intrinsicWidthConstraints.expand(fixedMarginBorderAndPadding(flexItem));
+    return intrinsicWidthConstraints;
+}
+
+}
+}
+
+#endif

Added: trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingGeometry.h (0 => 277550)


--- trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingGeometry.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/flex/FlexFormattingGeometry.h	2021-05-15 23:03:02 UTC (rev 277550)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "FlexFormattingState.h"
+#include "FormattingContext.h"
+#include <wtf/IsoMalloc.h>
+
+namespace WebCore {
+namespace Layout {
+
+// This class implements positioning and sizing for flex items.
+class FlexFormattingGeometry : public FormattingContext::Geometry {
+public:
+    FlexFormattingGeometry(const FlexFormattingContext&);
+
+    FormattingContext::IntrinsicWidthConstraints intrinsicWidthConstraints(const ContainerBox&);
+
+private:
+    const FlexFormattingContext& formattingContext() const { return downcast<FlexFormattingContext>(FormattingContext::Geometry::formattingContext()); }
+};
+
+}
+}
+
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to