Bug 259015 - REGRESSION (macOS Sonoma): Scrolling with keyboard arrow malfunction after speech synthesis
Summary: REGRESSION (macOS Sonoma): Scrolling with keyboard arrow malfunction after sp...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 17
Hardware: Mac (Apple Silicon) Other
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-07-08 11:34 PDT by Ethan Wong
Modified: 2023-07-11 09:52 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ethan Wong 2023-07-08 11:34:57 PDT
Scrolling with keyboard arrow would misfunction after speech synthesisation on macOS Sonoma.

Steps to reproduce (macOS 14.0 Beta (23A5286g)):

* Open Safari, select arbitrary text, right click and select ’Speech’ -> ’Start Speaking'
* The page would not be able scroll properly for keyboard arrow events

This is an AppKit issue. It happens due to SPI `-[NSApp speakString:]` misleadingly sends `NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification` notification, which causes WebKit to enable enhanced user interface accessibility.

Sample code to reproduce this problem:

```
@interface NSApplication ()

- (void)speakString:(NSString *)string;

@end

@implementation ViewController

- (void)viewDidLoad {
  [super viewDidLoad];

  // This notification should not be sent.
  [[NSNotificationCenter defaultCenter] addObserverForName:@"NSApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification"
                                                    object:nil
                                                     queue:[NSOperationQueue currentQueue]
                                                usingBlock:^(NSNotification *note) {
    NSLog(@"%@", note);
  }];

  [NSApp speakString:@“hello world"];
}

@end
```
Comment 1 Radar WebKit Bug Importer 2023-07-08 11:35:08 PDT
<rdar://problem/111957966>
Comment 2 Alexey Proskuryakov 2023-07-10 13:09:02 PDT
Thank you for the report! Could you please clarify if this is Sonoma only, and works fine in Safari 16.x? It would also be good to know if this reproduces with Safari Technology Preview on macOS Ventura and/or Monterey.

We can do this regression testing ourselves, but data from you would help us stay on the same page.

> This is an AppKit issue.

Issues outside WebKit need to be reported via https://feedbackassistant.apple.com. We can hold to this one while it's being analyzed, but we cannot track issues outside WebKit in WebKit Bugzilla.
Comment 3 Ethan Wong 2023-07-11 09:29:15 PDT
(In reply to Alexey Proskuryakov from comment #2)
> Thank you for the report! Could you please clarify if this is Sonoma only,
> and works fine in Safari 16.x? It would also be good to know if this
> reproduces with Safari Technology Preview on macOS Ventura and/or Monterey.
> 
> We can do this regression testing ourselves, but data from you would help us
> stay on the same page.
> 
> > This is an AppKit issue.
> 
> Issues outside WebKit need to be reported via
> https://feedbackassistant.apple.com. We can hold to this one while it's
> being analyzed, but we cannot track issues outside WebKit in WebKit Bugzilla.

Could be reproduced on any build (including Safari, Safari Technology Preview and local WebKit builds) on macOS Sonoma developer beta 3 (23A5286g).

Not reproducible on Ventura.