Changeset 275494 in webkit


Ignore:
Timestamp:
Apr 6, 2021 1:37:33 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Move synthesizedBaselineFromBorderBox to RenderBox
https://bugs.webkit.org/show_bug.cgi?id=224186

Patch by Rob Buis <rbuis@igalia.com> on 2021-04-06
Reviewed by Javier Fernandez.

Move synthesizedBaselineFromBorderBox to RenderBox since there are
various call sites using it.

  • rendering/RenderBlockFlow.cpp:

(WebCore::RenderBlockFlow::inlineBlockBaseline const):

  • rendering/RenderBox.cpp:

(WebCore::synthesizedBaselineFromBorderBox):

  • rendering/RenderBox.h:
  • rendering/RenderFlexibleBox.cpp:

(WebCore::synthesizedBaselineFromBorderBox): Deleted.

  • rendering/RenderGrid.cpp:

(WebCore::synthesizedBaselineFromBorderBox): Deleted.

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275488 r275494  
     12021-04-06  Rob Buis  <rbuis@igalia.com>
     2
     3        Move synthesizedBaselineFromBorderBox to RenderBox
     4        https://bugs.webkit.org/show_bug.cgi?id=224186
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Move synthesizedBaselineFromBorderBox to RenderBox since there are
     9        various call sites using it.
     10
     11        * rendering/RenderBlockFlow.cpp:
     12        (WebCore::RenderBlockFlow::inlineBlockBaseline const):
     13        * rendering/RenderBox.cpp:
     14        (WebCore::synthesizedBaselineFromBorderBox):
     15        * rendering/RenderBox.h:
     16        * rendering/RenderFlexibleBox.cpp:
     17        (WebCore::synthesizedBaselineFromBorderBox): Deleted.
     18        * rendering/RenderGrid.cpp:
     19        (WebCore::synthesizedBaselineFromBorderBox): Deleted.
     20
    1212021-04-05  Simon Fraser  <simon.fraser@apple.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlockFlow.cpp

    r275413 r275494  
    31423142    }
    31433143    // Note that here we only take the left and bottom into consideration. Our caller takes the right and top into consideration.
    3144     float boxHeight = lineDirection == HorizontalLine ? height() + m_marginBox.bottom() : width() + m_marginBox.left();
     3144    float boxHeight = synthesizedBaselineFromBorderBox(*this, lineDirection) + (lineDirection == HorizontalLine ? m_marginBox.bottom() : m_marginBox.left());
    31453145    float lastBaseline = 0;
    31463146    if (!childrenInline()) {
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r275462 r275494  
    52385238}
    52395239
     5240LayoutUnit synthesizedBaselineFromBorderBox(const RenderBox& box, LineDirectionMode direction)
     5241{
     5242    return direction == HorizontalLine ? box.height() : box.width();
     5243}
     5244
    52405245} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderBox.h

    r275462 r275494  
    852852}
    853853
     854LayoutUnit synthesizedBaselineFromBorderBox(const RenderBox&, LineDirectionMode);
     855
    854856} // namespace WebCore
    855857
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r275413 r275494  
    143143    maxLogicalWidth += scrollbarWidth;
    144144    minLogicalWidth += scrollbarWidth;
    145 }
    146 
    147 static LayoutUnit synthesizedBaselineFromBorderBox(const RenderBox& box, LineDirectionMode direction)
    148 {
    149     return direction == HorizontalLine ? box.size().height() : box.size().width();
    150145}
    151146
  • trunk/Source/WebCore/rendering/RenderGrid.cpp

    r275413 r275494  
    12311231        child.setMarginAfter(availableAlignmentSpace, &parentStyle);
    12321232    }
    1233 }
    1234 
    1235 // FIXME: This logic could be refactored somehow and defined in RenderBox.
    1236 static LayoutUnit synthesizedBaselineFromBorderBox(const RenderBox& box, LineDirectionMode direction)
    1237 {
    1238     return (direction == HorizontalLine ? box.size().height() : box.size().width()).toInt();
    12391233}
    12401234
Note: See TracChangeset for help on using the changeset viewer.