Title: [291169] trunk
Revision
291169
Author
[email protected]
Date
2022-03-11 08:44:43 -0800 (Fri, 11 Mar 2022)

Log Message

[IFC][Integration] Add support for inline table
https://bugs.webkit.org/show_bug.cgi?id=237498

Reviewed by Antti Koivisto.

Source/WebCore:

This patch enables inline tables for IFC
e.g.
<div>inline content with <table style="display: inline-table">table</table></div>

We treat the inline table as any other atomic inline level box with synthetic baseline.

* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::buildTree):
* layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::canUseForChild):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::updateInlineTableDimensions):
(WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
* layout/integration/LayoutIntegrationLineLayout.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutModernLines):

LayoutTests:

* platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (291168 => 291169)


--- trunk/LayoutTests/ChangeLog	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/LayoutTests/ChangeLog	2022-03-11 16:44:43 UTC (rev 291169)
@@ -1,3 +1,12 @@
+2022-03-11  Alan Bujtas  <[email protected]>
+
+        [IFC][Integration] Add support for inline table
+        https://bugs.webkit.org/show_bug.cgi?id=237498
+
+        Reviewed by Antti Koivisto.
+
+        * platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt:
+
 2022-03-11  Youenn Fablet  <[email protected]>
 
         Do capture video frame downsampling in GPUProcess

Modified: trunk/LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt (291168 => 291169)


