Title: [277544] trunk/Source/WebCore
Revision
277544
Author
[email protected]
Date
2021-05-15 11:27:43 -0700 (Sat, 15 May 2021)

Log Message

[LFC] Move table wrapper quirks to its own class
https://bugs.webkit.org/show_bug.cgi?id=225760

Reviewed by Antti Koivisto.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
(WebCore::Layout::TableWrapperBlockFormattingContext::quirks const):
* layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.h:
(WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::Quirks): Deleted.
* layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp: Removed.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (277543 => 277544)


--- trunk/Source/WebCore/ChangeLog	2021-05-15 17:51:24 UTC (rev 277543)
+++ trunk/Source/WebCore/ChangeLog	2021-05-15 18:27:43 UTC (rev 277544)
@@ -1,3 +1,18 @@
+2021-05-15  Alan Bujtas  <[email protected]>
+
+        [LFC] Move table wrapper quirks to its own class
+        https://bugs.webkit.org/show_bug.cgi?id=225760
+
+        Reviewed by Antti Koivisto.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp:
+        (WebCore::Layout::TableWrapperBlockFormattingContext::quirks const):
+        * layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.h:
+        (WebCore::Layout::TableWrapperBlockFormattingContext::Quirks::Quirks): Deleted.
+        * layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp: Removed.
+
 2021-05-15  Sam Weinig  <[email protected]>
 
         Move CanvasRenderingContext2DSettings down to CanvasRenderingContext2DBase so it can be used there (and to support OffscreenCanvas)

Modified: trunk/Source/WebCore/Sources.txt (277543 => 277544)


--- trunk/Source/WebCore/Sources.txt	2021-05-15 17:51:24 UTC (rev 277543)
+++ trunk/Source/WebCore/Sources.txt	2021-05-15 18:27:43 UTC (rev 277544)
@@ -1525,7 +1525,7 @@
 layout/formattingContexts/block/BlockMarginCollapse.cpp
 layout/formattingContexts/block/PrecomputedBlockMarginCollapse.cpp
 layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp
-layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp
+layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.cpp
 layout/formattingContexts/flex/FlexFormattingContext.cpp
 layout/formattingContexts/flex/FlexFormattingContextGeometry.cpp
 layout/formattingContexts/flex/FlexFormattingState.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (277543 => 277544)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-05-15 17:51:24 UTC (rev 277543)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-05-15 18:27:43 UTC (rev 277544)
@@ -2127,6 +2127,7 @@
 		6EE8A77310F803F3005A4A24 /* JSWebGLContextAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6EE8A77110F803F3005A4A24 /* JSWebGLContextAttributes.h */; };
 		6F0B98B523F268EC00EEC2F2 /* LayoutInlineTextBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0B98B323F268EB00EEC2F2 /* LayoutInlineTextBox.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F0CD695229ED32700C5994E /* InlineLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F0CD694229ED32700C5994E /* InlineLine.h */; };
