⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 267418 in webkit


Ignore:
Timestamp:
Sep 22, 2020, 10:33:21 AM (6 years ago)
Author:
Alan Bujtas
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):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r267414 r267418  
     12020-09-22  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] FormattingState should never be copied.
     4        https://bugs.webkit.org/show_bug.cgi?id=216833
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Even when running a throw-away layout, we should not copy the state object but instead generate a new one for the subtree.
     9        These objects should never be copied in general.
     10
     11        * layout/FormattingState.h:
     12        * layout/LayoutState.h:
     13        * layout/tableformatting/TableFormattingContextGeometry.cpp:
     14        (WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):
     15
    1162020-09-22  Youenn Fablet  <youenn@apple.com>
    217
  • trunk/Source/WebCore/layout/FormattingState.h

    r267076 r267418  
    4141
    4242class FormattingState {
     43    WTF_MAKE_NONCOPYABLE(FormattingState);
    4344    WTF_MAKE_ISO_ALLOCATED(FormattingState);
    4445public:
  • trunk/Source/WebCore/layout/LayoutState.h

    r267076 r267418  
    4747
    4848class LayoutState : public CanMakeWeakPtr<LayoutState> {
     49    WTF_MAKE_NONCOPYABLE(LayoutState);
    4950    WTF_MAKE_ISO_ALLOCATED(LayoutState);
    5051public:
  • trunk/Source/WebCore/layout/tableformatting/TableFormattingContextGeometry.cpp

    r267308 r267418  
    150150    for (auto& cellDescendant : descendantsOfType<ContainerBox>(cellBox)) {
    151151        if (cellDescendant.establishesInlineFormattingContext()) {
    152             auto inlineFormattingStateForCell = layoutState().establishedInlineFormattingState(cellDescendant);
     152            auto& inlineFormattingStateForCell = layoutState().establishedInlineFormattingState(cellDescendant);
    153153            if (!inlineFormattingStateForCell.lines().isEmpty())
    154154                return inlineFormattingStateForCell.lines()[0].baseline();
Note: See TracChangeset for help on using the changeset viewer.