--- trunk/LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/LayoutTests/platform/mac/fast/dynamic/insert-before-table-part-in-continuation-expected.txt	2022-03-11 16:44:43 UTC (rev 291169)
@@ -59,7 +59,7 @@
         RenderInline {SPAN} at (0,0) size 146x18
           RenderText {#text} at (0,0) size 41x18
             text run at (0,0) width 41: "Text..."
-          RenderInline {SPAN} at (0,0) size 1x18
+          RenderInline {SPAN} at (0,0) size 0x18
           RenderTable at (40,0) size 106x18
             RenderTableSection (anonymous) at (0,0) size 105x18
               RenderTableRow (anonymous) at (0,0) size 105x18
@@ -120,7 +120,7 @@
         RenderInline {SPAN} at (0,0) size 146x18
           RenderText {#text} at (0,0) size 41x18
             text run at (0,0) width 41: "Text..."
-          RenderInline {SPAN} at (0,0) size 1x18
+          RenderInline {SPAN} at (0,0) size 0x18
           RenderTable at (40,0) size 106x18
             RenderTableSection (anonymous) at (0,0) size 105x18
               RenderTableRow {DIV} at (0,0) size 105x18
@@ -183,7 +183,7 @@
         RenderInline {SPAN} at (0,0) size 146x18
           RenderText {#text} at (0,0) size 41x18
             text run at (0,0) width 41: "Text..."
-          RenderInline {SPAN} at (0,0) size 1x18
+          RenderInline {SPAN} at (0,0) size 0x18
           RenderTable at (40,0) size 106x18
             RenderTableSection {DIV} at (0,0) size 105x18
               RenderTableRow (anonymous) at (0,0) size 105x18

Modified: trunk/Source/WebCore/ChangeLog (291168 => 291169)


--- trunk/Source/WebCore/ChangeLog	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/Source/WebCore/ChangeLog	2022-03-11 16:44:43 UTC (rev 291169)
@@ -1,3 +1,27 @@
+2022-03-11  Alan Bujtas  <[email protected]>
+
+        [IFC][Integration] Add support for inline table
+        https://bugs.webkit.org/show_bug.cgi?id=237498
+
+        Reviewed by Antti Koivisto.
+
+        This patch enables inline tables for IFC
+        e.g.
+        <div>inline content with <table style="display: inline-table">table</table></div>
+
+        We treat the inline table as any other atomic inline level box with synthetic baseline. 
+
+        * layout/integration/LayoutIntegrationBoxTree.cpp:
+        (WebCore::LayoutIntegration::BoxTree::buildTree):
+        * layout/integration/LayoutIntegrationCoverage.cpp:
+        (WebCore::LayoutIntegration::canUseForChild):
+        * layout/integration/LayoutIntegrationLineLayout.cpp:
+        (WebCore::LayoutIntegration::LineLayout::updateInlineTableDimensions):
+        (WebCore::LayoutIntegration::LineLayout::updateLayoutBoxDimensions):
+        * layout/integration/LayoutIntegrationLineLayout.h:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::layoutModernLines):
+
 2022-03-11  Youenn Fablet  <[email protected]>
 
         Do capture video frame downsampling in GPUProcess

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp (291168 => 291169)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp	2022-03-11 16:44:43 UTC (rev 291169)
@@ -40,6 +40,7 @@
 #include "RenderLineBreak.h"
 #include "RenderListItem.h"
 #include "RenderListMarker.h"
+#include "RenderTable.h"
 #include "TextUtil.h"
 
 #if ENABLE(TREE_DEBUGGING)
@@ -124,7 +125,7 @@
 
         if (is<RenderBlock>(childRenderer)) {
             auto attributes = Layout::Box::ElementAttributes { Layout::Box::ElementType::IntegrationInlineBlock };
-            if (is<RenderDetailsMarker>(childRenderer) || is<RenderListItem>(childRenderer))
+            if (is<RenderTable>(childRenderer) || is<RenderDetailsMarker>(childRenderer) || is<RenderListItem>(childRenderer))
                 attributes = Layout::Box::ElementAttributes { Layout::Box::ElementType::GenericElement };
             return makeUnique<Layout::ReplacedBox>(attributes, WTFMove(style), WTFMove(firstLineStyle));
         }

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp (291168 => 291169)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationCoverage.cpp	2022-03-11 16:44:43 UTC (rev 291169)
@@ -38,6 +38,7 @@
 #include "RenderListItem.h"
 #include "RenderListMarker.h"
 #include "RenderMultiColumnFlow.h"
+#include "RenderTable.h"
 #include "RenderTextControl.h"
 #include "RenderView.h"
 #include "RuntimeEnabledFeatures.h"
@@ -511,6 +512,13 @@
     if (is<RenderListMarker>(child) && is<RenderListItem>(child.parent()) && !is<RenderListMarker>(child.nextSibling()))
         return reasons;
 
+    if (is<RenderTable>(child)) {
+        auto& table = downcast<RenderTable>(child);
+        if (!table.isInline() || table.isPositioned() || !table.style().isHorizontalWritingMode())
+            SET_REASON_AND_RETURN_IF_NEEDED(ChildBoxIsFloatingOrPositioned, reasons, includeReasons)
+        return reasons;
+    }
+
     if (is<RenderBlockFlow>(child)) {
         auto& block = downcast<RenderBlockFlow>(child);
         if (!block.isReplacedOrInlineBlock() || !block.isInline())

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (291168 => 291169)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2022-03-11 16:44:43 UTC (rev 291169)
@@ -57,6 +57,7 @@
 #include "RenderListItem.h"
 #include "RenderListMarker.h"
 #include "RenderSlider.h"
+#include "RenderTable.h"
 #include "RenderTextControlMultiLine.h"
 #include "RenderTheme.h"
 #include "RenderView.h"
@@ -156,6 +157,11 @@
     updateLayoutBoxDimensions(inlineBlock);
 }
 
+void LineLayout::updateInlineTableDimensions(const RenderTable& inlineTable)
+{
+    updateLayoutBoxDimensions(inlineTable);
+}
+
 void LineLayout::updateListItemDimensions(const RenderListItem& listItem)
 {
     updateLayoutBoxDimensions(listItem);
@@ -290,6 +296,7 @@
             || is<RenderListBox>(replacedOrInlineBlock)
             || is<RenderSlider>(replacedOrInlineBlock)
             || is<RenderTextControlMultiLine>(replacedOrInlineBlock)
+            || is<RenderTable>(replacedOrInlineBlock)
 #if ENABLE(ATTACHMENT_ELEMENT)
             || is<RenderAttachment>(replacedOrInlineBlock)
 #endif

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h (291168 => 291169)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.h	2022-03-11 16:44:43 UTC (rev 291169)
@@ -50,6 +50,7 @@
 class RenderLineBreak;
 class RenderListItem;
 class RenderListMarker;
+class RenderTable;
 struct PaintInfo;
 
 namespace Layout {
@@ -82,6 +83,7 @@
     void updateInlineBlockDimensions(const RenderBlock&);
     void updateLineBreakBoxDimensions(const RenderLineBreak&);
     void updateInlineBoxDimensions(const RenderInline&);
+    void updateInlineTableDimensions(const RenderTable&);
     void updateListItemDimensions(const RenderListItem&);
     void updateListMarkerDimensions(const RenderListMarker&);
     void updateStyle(const RenderBoxModelObject&, const RenderStyle& oldStyle);

Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (291168 => 291169)


--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2022-03-11 16:05:37 UTC (rev 291168)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp	2022-03-11 16:44:43 UTC (rev 291169)
@@ -3599,6 +3599,12 @@
             layoutFormattingContextLineLayout.updateReplacedDimensions(replaced);
             continue;
         }
+        if (is<RenderTable>(renderer)) {
+            auto& inlineTable = downcast<RenderTable>(renderer);
+            inlineTable.layoutIfNeeded();
+            layoutFormattingContextLineLayout.updateInlineTableDimensions(inlineTable);
+            continue;
+        }
         if (is<RenderListMarker>(renderer)) {
             auto& marker = downcast<RenderListMarker>(renderer);
             marker.layoutIfNeeded();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to