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

Aditya Keerthi noreply at github.com
Tue May 28 18:45:01 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1cf2af72f97ef4de30a5d7edad747d3360dece65
      https://github.com/WebKit/WebKit/commit/1cf2af72f97ef4de30a5d7edad747d3360dece65
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-05-28 (Tue, 28 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/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 Richard Robinson.

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/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/279420@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