Changeset 275594 in webkit


Ignore:
Timestamp:
Apr 7, 2021 2:03:08 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

Make synthesizedBaselineFromContentBox return LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=224234

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

Make synthesizedBaselineFromContentBox return LayoutUnit. This
makes it consistent with synthesizedBaselineFromBorderBox.

  • rendering/RenderButton.cpp:

(WebCore::synthesizedBaselineFromContentBox):
(WebCore::RenderButton::baselinePosition const):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r275593 r275594  
     12021-04-07  Rob Buis  <rbuis@igalia.com>
     2
     3        Make synthesizedBaselineFromContentBox return LayoutUnit
     4        https://bugs.webkit.org/show_bug.cgi?id=224234
     5
     6        Reviewed by Javier Fernandez.
     7
     8        Make synthesizedBaselineFromContentBox return LayoutUnit. This
     9        makes it consistent with synthesizedBaselineFromBorderBox.
     10
     11        * rendering/RenderButton.cpp:
     12        (WebCore::synthesizedBaselineFromContentBox):
     13        (WebCore::RenderButton::baselinePosition const):
     14
    1152021-04-07  Alejandro G. Castro  <alex@igalia.com>
    216
  • trunk/Source/WebCore/rendering/RenderButton.cpp

    r275413 r275594  
    144144}
    145145
    146 static int synthesizedBaselineFromContentBox(const RenderBox& box, LineDirectionMode direction)
     146static LayoutUnit synthesizedBaselineFromContentBox(const RenderBox& box, LineDirectionMode direction)
    147147{
    148148    return direction == HorizontalLine ? box.borderTop() + box.paddingTop() + box.contentHeight() : box.borderRight() + box.paddingRight() + box.contentWidth();
     
    153153    // We cannot rely on RenderFlexibleBox::baselinePosition() because of flexboxes have some special behavior
    154154    // regarding baselines that shouldn't apply to buttons.
    155     int baseline = firstLineBaseline().valueOr(synthesizedBaselineFromContentBox(*this, direction));
    156     int marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
     155    LayoutUnit baseline = firstLineBaseline().valueOr(synthesizedBaselineFromContentBox(*this, direction));
     156    LayoutUnit marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
    157157    return baseline + marginAscent;
    158158}
Note: See TracChangeset for help on using the changeset viewer.