Title: [267418] trunk/Source/WebCore
Revision
267418
Author
[email protected]
Date
2020-09-22 10:33:21 -0700 (Tue, 22 Sep 2020)

Log Message

[LFC] FormattingState should never be copied.
https://bugs.webkit.org/show_bug.cgi?id=216833

Reviewed by Antti Koivisto.

Even when running a throw-away layout, we should not copy the state object but instead generate a new one for the subtree.
These objects should never be copied in general.

* layout/FormattingState.h:
* layout/LayoutState.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (267417 => 267418)


--- trunk/Source/WebCore/ChangeLog	2020-09-22 16:53:31 UTC (rev 267417)
+++ trunk/Source/WebCore/ChangeLog	2020-09-22 17:33:21 UTC (rev 267418)
@@ -1,3 +1,18 @@
+2020-09-22  Zalan Bujtas  <[email protected]>
+
+        [LFC] FormattingState should never be copied.
+        https://bugs.webkit.org/show_bug.cgi?id=216833
+
+        Reviewed by Antti Koivisto.
+
+        Even when running a throw-away layout, we should not copy the state object but instead generate a new one for the subtree.
+        These objects should never be copied in general.
+
+        * layout/FormattingState.h:
+        * layout/LayoutState.h:
+        * layout/tableformatting/TableFormattingContextGeometry.cpp:
+        (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):
+
 2020-09-22  Youenn Fablet  <[email protected]>
 
         Implement a default prompt for getUserMedia

Modified: trunk/Source/WebCore/layout/FormattingState.h (267417 => 267418)


--- trunk/Source/WebCore/layout/FormattingState.h	2020-09-22 16:53:31 UTC (rev 267417)
+++ trunk/Source/WebCore/layout/FormattingState.h	2020-09-22 17:33:21 UTC (rev 267418)
@@ -40,6 +40,7 @@
 enum class StyleDiff;
 
 class FormattingState {
+    WTF_MAKE_NONCOPYABLE(FormattingState);
     WTF_MAKE_ISO_ALLOCATED(FormattingState);
 public:
     FloatingState& floatingState() const { return m_floatingState; }

Modified: trunk/Source/WebCore/layout/LayoutState.h (267417 => 267418)


--- trunk/Source/WebCore/layout/LayoutState.h	2020-09-22 16:53:31 UTC (rev 267417)
+++ trunk/Source/WebCore/layout/LayoutState.h	2020-09-22 17:33:21 UTC (rev 267418)
@@ -46,6 +46,7 @@
 class TableFormattingState;
 
 class LayoutState : public CanMakeWeakPtr<LayoutState> {
+    WTF_MAKE_NONCOPYABLE(LayoutState);
     WTF_MAKE_ISO_ALLOCATED(LayoutState);
 public:
     LayoutState(const Document&, const ContainerBox& rootContainer);

Modified: trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp (267417 => 267418)


--- trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp	2020-09-22 16:53:31 UTC (rev 267417)
+++ trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp	2020-09-22 17:33:21 UTC (rev 267418)
@@ -149,7 +149,7 @@
         return layoutState().establishedInlineFormattingState(cellBox).lines()[0].baseline();
     for (auto& cellDescendant : descendantsOfType<ContainerBox>(cellBox)) {
         if (cellDescendant.establishesInlineFormattingContext()) {
-            auto inlineFormattingStateForCell = layoutState().establishedInlineFormattingState(cellDescendant);
+            auto& inlineFormattingStateForCell = layoutState().establishedInlineFormattingState(cellDescendant);
             if (!inlineFormattingStateForCell.lines().isEmpty())
                 return inlineFormattingStateForCell.lines()[0].baseline();
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to