[webkit-changes] [WebKit/WebKit] 11d3a4: REGRESSION (macOS 14): Form controls draw with an ...

Aditya Keerthi noreply at github.com
Wed May 29 13:12:42 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 11d3a4ba119c7cfc3f217a115225a2044bea4d44
      https://github.com/WebKit/WebKit/commit/11d3a4ba119c7cfc3f217a115225a2044bea4d44
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-05-29 (Wed, 29 May 2024)

  Changed paths:
    M LayoutTests/fast/forms/select/mac-wk2/inactive-appearance-expected-mismatch.html
    M LayoutTests/fast/forms/select/mac-wk2/inactive-appearance.html
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WTF/wtf/PlatformUse.h
    M Source/WebCore/PAL/pal/spi/mac/NSCellSPI.h
    M Source/WebCore/platform/graphics/mac/controls/ControlMac.mm

  Log Message:
  -----------
  REGRESSION (macOS 14): Form controls draw with an active appearance when the window is inactive
https://bugs.webkit.org/show_bug.cgi?id=273588
rdar://127391198

Reviewed by Abrar Rahman Protyasha.

Prior to GPU process support on macOS, inactive form controls were drawn by
overriding the return value of `hasKeyAppearance` on the backing window as
necessary. However, with the introduction of GPU process, `NSCell`s are no longer
backed by a control view, and do not have a window. Consequently, they are
always drawn with an active appearance.

This is not an issue in configurations where GPU process is disabled, as the
control view path still exists.

Fix by adopting AppKit SPI to specify the presentation state of `NSCell`s that
are not backed by control views.

This regression was previously missed as the regression test responsible for the
behavior was broken until 278267 at main.

* LayoutTests/fast/forms/select/mac-wk2/inactive-appearance-expected-mismatch.html:
* LayoutTests/fast/forms/select/mac-wk2/inactive-appearance.html:

Adjust the test to use `testRunner.setWindowIsKey` rather than
`internals.setPageIsFocusedAndActive`. The latter results in flakiness, as
an activity state update can come after the override, but before taking the
snapshot, invalidating the test result.

Also, use `runSingly` to ensure window key-state is reset, to avoid flakiness.

* LayoutTests/platform/mac-wk2/TestExpectations:

Mark the test as passing.

* Source/WTF/wtf/PlatformUse.h:

The necessary SPI is unavailable on macOS 13. The behavior will work on macOS
13 since cells are still control-view-backed there.

This is part of the build fix on top of 279420 at main.

* Source/WebCore/PAL/pal/spi/mac/NSCellSPI.h:
* Source/WebCore/platform/graphics/mac/controls/ControlMac.mm:
(WebCore::applyViewlessCellSettings):

Use `-[NSCell _setFallbackBezelPresentationState:]` to set an appropriate presentation
state, matching the window's active state. Note that only the `NSPresentationStateActiveKey`
and `NSPresentationStateInactive` are used, matching the control view path.

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



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


More information about the webkit-changes mailing list