Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 644a9202154236be2890f8bf7188faaa431f7e28
https://github.com/WebKit/WebKit/commit/644a9202154236be2890f8bf7188faaa431f7e28
Author: Per Arne Vollan <[email protected]>
Date: 2026-01-27 (Tue, 27 Jan 2026)
Changed paths:
M Source/WTF/wtf/PlatformEnableCocoa.h
M Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
M Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Log Message:
-----------
[macOS] Initialize NSApplication on demand in the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=305924
rdar://168588316
Reviewed by Basuke Suzuki.
NSApplication is mainly used to support Accessibility in the WebContent
process. After we enabled the feature
to initialize Accessibility on demand in
https://commits.webkit.org/291827@main, we can also initialize
NSApplication on demand. This improves startup time of the WebContent process,
since there are a significant
amount of samples during initialization of NSApplication. This should also be
beneficial for Site Isolation,
since we will be launching more WebContent processes then. We still need to
call _RegisterApplication, which
was previously called when initializing NSApplication.
* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::accessibilityFocusedUIElement):
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setAccentColor):
Return early if the accent color is not valid, which is the case when the
client has not specified the color.
Returning early avoids initializing the NSApplication singleton object in this
case. Also replace NSApp with
NSApplication.sharedApplication, since NSApp will be null here, and trying to
set the accent color will then
not have any effect.
Canonical link: https://commits.webkit.org/306288@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications