Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8bf88660a6641cf8df5f4511b85326ff28d83033
      
https://github.com/WebKit/WebKit/commit/8bf88660a6641cf8df5f4511b85326ff28d83033
  Author: Tim Horton <[email protected]>
  Date:   2026-05-19 (Tue, 19 May 2026)

  Changed paths:
    A 
LayoutTests/fast/forms/ios/form-control-refresh/button/identical-buttons-have-same-corner-radius-expected.html
    A 
LayoutTests/fast/forms/ios/form-control-refresh/button/identical-buttons-have-same-corner-radius.html
    M Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm

  Log Message:
  -----------
  Identical buttons drawn differently with font: -apple-system-short-body
https://bugs.webkit.org/show_bug.cgi?id=311188
rdar://173786057

Reviewed by Abrar Rahman Protyasha and Aditya Keerthi.

There is some logic in RenderThemeCocoa's shapeForButton that tries to make
"squareish" pill buttons not draw a circle"ish" background (by dropping to a 
much
lower corner radius), by thresholding the aspect ratio of the button.

Identically sized buttons set at two different positions can fall on different
sides of that threshold due to pixel snapping. It just so happens that the font
and glyph combination in the testcase puts the button right on the boundary,
and rounding can kick it either way.

Fix this by thresholding the un-pixel-snapped aspect ratio, so that identically
sized buttons go down the same shape path regardless of where they sit.

The test has a small amount of fuzziness because of the aforementioned snapping,
but when it fails for real it fails with orders of magnitude more delta.

Test: 
fast/forms/ios/form-control-refresh/button/identical-buttons-have-same-corner-radius.html

* 
LayoutTests/fast/forms/ios/form-control-refresh/button/identical-buttons-have-same-corner-radius-expected.html:
 Added.
* 
LayoutTests/fast/forms/ios/form-control-refresh/button/identical-buttons-have-same-corner-radius.html:
 Added.
* Source/WebCore/rendering/cocoa/RenderThemeCocoa.mm:
(WebCore::shapeForButton):

Canonical link: https://commits.webkit.org/313535@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to