Title: [275594] trunk/Source/WebCore
Revision
275594
Author
[email protected]
Date
2021-04-07 02:03:08 -0700 (Wed, 07 Apr 2021)

Log Message

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

Patch by Rob Buis <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (275593 => 275594)


--- trunk/Source/WebCore/ChangeLog	2021-04-07 08:32:32 UTC (rev 275593)
+++ trunk/Source/WebCore/ChangeLog	2021-04-07 09:03:08 UTC (rev 275594)
@@ -1,3 +1,17 @@
+2021-04-07  Rob Buis  <[email protected]>
+
+        Make synthesizedBaselineFromContentBox return LayoutUnit
+        https://bugs.webkit.org/show_bug.cgi?id=224234
+
+        Reviewed by Javier Fernandez.
+
+        Make synthesizedBaselineFromContentBox return LayoutUnit. This
+        makes it consistent with synthesizedBaselineFromBorderBox.
+
+        * rendering/RenderButton.cpp:
+        (WebCore::synthesizedBaselineFromContentBox):
+        (WebCore::RenderButton::baselinePosition const):
+
 2021-04-07  Alejandro G. Castro  <[email protected]>
 
         [GTK][WPE] Wrong frame scrolled when view is horizontally scrolled with async scrolling enabled

Modified: trunk/Source/WebCore/rendering/RenderButton.cpp (275593 => 275594)


--- trunk/Source/WebCore/rendering/RenderButton.cpp	2021-04-07 08:32:32 UTC (rev 275593)
+++ trunk/Source/WebCore/rendering/RenderButton.cpp	2021-04-07 09:03:08 UTC (rev 275594)
@@ -143,7 +143,7 @@
     return LayoutRect(additionalOffset.x() + borderLeft(), additionalOffset.y() + borderTop(), width() - borderLeft() - borderRight(), height() - borderTop() - borderBottom());
 }
 
-static int synthesizedBaselineFromContentBox(const RenderBox& box, LineDirectionMode direction)
+static LayoutUnit synthesizedBaselineFromContentBox(const RenderBox& box, LineDirectionMode direction)
 {
     return direction == HorizontalLine ? box.borderTop() + box.paddingTop() + box.contentHeight() : box.borderRight() + box.paddingRight() + box.contentWidth();
 }
@@ -152,8 +152,8 @@
 {
     // We cannot rely on RenderFlexibleBox::baselinePosition() because of flexboxes have some special behavior
     // regarding baselines that shouldn't apply to buttons.
-    int baseline = firstLineBaseline().valueOr(synthesizedBaselineFromContentBox(*this, direction));
-    int marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
+    LayoutUnit baseline = firstLineBaseline().valueOr(synthesizedBaselineFromContentBox(*this, direction));
+    LayoutUnit marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
     return baseline + marginAscent;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to