Apple is preparing iOS and iPadOS 16.4, currently in beta, including a big update to the Safari web browser and support for Web Push notifications when web apps are added to the home screen. Safari 16.4 will also be released for the desktop macOS.
New features in WebKit, the Safari browser engine, include constructible CSSStyleSheet objects, support for the Declarative Shadow DOM (DSD), support for lazy loading iFrames, new JavaScript features such as Import Maps, WebAssembly WASM SIMD support, and numerous web animation features and fixes.
A Shadow DOM is a way of specifying CSS styles scoped to a specific component, whereas standard CSS styles are global. This is important for a component-based approach to web applications, since it enables CSS to be bundled with the component. DSD is a further refinement, meaning that the Shadow DOM can be specified in HTML rather than from JavaScript, enabling server-side rendering to include Shadow DOMs without depending on client-side script.
Support for the CSSStyleSheet constructor means that new CSS StyleSheets can be created and populated by JavaScript. Lazy loading iFrames mean that iFrames do not load until the user scrolls near them, speeding initial load time for the page. WASM SIMD (Single Instruction, Multiple Data) enables parallelism to accelerate compute intensive processes such as audio/video codecs.
Import Maps supports JavaScript objects that declare an imported function together with the script file where it is located. The browser will load the file when the function is called, or not at all if it is unused.
Web Push notifications for apps installed to the iOS Home Screen enables developers to make Progressive Web Applications (PWAs) that behave more like native apps. “The notifications from web apps work exactly like notifications from other apps. They show on the Lock Screen, in Notification Center, and on a paired Apple Watch,” said a post to the WebKit blog.
This ability is extended to third-party browsers, which now also get the “Add to Home Screen” option for the first time.
These are big changes and go some way towards meeting developer concerns that Safari is the new IE. The likely reason for Apple’s hesitancy over implementing web technology is that it helps to ensure that apps for iOS are delivered by the App Store, a major profit center for the company.
With regard to Web Push, one developer remarked that “I have been waiting for this for years! Now the only thing that’s really missing is an install prompt.”
Regarding WASM SIMD, another described it as “HUGE 4x speedup for anything parallelizable. This should bring around ~45GFlops out of the box in the iPhone browser, which isn’t much but easily enough for basic neural networks (think object tracking, background segmentation, face feature tracking). For comparison, WebGPU would get that to ~1,000GFlops.”
Welcome news for developers, but why is Apple now investing more in web technology? It may be related to the EU Digital Markets Act (DMA) which potentially impacts Apple policies such as requiring all third-party browsers to use the WebKit engine on iOS. Similarly, improved support for PWAs are relevant to discussions on support for sideloading apps from third-party app stores.
It is a complex matter. Apple’s tight control over what it permits on iOS is bad for competition, but the existence of Safari as an implementation of web standards independent of Chromium is good for those standards. The third major implementation is Mozilla’s Gecko but Firefox now suffers from small market share.
For now though, improved support for web technologies in Apple’s mobile OS can only be a good thing.