+		6F15522126476B5C00E353C6 /* TableWrapperBlockFormattingQuirks.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F15522026476B5B00E353C6 /* TableWrapperBlockFormattingQuirks.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F17264F2470C60B00518C96 /* TableWrapperBlockFormattingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F17264E2470C60A00518C96 /* TableWrapperBlockFormattingContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F1CC1DE225F8B4900720AD2 /* InlineTextItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F1CC1DD225F8B4200720AD2 /* InlineTextItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		6F26BB6C23343E6F002F2BEA /* LayoutContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F26BB6B23343E5B002F2BEA /* LayoutContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -9946,6 +9947,7 @@
 		6F0CD692229ED31900C5994E /* InlineLine.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineLine.cpp; sourceTree = "<group>"; };
 		6F0CD694229ED32700C5994E /* InlineLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineLine.h; sourceTree = "<group>"; };
 		6F10B08622B8568D0090E69C /* InlineFormattingContextQuirks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineFormattingContextQuirks.cpp; sourceTree = "<group>"; };
+		6F15522026476B5B00E353C6 /* TableWrapperBlockFormattingQuirks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableWrapperBlockFormattingQuirks.h; sourceTree = "<group>"; };
 		6F17264C2470C5F700518C96 /* TableWrapperBlockFormattingContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableWrapperBlockFormattingContext.cpp; sourceTree = "<group>"; };
 		6F17264E2470C60A00518C96 /* TableWrapperBlockFormattingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableWrapperBlockFormattingContext.h; sourceTree = "<group>"; };
 		6F1CC1DC225F8B4100720AD2 /* InlineTextItem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InlineTextItem.cpp; sourceTree = "<group>"; };
@@ -9964,7 +9966,7 @@
 		6F4A5BD522F9F16B00A80F25 /* LayoutPhase.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutPhase.cpp; sourceTree = "<group>"; };
 		6F5B7EAA2300A79E0067D9C3 /* TableGrid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableGrid.cpp; sourceTree = "<group>"; };
 		6F6383F42427AF4900DABA53 /* LayoutInitialContainingBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutInitialContainingBlock.h; sourceTree = "<group>"; };
-		6F6638D4249E268B001925FC /* TableWrapperBlockFormattingContextQuirks.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TableWrapperBlockFormattingContextQuirks.cpp; sourceTree = "<group>"; };
+		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>"; };
@@ -22689,7 +22691,8 @@
 			children = (
 				6F17264C2470C5F700518C96 /* TableWrapperBlockFormattingContext.cpp */,
 				6F17264E2470C60A00518C96 /* TableWrapperBlockFormattingContext.h */,
-				6F6638D4249E268B001925FC /* TableWrapperBlockFormattingContextQuirks.cpp */,
+				6F6638D4249E268B001925FC /* TableWrapperBlockFormattingQuirks.cpp */,
+				6F15522026476B5B00E353C6 /* TableWrapperBlockFormattingQuirks.h */,
 			);
 			path = tablewrapper;
 			sourceTree = "<group>";
@@ -35441,6 +35444,7 @@
 				5D5975B319635F1100D00878 /* SystemVersion.h in Headers */,
 				A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
 				6F17264F2470C60B00518C96 /* TableWrapperBlockFormattingContext.h in Headers */,
+				6F15522126476B5C00E353C6 /* TableWrapperBlockFormattingQuirks.h in Headers */,
 				3BB6B81122A7D313003A2A69 /* TabSize.h in Headers */,
 				463EB6231B8789E00096ED51 /* TagCollection.h in Headers */,
 				9B0ABCAE236BB43100B45085 /* TaskSource.h in Headers */,

Modified: trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp (277543 => 277544)


--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp	2021-05-15 17:51:24 UTC (rev 277543)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.cpp	2021-05-15 18:27:43 UTC (rev 277544)
@@ -36,6 +36,7 @@
 #include "LayoutInitialContainingBlock.h"
 #include "TableFormattingContext.h"
 #include "TableFormattingState.h"
+#include "TableWrapperBlockFormattingQuirks.h"
 
 namespace WebCore {
 namespace Layout {
@@ -232,7 +233,12 @@
     updateMarginAfterForPreviousSibling(tableBox);
 }
 
+TableWrapperQuirks TableWrapperBlockFormattingContext::quirks() const
+{
+    return TableWrapperQuirks(*this);
 }
+
 }
+}
 
 #endif

Modified: trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.h (277543 => 277544)


