Bug 215112 - [iOS] Check that Accessibility is enabled when receiving the enable Accessibility notification
Summary: [iOS] Check that Accessibility is enabled when receiving the enable Accessibi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-03 17:00 PDT by Per Arne Vollan
Modified: 2022-02-10 16:47 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.63 KB, patch)
2020-08-03 17:02 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (3.68 KB, patch)
2020-08-04 06:58 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.76 KB, patch)
2020-08-04 07:23 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (2.70 KB, patch)
2020-08-04 07:37 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (7.55 KB, patch)
2020-08-04 13:18 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (7.57 KB, patch)
2020-08-04 14:13 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2020-08-03 17:00:55 PDT
Return early when handling this notification if Accessibility is not enabled.
Comment 1 Per Arne Vollan 2020-08-03 17:01:11 PDT
rdar://problem/66498397
Comment 2 Per Arne Vollan 2020-08-03 17:02:56 PDT
Created attachment 405887 [details]
Patch
Comment 3 youenn fablet 2020-08-04 05:15:52 PDT
Comment on attachment 405887 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405887&action=review

> Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:704
> +            return;

unblockPreferenceServiceIfNeeded() is called in various places like in m_enhancedAccessibilityObserver. Should this check be added in unblockPreferenceServiceIfNeeded instead of in this handler?
That would mirror what unblockAccessibilityServerIfNeeded is ding.
Comment 4 Per Arne Vollan 2020-08-04 06:58:52 PDT
Created attachment 405918 [details]
Patch
Comment 5 Per Arne Vollan 2020-08-04 07:06:50 PDT
(In reply to youenn fablet from comment #3)
> Comment on attachment 405887 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=405887&action=review
> 
> > Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm:704
> > +            return;
> 
> unblockPreferenceServiceIfNeeded() is called in various places like in
> m_enhancedAccessibilityObserver. Should this check be added in
> unblockPreferenceServiceIfNeeded instead of in this handler?
> That would mirror what unblockAccessibilityServerIfNeeded is ding.

Good catch! I added a similar check for macOS. I did keep the check in the notification handlers, since I thought it might also make sense to prevent the rest of the handler code to run if accessibility is not enabled.

Thanks for reviewing!
Comment 6 Per Arne Vollan 2020-08-04 07:23:24 PDT
Created attachment 405920 [details]
Patch
Comment 7 Per Arne Vollan 2020-08-04 07:37:57 PDT
Created attachment 405921 [details]
Patch
Comment 8 Darin Adler 2020-08-04 13:03:04 PDT
Comment on attachment 405887 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405887&action=review

> Source/WebKit/ChangeLog:3
> +        [iOS] Check that Accessibility is enabled when receiving the enable Accessibility notification

Why?
Comment 9 Per Arne Vollan 2020-08-04 13:18:37 PDT
Created attachment 405938 [details]
Patch
Comment 10 Darin Adler 2020-08-04 13:22:19 PDT
Comment on attachment 405938 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405938&action=review

> Source/WebCore/PAL/ChangeLog:3
> +        [iOS] Check that Accessibility is enabled when receiving the enable Accessibility notification

Why? For security? Performance? Correctness?

> Tools/TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm:66
> +    [NSApp accessibilitySetEnhancedUserInterfaceAttribute:[NSNumber numberWithBool:YES]];

I suggest @(YES) instead of [NSNumber numberWithBool:YES].
Comment 11 Per Arne Vollan 2020-08-04 14:09:09 PDT
(In reply to Darin Adler from comment #10)
> Comment on attachment 405938 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=405938&action=review
> 
> > Source/WebCore/PAL/ChangeLog:3
> > +        [iOS] Check that Accessibility is enabled when receiving the enable Accessibility notification
> 
> Why? For security? Performance? Correctness?
> 

Yes, this is for security. I will add a note to the WebKit change log.

> > Tools/TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm:66
> > +    [NSApp accessibilitySetEnhancedUserInterfaceAttribute:[NSNumber numberWithBool:YES]];
> 
> I suggest @(YES) instead of [NSNumber numberWithBool:YES].

Will fix.

Thanks for reviewing!
Comment 12 Per Arne Vollan 2020-08-04 14:13:24 PDT
Created attachment 405942 [details]
Patch
Comment 13 EWS 2020-08-04 15:49:43 PDT
Committed r265264: <https://trac.webkit.org/changeset/265264>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405942 [details].