[webkit-changes] [WebKit/WebKit] 462aff: REGRESSION (258177 at main): Radio buttons are shifte...

Aditya Keerthi noreply at github.com
Sun Jul 2 08:50:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 462aff8197a6a242af245a355cdd5a4fcb2245bf
      https://github.com/WebKit/WebKit/commit/462aff8197a6a242af245a355cdd5a4fcb2245bf
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-07-02 (Sun, 02 Jul 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/fast/forms/fixed-size-checkbox-vertically-centered-expected.html
    A LayoutTests/fast/forms/fixed-size-checkbox-vertically-centered.html
    A LayoutTests/fast/forms/fixed-size-radio-vertically-centered-expected.html
    A LayoutTests/fast/forms/fixed-size-radio-vertically-centered.html
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.h
    M Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.mm

  Log Message:
  -----------
  REGRESSION (258177 at main): Radio buttons are shifted up on facebook.com account sign up/creation page
https://bugs.webkit.org/show_bug.cgi?id=258754
rdar://111343119

Reviewed by Wenson Hsieh.

On macOS, "toggle buttons", which include radio button and checkboxes, are only
drawn at fixed sizes. When painted into a rect larger than their natural size,
the control is automatically vertically centered.

258177 at main incorrectly adjusted the rect used to paint these controls to equal
the natural size, rather the size of the element itself. Radio buttons on
facebook.com have a tall size. Consequently, the control is painted at the top
of the box, rather than in the center.

Fix by ensuring the rect used for painting uses the full size of the element.

* LayoutTests/TestExpectations:
* LayoutTests/fast/forms/fixed-size-checkbox-vertically-centered-expected.html: Added.
* LayoutTests/fast/forms/fixed-size-checkbox-vertically-centered.html: Added.
* LayoutTests/fast/forms/fixed-size-radio-vertically-centered-expected.html: Added.
* LayoutTests/fast/forms/fixed-size-radio-vertically-centered.html: Added.
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.h:
* Source/WebCore/platform/graphics/mac/controls/ToggleButtonMac.mm:
(WebCore::ToggleButtonMac::rectForBounds const):

Implement `rectForBounds` so that the rect used for painting is accurately reported.

(WebCore::ToggleButtonMac::draw):

Do not constain the paint rect to the natural size of the control.

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




More information about the webkit-changes mailing list