--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.h	2021-05-15 17:51:24 UTC (rev 277543)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContext.h	2021-05-15 18:27:43 UTC (rev 277544)
@@ -34,6 +34,8 @@
 namespace WebCore {
 namespace Layout {
 
+class TableWrapperQuirks;
+
 // This class implements the special block formatting context layout logic for the table wrapper.
 // https://www.w3.org/TR/CSS22/tables.html#model
 class TableWrapperBlockFormattingContext final : public BlockFormattingContext {
@@ -46,14 +48,8 @@
     void setHorizontalConstraintsIgnoringFloats(const HorizontalConstraints& horizontalConstraints) { m_horizontalConstraintsIgnoringFloats = horizontalConstraints; }
 
 private:
-    class Quirks : public BlockFormattingQuirks {
-    public:
-        Quirks(const TableWrapperBlockFormattingContext&);
+    TableWrapperQuirks quirks() const;
 
-        Optional<LayoutUnit> overriddenTableHeight(const ContainerBox& tableBox) const;
-    };
-    TableWrapperBlockFormattingContext::Quirks quirks() const { return Quirks(*this); }
-
     void layoutTableBox(const ContainerBox& tableBox, const ConstraintsForInFlowContent&);
 
     void computeBorderAndPaddingForTableBox(const ContainerBox&, const HorizontalConstraints&);
@@ -64,13 +60,8 @@
     HorizontalConstraints m_horizontalConstraintsIgnoringFloats;
 };
 
-inline TableWrapperBlockFormattingContext::Quirks::Quirks(const TableWrapperBlockFormattingContext& formattingContext)
-    : BlockFormattingQuirks(formattingContext)
-{
 }
-
 }
-}
 
 SPECIALIZE_TYPE_TRAITS_LAYOUT_FORMATTING_CONTEXT(TableWrapperBlockFormattingContext, isTableWrapperBlockFormattingContext())
 

Deleted: trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp (277543 => 277544)


--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp	2021-05-15 17:51:24 UTC (rev 277543)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp	2021-05-15 18:27:43 UTC (rev 277544)
@@ -1,48 +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 "TableWrapperBlockFormattingContext.h"
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-
-#include "LayoutState.h"
-
-namespace WebCore {
-namespace Layout {
-
-Optional<LayoutUnit> TableWrapperBlockFormattingContext::Quirks::overriddenTableHeight(const ContainerBox& tableBox) const
-{
-    if (layoutState().inQuirksMode()) {
-        // In quirks mode always use the content height. Note that the tables with content take computed values into account.
-        return geometry().contentHeightForFormattingContextRoot(tableBox);
-    }
-    return tableBox.hasInFlowOrFloatingChild() ? geometry().contentHeightForFormattingContextRoot(tableBox) : Optional<LayoutUnit> { };
-}
-
-}
-}
-
-#endif

Copied: trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.cpp (from rev 277543, trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp) (0 => 277544)


--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.cpp	                        (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.cpp	2021-05-15 18:27:43 UTC (rev 277544)
@@ -0,0 +1,53 @@
+/*
+ * 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 "TableWrapperBlockFormattingQuirks.h"
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+
+#include "LayoutState.h"
+
+namespace WebCore {
+namespace Layout {
+
+TableWrapperQuirks::TableWrapperQuirks(const TableWrapperBlockFormattingContext& formattingContext)
+    : BlockFormattingQuirks(formattingContext)
+{
+}
+
+Optional<LayoutUnit> TableWrapperQuirks::overriddenTableHeight(const ContainerBox& tableBox) const
+{
+    if (layoutState().inQuirksMode()) {
+        // In quirks mode always use the content height. Note that the tables with content take computed values into account.
+        return geometry().contentHeightForFormattingContextRoot(tableBox);
+    }
+    return tableBox.hasInFlowOrFloatingChild() ? geometry().contentHeightForFormattingContextRoot(tableBox) : Optional<LayoutUnit> { };
+}
+
+}
+}
+
+#endif

Copied: trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.h (from rev 277543, trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingContextQuirks.cpp) (0 => 277544)


--- trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.h	                        (rev 0)
+++ trunk/Source/WebCore/layout/formattingContexts/block/tablewrapper/TableWrapperBlockFormattingQuirks.h	2021-05-15 18:27:43 UTC (rev 277544)
@@ -0,0 +1,45 @@
+/*
+ * 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 "BlockFormattingQuirks.h"
+
+namespace WebCore {
+namespace Layout {
+
+class TableWrapperQuirks : public BlockFormattingQuirks {
+public:
+    TableWrapperQuirks(const TableWrapperBlockFormattingContext&);
+
+    Optional<LayoutUnit> overriddenTableHeight(const ContainerBox& tableBox) const;
+};
+
+}
+}
+
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to