首页›WebKit›文章

WebKit Features for Safari 27.1

2026年10月23日

AI 摘要 AI 生成,可能有误

Safari 27.1 ships with the new foldable iPhone Duo, bringing the same WebKit engine as other iPhones along with a new feature that displays PDFs as two side-by-side pages when the device is partially folded. For developers, Safari 27.1 offers a preview of the Device Posture API and the Viewport Segments API behind feature flags, enabling layouts that adapt to folded and multi-segment displays. The article also details iPhone Duo's viewport sizes, encourages using responsive web design techniques rather than device detection, and explains how to test sites with the iPhone Duo simulator in Xcode 27.1.

Today iPhone Duo arrives, and with it, Safari 27.1.

The “big news” here is no news. It’s Safari, with the same WebKit engine and the same web technologies as every other iPhone. Your websites and web apps work on iPhone Duo just like they do everywhere else.

Safari 27.1 does bring one change to users. Now, when someone holds iPhone Duo partially folded like a book while looking at a PDF on the web, Safari 27.1 automatically shows PDFs as two pages side by side. When they open the screen flat or close it fully, Safari switches back to one page.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 WebKit

Global Privacy Control (GPC) WebKit API

AI 摘要Starting with iOS, iPadOS, visionOS, and macOS 27, WebKit offers a new API for Global Privacy Control (GPC), an emerging web standard that lets users opt out of data sharing and cross-context targeted advertising, as recognized under the CCPA. Developers using WKWebView or SwiftUI's WebPage can enable it via the new globalPrivacyControlEnabled property on WKWebpagePreferences or the isGlobalPrivacyControlEnabled property on WebPage.NavigationPreferences, which activates navigator.globalPrivacyControl and the Sec-GPC: 1 header for the main frame, subframes, and subresources. Example code in Swift and Objective-C shows how to set these properties in the navigation-policy delegate based on a user preference.

Release Notes for Safari Technology Preview 257

AI 摘要Safari Technology Preview Release 257 is now available for macOS Golden Gate and macOS Tahoe, bringing a wide range of WebKit fixes for developers to test. The release includes numerous CSS layout and rendering corrections (covering flexbox, grid, tables, text-box-trim, and line clamping), along with fixes for animations, canvas drawing, form controls including new support for rendering `` as a dropdown and preview support for an enhanced `` element. Additional improvements address JavaScript error handling, media playback issues such as ogg audio and video seeking, and editing behavior like text re-wrapping.

Introducing spatial CSS: A developer preview

AI 摘要Safari on visionOS 27.3 introduces a limited developer preview of the proposed spatial CSS API, which brings spatial and 3D web capabilities to web authors through declarative CSS rather than JavaScript. The preview includes features such as spatial:portal transforms, position-anchor for snapping models together, @environment-map for managing lighting, portal-action:orbit for rotating scenes, and requestVolumetricScene() to present content outside the browser window. WebKit is seeking developer feedback on these features while emphasizing that spatial content should work across all devices, not just headsets.

Safari on Apple HomeView

AI 摘要Safari is now available on Apple HomeView, a new square, 7-inch smart display that users interact with by voice or touch, and since it runs on WebKit, most websites should already work without changes. Developers can enhance the experience by adding schema.org Recipe markup in JSON-LD to enable a step-by-step cooking view and including WebVTT captions in track elements for video. They should also avoid fragile assumptions like user agent sniffing or fixed viewport expectations, instead using semantic HTML, feature detection, and flexible, accessible layouts to handle HomeView's short, square screen.

Release Notes for Safari Technology Preview 256

AI 摘要Safari Technology Preview Release 256 is now available for macOS Golden Gate and macOS Tahoe, containing WebKit changes between revisions 323398@main and 324653@main. The release introduces new CSS features such as font-palette-mix(), text-combine-upright on ::marker, and continue: collapse with line-clamp, along with new canvas text drawing style options and object-fit support for SVG documents. It also resolves numerous accessibility, animation, CSS, forms, HTML, images, and JavaScript bugs, including performance improvements for scroll-driven animations and removal of deprecated body margin attributes.