September 20, 2023

Release Notes for Safari Technology Preview 179

Surfin’ Safari

Safari Technology Preview Release 179 is now available for download for macOS Sonoma beta and macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

This release includes WebKit changes between: 266624@main…267815@main.

CSS

New Features

  • Added support for mask-border properties. (267460@main)
  • Added support for the cap unit. (267315@main)
  • Added support for the <position> parameter in ray(). (267459@main)
  • Added new relaxed parsing behavior for CSS Nesting. (267549@main)
  • Added support for xywh() shape. (267789@main)
  • Added support for offset-position: normal for CSS Motion Path. (267657@main)
  • Added support for the rcap, rex, ric, and rch units. (267321@main)
  • Added new typed OM factory functions for font and root font relative units. (267437@main)
  • Added support for the coord-box parameter in ray(). (267566@main)
  • Added offset-position support for circle() and ellipse(). (267810@main)

Resolved Issues

  • Fixed the font-family descriptor for @font-palette-values to accept multiple values. (267411@main)
  • Fixed CSS @imports in HTML getting mistakenly hidden from the CSS preload scanner when missing a semi-colon and space. (267322@main)
  • Fixed :nth-child() invalidation when not in subject position. (267600@main)
  • Fixed :has(:host) invalidation. (267773@main)
  • Fixed :has(:nth-child()) invalidation and related. (267771@main)
  • Fixed handling dynamic updates to viewport units when used in @property initial value. (267590@main)
  • Fixed the <basic-shape> implementation for offset-path. (267556@main)
  • Fixed <coord-box> implementation for offset-path. (267524@main)
  • Fixed serialization to always serialize implicit & and an implicit nested rule. (267531@main)
  • Fixed the serialization of percentages in color-mix(). (267596@main)
  • Fixed the check for in-progress layout when setting a containing block rect for ray() used with motion-path. (267479@main)
  • Fixed adding fine-grained invalidation support for selectors containing :slotted(). (267326@main)
  • Fixed rounding of <integer> type to round half towards positive infinity. (267339@main)
  • Fixed fine-grained invalidation for :host pseudo-class in non-subject position. (267355@main)
  • Fixed the container for the ::part pseudo-element to be selected from the originating element tree. (267421@main)
  • Fixed serialization of infinity and -infinity in colors. (267544@main)
  • Fixed lab, lch, oklab, oklch components to be clamped to appropriate ranges. (267555@main)
  • Fixed coord-box to use border-radius for CSS Motion Path. (267613@main)
  • Fixed color-mix() to not serialize to legacy color syntax. (267626@main)
  • Fixed resolving the size of a replaced element by using its intrinsic size as the width. (267648@main)
  • Fixed determining non-orthogonal grid item’s columnAxisPosition by considering fallback alignment for first/last baseline. (267811@main)

HTML

New Features

  • Added support for the name attribute in the <details> element. (267756@main)

Resolved Issues

  • Fixed <input type="number"> not returning the correct value when a decimal is entered. (267581@main)
  • Fixed dynamic handling of <base> elements. (267498@main)
  • Fixed URL encoding of <base> elements. (267585@main)
  • Fixed URL encoding of SVG <image> elements. (267593@main)
  • Fixed empty value attributes to not be ignored on image input types. (267592@main)

HTTP

Resolved Issues

  • Fixed COOP header breaking back and forward behavior when client-side redirects are involved. (267553@main)

Media

New Features

Resolved Issues

  • Fixed WebCodecs VideoEncoder configure to resolve its promise for unknown codecs. (267668@main)
  • Fixed handling NaN in audio delay curves. (267589@main)
  • Fixed setting the color space for WebCodecs/WebRTC VP9 for libvpx encoders. (267638@main)

SVG

New Features

  • Added support for SVG <image crossorigin>. (267349@main)

Web Animations

Resolved Issues

  • Fixed color-scheme to support discrete animation. (267750@main)

Web API

New Features

  • Added support for window.clientInformation in terms of window.navigator. (267625@main)

Resolved Issues

  • Fixed checking for NaN when creating a DelayNode for WebAudio. (267650@main)
  • Fixed element.querySelector(":has(:scope *)") to never match. (267809@main)

Deprecations

  • Removed HTMLMediaElement.webkitHasClosedCaptions and HTMLMediaElement.webkitClosedCaptionsVisible. (267780@main)

Web Inspector

New Features

Resolved Issues

  • Fixed objects logged to the console with multiple private fields that use the same name. (267483@main)

September 20, 2023 09:32 PM

September 18, 2023

WebKit Features in Safari 17.0

Surfin’ Safari

Today’s the day for Safari 17.0. It’s now available for iOS 17 and iPadOS 17.

Safari 17.0 is currently available as a public beta on macOS Ventura, and macOS Monterey, and macOS Sonoma, and will be released on September 26th. Safari 17.0 is also available in the vision OS Simulator, where you can test your website by downloading the latest beta of Xcode 15, which supports the visionOS SDK.

To get Safari 17.0 on your iPhone or iPad, go to Settings > General > Software Update and tap to update to iOS 17 or iPadOS 17. If you are running macOS Ventura or macOS Monterey, you will be able update Safari by going to Software Update and clicking “More info”. On macOS Ventura, that’s  > System Settings > General > Software Update > More info and choose to update Safari.

word cloud of all the features in Safari 17.0, which are all described in this article

HTML

The new search element

While new web technology is defined in web standards all the time, it’s rare for a brand-new HTML element to come along. It only happens when something meets very high expectations of utility. Search is a key function for most websites, so now, there’s a new element — <search>.

Up until now, search boxes were often constructed in markup like this:

<div class="search-box" role="search">
  <form action="/search">
    <p><input type="search" name="q"> <input type="submit" value="Search!"></p>   
  </form>
</div>

Notice the presence of ARIA role="search" on the first line of code above. Without the ARIA search role, search functionality is not made properly accessible to all users — a problem that’s far too easy to create.

The <search> element automatically provides the correct accessibility semantics for the search section of a website or web app. This aligns with the principles of HTML, making the default accessible, instead of requiring you to remember to take an action to add accessibility. The <search> element also supplies the semantic markup for communicating the inherent meaning of a search form to a wide range of computing contexts, from translation algorithms to machine learning.

We are excited to be the first browser to ship this new <search> element, now supported in Safari 17.0.

<search>
  <form action="/search">
    <p><input type="search" name="q"> <input type="submit" value="Search!"></p>   
  </form>
</search>

Browsers without support for the search element will recognize there is an element present, and they will recognize any attributes it has — including roles, IDs, and classes. It will simply behave like a generic element, as if it were a <div>. Because of this, we recommend you include an ARIA search role on the <search> element for now. By using <search role="search">, you will ensure every user has the intended experience. And in the future, when all browsers have support, you can drop the ARIA search role.

In the meantime, you can start using <search> today with confidence, long before a significant percent of your audience use browsers with support.

Popover

Safari 17.0 adds support for the popover attribute. It provides a framework built into the web for displaying overlays, popups, popovers, and dialogs.

There are two types of popovers, which can be used as values for the popover attribute:

  • auto popovers, which automatically close when you click outside of the popover; and
  • manual popovers, which don’t have this automatic closing behavior.

Start with a button (either <button> or <input type="button">) to create the UI for opening and closing the popover. Then, add the appropriate HTML attributes to create the desired result.

The popovertarget attribute connects the button to the popover content through an ID. The optional popovertargetaction attribute takes show, hide, or toggle as values. By default, toggle is used.

<button popovertarget="info-box" popovertargetaction="show">More info</button>

<article id="info-box" popover="auto">
  <h2>Additional Information</h2>
  <p>Here’s something I wanted to tell you.</p>
  <button popovertarget="info-box" popovertargetaction="hide">Close</button>
</article>

This is just one UI pattern you might find useful. There are many possible combinations. Having a popover mechanism in HTML makes for quick work, while ensuring great usability and full accessibility.

To go beyond a simple button trigger, a JavaScript API opens up more powerful possibilities through showPopover(), hidePopover(), and togglePopover().

Horizontal rules inside select elements

Safari 17.0 on macOS also adds support for <hr> inside of <select>, a feature the WebKit team added to the HTML web standard. This makes it easier to create a visual separator between items without requiring the use of JavaScript.

<select>
  <option value="pizza">Pizza</option>
  <option value="hamburger">Hamburger</option>
  <hr>
  <option value="sushi">Ice cream</option>
  <option value="pasta">Cake</option>
</select> 

CSS

Font size adjust

In Safari 16.4, we shipped initial support for font-size-adjust, which allows you to easily make the visual size of different fonts consistent — even across all possible combinations of fallback fonts.

The basic version of font-size-adjust lets you tell the browser to resize letters so that their x-height is a specific ratio of the font-size. In Safari 17.0, we’re expanding support to include more advance capabilities of font-size-adjust, including the from-font value and the two-value syntax.

The two-value syntax lets you to switch from adjusting ex-height to adjusting cap-height, ch-width, ic-width, or ic-height — providing support for a broader range of writing systems and design choices.

Slide from WWDC23, showing where on various letters and characters the measurements ex-height, cap-height, ch-width, ic-width, and ic-height apply.Learn more about how `font-size-adjust` works by watching What’s New in CSS from WWDC23.

Instead of declaring a ratio with a number value, the from-font value allows you to ask the browser to pull the sizing metric from the primary font being specified, and apply that ratio to all fonts.

Let’s look at an example. Here, font-size-adjust tells the browser to make all of the fonts inside article match the size of the x-height of the main font being used. This means all of the text in paragraphs and code will visually appear to be the same size, no matter which font is applied from either stack, or how different the paragraph and code fonts appear in actual size.

article { 
  font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif;
  font-size: 1.4rem;
  font-size-adjust: from-font;
}
article code {
  font-family: "Courier New", monospace;
}

Safari 17.0 also adds support for @font-face size-adjust, providing a way for you to normalize visual size when defining a font’s use.

Text transform

Safari 17.0 adds support for text-transform: full-width and text-transform: full-size-kana.

The full-width value transforms all the characters in your text to be “full-width” — to match the width of characters defined in an East Asian script like Chinese, Japanese, or Korean (CJK). It’s especially useful when typesetting vertical text or wanting to provide consistency in sizing when mixing CJK with Latin or other scripts.

The full-size-kana value transforms the size of small Kana characters in Japanese to look like their full-size counterparts — a technique sometimes used to make ruby text more legible at small sizes.

Safari 17.0 also adds support for declaring more than one text-transform value, so that these values can be combined. For example text-transform: uppercase full-width will transform characters in a Latin script to be both all capital letters and the same width as the CJK characters in the font.

Font support testing

To expand what’s possible with web typography, Safari 17.0 adds two feature queries for conditionally applying CSS depending on the presence or absence of browser support for a particular font format or technology: @supports font-format() and @supports font-tech().

The font format feature query tests for support of specific font formats, like opentype and woff2. The font tech feature query lets you test for support of specific OpenType technologies, like COLRv0.

@supports not (font-tech(color-COLRv0) or font-tech(color-COLRv1)) {
  h1 {
    color: --text-color-for-non-color-fonts;
  }
}

Safari 17.0 also adds support for @font-face { src: url() tech() }, making it easy to tell the browser to download and use a font only if its underlying technology is supported, while providing alternative font files as fallbacks.

@font-face {
    font-family: "My Cool Font";
    src: url("mycoolfont-COLRv0.otf") format(opentype) tech(color-COLRv0),
         url("mycoolfont-COLRv1.otf") format(opentype) tech(color-COLRv1),
         url("mycoolfont-outline.otf") format(opentype);
}

Hyphenation

Supported in Safari with -webkit- prefixes since 2011, the hyphens and hyphenate-character properties are now supported in their unprefixed form.

The hyphens property lets you specify whether or not words should be hyphenated when text wraps onto multiple lines. The default, hyphens:manual, causes the browser to hyphenate only at manually-specified points. You can instead ask the browser to insert hyphens automatically according to an algorithm. Be sure to use the lang attribute to identify the langauge being used, so the browser can reference the correct hyphenation dictionary.

<html lang="en-US">
  <p>Content that will be hyphenated according to 
  the grammatical rules of U.S. English.<p>
</html>           

article {
  hyphens: auto;
}

The hyphenate-character property lets you specify which character (or string) to use when breaking words. By default, it’s set to the content language’s typographic conventions. In English, for example, it’s set to -. But if you need to change it, you can.

Counter styles

Safari 17.0 adds support for @counter-style.

a slide from WWDC23 of a Counter Styles example, where the code creates a list with emoji smiley faces as the list markers. Learn more about how CSS Counters and Counter Styles work by watching What’s New in CSS from WWDC23.

CSS Counter Styles provide a mechanism for changing a counter’s language or character set in CSS — both for ordered/unordered lists (with list-style-type) and for CSS Counters.

For example, I can define a counting system for Serbian, and use it to number ordered lists.

@counter-style upper-serbian {
  system: alphabetic;
  symbols: 'А' 'Б' 'В' 'Г' 'Д' 'Ђ' 'Е' 'Ж' 'З' 'И' 'Ј' 'К' 'Л' 'Љ' 'М' 'Н' 'Њ' 'О' 'П' 'Р' 'С' 'Т' 'Ћ' 'У' 'Ф' 'Х' 'Ц' 'Ч' 'Џ' 'Ш';
}
ol { 
  list-style: upper-serbian; 
}

Display contents

WebKit for Safari 17.0 fixes our remaining accessibility issues with display:contents.

Improvements in the experience of elements which are styled display:contents include:

  • Making HTML tables and table components available to the accessibility tree.
  • Ensuring elements with the ARIA roles grid, treegrid, table, row, gridcell, cell, columnheader, tree and treeitem are properly exposed in the accessibility tree.
  • Ensuring aria-checked works for elements with the ARIA roles tree and treeitem.
  • Returning the correct sub-role for lists, including elements with an ARIA role of directory.
  • Ensuring elements are not missing their children.
  • Making elements able to return selected accessibility children.
  • Computing the accessible name that rely on labels or captions.
  • Computing the correct accessibility clickpoint for links and headings.
  • Properly exposing lists that have display:contents list items.
  • Making aria-checked work for role="treeitem".
  • Making aria-activedescendant work.
  • Making aria-grabbed and aria-dropeffect work.
  • Making aria-flowto work.
  • Making CSS speak-as, AXAccessKey, aria-owns, and URL AX APIs work.

Safari 17.0 also fixes accessibility issues with HTML tables and table components that have display: flex, grid, block, or inline-block applied.

Media Queries

Safari 17.0 completes WebKit’s support for the Media Queries level 4 web standard, adding support for four new media queries.

Like other media queries, overflow-block and overflow-inline provide a way to conditionally apply CSS depending on the qualities of a user’s device — in this case, how a device handles overflow. For example, can it scroll the page like a typical browser on a computer? Does it page the content, like an e-book reader? Or does it have no mechanism for handling overflow, like a digital billboard?

The update media query provides a way to apply CSS depending on the refresh rate of the device. For instance, e-book reader screens often have slower refresh rates. A printed page has no refresh rate at all.

We’ve also added support for thescripting media query. It allows you to conditionally apply CSS based on whether or not JavaScript support is enabled in the user’s browser.

Image set

Safari 17.0 also improves our implementation of image-set(), increasing interoperability with other browsers as part of our commitment to Interop 2023.

The image-set()function lets you list a set of images in CSS, with information about each, and have the browser pick the most appropriate image to use from that set. Safari 17.0 now supports the optional resolution and type arguments.

The resolution argument provides a way to declare information about the resolution of each image: 1x, 2x, 600dpi, etc.

The type argument provides a means to offer multiple file types — including the JPEG XL and HEIC formats newly supported in Safari 17.0. The browser will download and use the first one it supports.

main {
  background-image: image-set(
    url("images/trees.jxl") type("image/jxl"),
    url("images/trees.avif") type("image/avif"),
    url("images/trees.jpeg") type("image/jpeg")
  );
}

Container Queries

To keep up with the most recent changes to the web standard for Container Queries, Safari 17.0 adds support in CSSOM for containerName and containerQuery , and updates conditionText to be the concatenation of the first two in CSSContainerRule.

And more CSS

Safari 17.0 also adds support for contain-intrinsic-size, providing the means for setting the size of an element, when that element is subject to size containment.

To increase the usefulness of :has(), WebKit now supports :has(:buffering) and :has(:stalled). These expand the ability to apply CSS conditionally based on the state of media playback. Safari 17.0 also supports :has(:defined) letting you apply styling in the presence of a custom element that’s been defined.

JavaScript and Web API

Storage

Safari 17.0 and WebKit for iOS 17, iPadOS 17, and macOS now fully support the Storage API.

WebKit is also updating the storage quota policy. Previously, an origin had a starting storage limit of 1 GB. When exceeding that limit, the subsequent storage operation would fail in Home Screen web apps or prompt the user to give permission to increase the quota in Safari.

Now, the origin quota is calculated based on total disk space. This means an origin generally gets a much higher limit, and users will no longer receive permission prompts in Safari. You can use StorageManager.estimate() to get estimated usage and quota values per origin.

With each origin getting a higher storage limit by default, WebKit will evict data by origin when the total usage of all origins together is bigger than a certain value — the “overall quota”, calculated based on total disk space.

An origin is exempt from eviction when its storage mode is persistent. To check the storage mode of your origin, you can use navigator.storage.persisted(). To request the mode be changed to persistent, you can use navigator.storage.persist(). Critical bugs have been fixed to ensure the storage mode value is remembered across sessions.

Read Updates to Storage Policy for many more details, along with example code.

Offscreen Canvas

When using Canvas, the rendering, animation, and user interaction usually happens on the main execution thread of a web application. Offscreen Canvas provides a canvas that can be rendered off-screen, decoupling the DOM and the Canvas API so that the <canvas> element is no longer entirely dependent on the DOM. Rendering can be transferred to a worker context, allowing you to run tasks in a separate thread and avoid heavy work on the main thread that can negatively impact the user experience. The combination of DOM-independent operations and rendering of the main thread can provide a significantly better experience for users, especially on low-power devices.

Support for Offscreen Canvas 2D operations shipped in Safari 16.4. Now, Safari 17.0 adds support for WebGL in Offscreen Canvas, bringing these benefits to 3D.

Canvas

The CanvasRenderingContext2D.drawImage() method of the Canvas 2D API supports different sources of an image to be drawn onto the canvas. Safari 17.0 adds support for SVG by allowing SVGImageElement as an image source to drawImage().

RegEx

Safari 17.0 adds JavaScript support for two new features for Regular Expressions: RegExp v flag with set notation + properties of strings and RegExp duplicate named capture groups.

RegExp v flag allows for the creation of regular expressions containing Unicode properties, including some multi-character Emoji sequences. It also allows for creating regular expressions with union, intersection, and subtraction set operations on character classes and collections of strings.

Duplicate named capture group enables the creation of regular expressions with named captures where more than one capture group uses the same name. This allows you to create regular expressions with intuitive group names where there is more than a one-way pattern to search. An example is creating one regular expression that can search data strings written in multiple ways, e.g. M/D/Y versus D-M-Y, while extracting the matched results with captured group names month, day, and year regardless of which string format was matched.

Set Operations

Another new JavaScript feature adds seven Set operation methods, including intersection() and union(), as well the comparison methods difference(), isSubsetOf() and isSuperSetOf(). Together these new methods make Sets powerful first class objects.

const setA = new Set(["apples", "oranges", "grapes"]);
const setB = new Set(["bananas", "grapes", "apples"]);

// Union into single set
const union = setA.union(setB);

// Interection "apples" and "grapes"
const intersect = setA.intersection(setB);

// Difference "oranges"
const diff = setA.difference(setB);

Also check out the new .symmetricDifference() and .isDisjointFrom() methods, which open up some interesting comparison possibilities.

Gamepad API

WebKit for Safari 17.0 adds support for Gamepad.prototype.vibrationActuator. It enables “dual-rumble” haptic feedback on gamepads. The API allows you to check if “dual-rumble” is supported by the gamepad, as well as control the duration and magnitude of the haptic effect.

const [gamepad] = navigator.getGamepads();
if (gamepad?.vibrationActuator?.canPlayEffectType("dual-rumble")) {
  const options = {
    duration: 1000, // 1 seconds
    startDelay: 0, // play now
    strongMagnitude: 0.5, // low-frequency vibration
    weakMagnitude: 0.2,  // high-frequency vibration
  };
  gamepad.vibrationActuator.playEffect("dual-rumble", options);
}

URL API

Traditionally, to ensure you could parse a URL, you needed to use a try sequence. Now, you can directly detect if an URL input can be parsed with URL.canParse(tentativeURL, optionalBase). The method will return true or false.

In addition, the has() and delete() methods on URLSearchParams have been extended. The has() method makes it possible to detect if a parameter has been set. And the delete() method can delete a parameter. Until now, you could only check for and delete by name alone. Now, the methods have been extended so that you can check for and delete specific name-value pairs.

For example, on an URL with duplicate key such as https://example.com/?currency=USD&currency=JPY, before you could only check params.has('currency'). Now, it’s possible to do params.has('currency', 'JPY').

Be mindful that with this update, method signatures are not directly feature detectable, so they can return false positives. Until all browsers support these updates, be sure to run a test to confirm support. For example:

// These return true only when the updated API is supported!
function supportsUpdatedURLHasMethod() {
    const param = new URLSearchParams({ key: "value" });
    return param.has("key", "does not exist") === false;
}

function supportsUpdatedURLDeleteMethod() {
    const param = new URLSearchParams({ key: "value" });
    param.delete("key", "does not exist");
    return param.has("key");
}

Web Sockets

You can now use relative URLs (as well as HTTP(S) URLs) in the WebSocket constructor — this makes it a lot easier to point to WebSocket endpoints without hard-coding URLs into your web application. For example, new WebSocket('/updates').

And more JavaScript and Web API

  • Support for <link rel="modulepreload">.
  • Support for the focus fixup rule.
  • Support for Ed25519 cryptography.
  • Support for customElements.getName method.
  • Renaming of Intl.Locale getter method names to be prefixed with “get”.
  • Support for move() method of FileSystemHandle starting to overwrite target by default.

Images and video

JPEG XL

Safari 17.0 adds support for JPEG XL. The new image format provides another modern option for finding the right balance between visual quality and file size.

JPEG XL uses a new compression algorithm called “Modular Entropy Coding” that allows for greater flexibility in adjusting the compression ratio. Similar to JPEG, it has support for progressive loading, making it well-suited for images served over slow connections, since users start to see the image before the whole file is downloaded. And you can recompress existing JPEG files into JPEG XL without any loss of quality or data, while reducing their size by an average of 20%. Or compress from the original image file to create a file that’s up to 60% smaller compared to JPEG.

Use the <picture> element to provide JPEG XL files to browsers that have support, while easily providing a fallback format to browsers that don’t.

<picture>
  <source srcset="images/sophie.jxl" type="image/jxl">
  <img src="images/sophie.jpg" alt="tiny brown puppy sleeping in the sun">
</picture>

JPEG XL is supported by WebKit for Safari 17.0, Safari View Controller and WKWebView on iOS 17, iPadOS 17, watchOS 10, macOS Sonoma, macOS Ventura and macOS Monterey.

HEIC

Safari 17.0 also adds support for HEIC images. A HEIC photo can take up about half the space of an equivalent-quality JPEG file.

HEIC is the image format used across Apple devices to store photos captured by the cameras, as well as in iCloud Photos. With support for HEIC in Safari, Safari View Controller, and WKWebView, you can now support importing and editing such photos right in the browser, without needing to convert them into another format. HEIC is also ideal for displaying images when using WKWebView inside an app.

Learn more about JPEG XL and HEIC by watching Explore media formats for the web at WWDC23.

AV1

Safari 17.0 adds support for AV1 video on devices with hardware decoding support, like iPhone 15 Pro and iPhone 15 Pro Max.

The AV1 video codec adds another option for delivering video across the web, while finding the right balance between gorgeous quality and smaller file sizes. Hardware encoding/decoding provides an efficient way support the video codec without an undesired impact on battery life.

The progressively-enhanced nature of the web makes it easy to provide files in a variety of options, and let the user’s browser choose the one that’s best for them.

<video controls>
  <source src='dogs-in-AV1.mp4' 
          type='video/mp4 codecs="av01.0.19M.10.0.110.09.16.09.0, mp4a.40.5" '>
  <source src='dogs-in-HEVC.mp4' 
          type='video/mp4 codecs="hev1.2.4.L120.B0", mp4a.40.2" '>        
  <source src='dogs-in-VP9.webm' 
          type='video/webm codecs="vp9, vorbis" '>
</video>

In this example, the three options are compressed using AV1, HEVC (H.265), and VP9 video codecs, while being delivered in two video file formats: MP4 and WebM. That’s because compressed videos are delivered across the web inside a media container that has its own file format, like MPEG-4, WebM, Ogg, or QuickTime MOV. That container holds both the video stream, compressed in a particular codec, and the audio stream, compressed in another codec.

As a developer, you use the source element to link to each file, list the type of file, and specify the codecs being offered — providing the browser with the information it needs to decide which file to start streaming. The type attribute specifies the MIME type of the container, along with codec information about how the video and audio are each compressed. The browser will use the first file that it fully supports.

The AV1 codecs parameter string can communicate not only that the video is compressed with AV1, but other characteristics of the video, including the color space and dynamic range. For example, you could use av01.0.19M.10.0.110.09.16.09.0 for a video compressed with AV1 Main Profile, level 6.2, Main tier, 10-bit HDR. That’s basically asking the browser “do you support AV1 with a 10-bits-per-color and HDR colorspace? If so, here’s a file for you.” You could instead use a simpler version, codecs="av01", to ask only “hey, do you support AV1?”

Managed Media Source

Watching streaming video is an amazing thing we all do with our devices. But to get the highest-possible quality of video, without downloading any unnecessary data and without killing the battery — it takes a complicated stack of technology working under the hood every time you hit the play button.

Adaptive bitrate streaming is a technique for switching between media data formats on the fly, to ensure delivery of the best-possible video quality based on the speed of the internet connection and capabilities of the device, even as those conditions change. For example, adaptive streaming can be configured to switch from 4k to HD resolution when the network slows, to prioritize playback-without-lag over higher-visual-quality.

For years, many websites have used Media Source Extensions (MSE) to handle adaptive bitrate streaming. It’s a low-level toolkit that gives the web page more control and more responsibility for managing buffering and resolution. But MSE isn’t particularly good at managing buffer levels, network access, and media variant selection. Plus, it uses a lot of power, which can be especially painful on mobile devices with smaller batteries.

Managed Media Source is a brand-new, power-efficient solution that fulfills advanced needs for streaming video. It supports the flexibility and capabilities of MSE, without any of the drawbacks.

WebKit for Safari 17.0 brings the new Managed Media Source API to iPad and Mac, with iPadOS 17, macOS Sonoma, macOS Ventura, and macOS Monterey. Managed Media Source is also coming to iPhone with iOS 17.1 beta.

Note that support for Managed Media Source is only available when an AirPlay source alternative is present or remote playback is explicitly disabled.

const videoSource1 = document.createElement('source');
videoSource1. type = 'video/mp4' ;
videoSource1.src = URL.createObjectURL(mediasource);
video.appendChild(videoSource1) ;
const videoSource2 = document.createElement('source');
videoSource2. type = 'application/x-mpegURL' ;
videoSource2.src = "http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8";
video.appendChild(videoSource2);

Learn all about Managed Media Source API by watching Explore media formats for the web at WWDC23.

Media player stats overlay

Video in a video player, with an overlay showing the stats for that video.

If you’ve enabled Developer Features, Safari now provides a media player stats overlay where you can see technical details about a video — its source type, size, performance metrics, resolution, codec string, and color configuration. To show the overlay, use the context menu on any <video> element and select “Show Media Stats”. Now you can tell at a glance the exact codec and configuration used by media on your page and use that information to help you write your code, including craft accurate queries in MediaCapabilities.

And more video and audio

Safari 17.0 on macOS Sonoma adds support for stereo-only Opus in WebM and MPEG-4 containers.

WebKit now supports USB cameras on iPadOS 17. When a USB camera is attached to an iPad, it’s included in the output of enumerateDevices and is selectable with getUserMedia along with the built-in cameras.

Improvements to WebRTC add support for InputDeviceInfo, the inbound rtp trackIdentifier stat field, exposing zoom in MediaTrackCapabilities, and getDisplayMedia video track clone resizing.

WebKit for Safari 17.0 adds additional support for low-power mode and optimizing video streaming by tone mapping HDR video to SDR.

And Safari 17.0 adds support for WebCodecs temporal scalabilityMode for software codecs, including parsing and error handling.

Web apps on Mac

Safari 17.0 for macOS Sonoma will be available September 26. And with it, web apps come to Mac.

A web app for WebKit Blog shown on macOS Sonoma. With three other web apps as Stage Manager windows off to the side. And four web app icons in the doc. Plus a push notification coming in from the WebKit web app.

You can add a website — any website — to your Dock. In Safari, go to File > Add to Dock, adjust the name and icon if desired, and the web app icon appears in your Dock.

Web apps on Mac let you focus on the websites you use all the time, separate from the rest of your browsing. Like all Mac apps, web apps work great with Stage Manager, Mission Control, and keyboard shortcuts like Command + Tab. Web apps can be opened from the Dock, Launchpad, and Spotlight Search. Web apps work with AutoFill credentials from iCloud Keychain and from third-party apps that have adopted the Credential Provider Extension API. And users can grant permission to a web app to use their camera, microphone and location in the same way they grant such permissions to other Mac apps through system prompts and the Privacy & Security section of System Settings. Web apps on Mac support web push, badging, service workers, web app manifests, and all the usual web standards implemented by WebKit, just like web apps on iOS and iPadOS.

When a user clicks on a web app icon, the website always opens in its own window as a web app, even if the site does not have a manifest file (or legacy meta tags). This expands the usefulness of web apps, putting users in charge of determining what becomes a web app and giving them the confidence it’s always something they can choose.

While the default web app experience on Mac is great, as a web app developer you can use web technologies like Service Workers to make it even better. By providing a web app manifest, you can customize the presentation of your web app, including the display mode, name, theme color, and start URL. Learn about the details by watching What’s new in Web Apps at WWDC23.

When a user adds a website to their Dock, Safari will copy the website’s cookies to the web app. That way, if someone is logged into their account in Safari, they will remain logged in within the web app. This will only work if the authentication state is stored within cookies. Safari does not copy over any other kind of local storage. After a user adds a web app to the Dock, no other website data is shared, which is great for privacy.

Add to Home Screen from Safari View Controller

Add to Home Screen is now available from Safari View Controller on iOS 17 and iPadOS 17. Tapping a link within an app that uses Safari View Controller as the in-app browser allows the user to add the open website to their Home Screen right from there. Just like Add to Home Screen from Safari on iOS and iPadOS (or any other browser that implemented support), if the website has a manifest file with a display mode of standalone or fullscreen, it will open as a Home Screen web app.

Web Developer Tools

Safari 17.0 brings significant changes to the experience of our web developer tools. Be sure to enable Developer Features to gain access to the Web Inspector, Develop Menu, Feature Flags, Responsive Design Mode, the ability to connect to iOS / iPadOS / visionOS Simulators, and much more.

Redesigned Develop Menu

In Safari 17.0 on macOS Sonoma, macOS Ventura and macOS Monterey, a completely redesigned Develop menu makes it easier to find the key tools available to help you create websites, web apps, web content inside other apps, web extensions, and more.

the new Safari 17 Develop menu, with far fewer items, showing icons for iPhone and iPad

Devices and simulators are now more prominent in the Develop menu, making them easier to identify at a glance. Inside the menu for each iOS or iPadOS device, app icons make it easier to find the application or web content you want to inspect. On macOS Sonoma, you can pair with Apple TV and Vision Pro directly from Safari to inspect those platforms.

Rethought Feature Flags

the Safari feature flag settings window with a list of technologies, some on, others off.

The new Feature Flags panel replaces the previous Experimental Features section of the Develop menu, allowing you to search for specific features and to easily see bolded features toggled from their default state. Feature flags are now organized by topic: Animation, CSS, HTML, JavaScript, Media and more. And each feature is clearly categorized into one of four statuses: Stable, Testable, Preview, and Developer.

Stable represents features that have recently shipped in Safari, on by default. These features can be turned off to help you debug an issue or test progressive enhancements. Stable features will eventually be removed from the list.

Testable features are disabled by default. These features might be in the process of being implemented, or they might be waiting for changes to the web standards. They have a ways to go, but still could be interesting enough to test out.

Preview is for features that have not yet shipped in Safari, but are closer to being complete. These features are on by default in Safari Technology Preview, and are ready for developers to try out. They may still have bugs, or may even undergo significant change as their web standards evolve. This is a great time to help find bugs and file issues, and to comment on whether the web standard for a new technologies solves your needs.

Developer features are not as common. This category is for miscellaneous features added to the list of feature flags so developers can toggle them on and off for testing. New developer tools may appear here, for example.

New Developer settings panel

the new Safari Developer settings window, listing what can be toggled

The new Developer panel in Safari 17’s Settings let you toggle developer features that apply across all websites open in Safari, like Allow remote automation (which enables automating Safari with WebDriver) and other features that were previously in the Develop menu.

New tab-specific setting overlay

Web Inspector tab-specific settings overlay

Some previously-global settings from the Develop menu, like disabling JavaScript or changing WebRTC behavior, have moved to Web Inspector where they are now scoped to the inspected tab, allowing you to use other tabs and windows normally.

Redesigned Responsive Web Design Mode

Redesigned Responsive Design Mode in Safari with configurable viewport size, scale, and simulator menu

Responsive Design Mode has also been refreshed to focus on the responsiveness of a page’s design at any width or height on your Mac. You can type in a specific viewport size at the top of Responsive Design Mode in addition to dragging the resize handles around the view.

Also new is the ability to open the page in a Simulator right from Responsive Design Mode.

Simulators

You can also open any page from Safari in a Simulator directly from the Develop > Open Page With menu, even when you are not using Responsive Design Mode.

Using a Simulator is a great way to test the experiences you’re making on iOS, iPadOS, and visionOS — including device-specific behaviors, like the rendered size of type, the effects of the viewport meta tag, double-tap to zoom, and even Home Screen web apps on iOS and iPadOS. Simulators are free, and come included with Xcode from the Mac App Store.

macOS Sonoma with a simulated iPhone on screen, showing a website. The Develop menu is open, with the user selecting the website in that simulator.

If you don’t have Xcode installed, a link to documentation is conveniently available in the Develop > Open Page With menu to help you get started, or to add more devices and OS versions.

Learn all about the new Develop menu, redesigned Responsive Web Design mode, how to easily connect to directly to a real device, how to install and use a Simulator, and much more in Rediscover Safari developer features at WWDC23.

Web Inspector

We’ve also made improvements to Web Inspector. When working with minified sources, pretty printing in Web Inspector can help make the code easier to read, set breakpoints in, and debug. New in Safari 17.0, more JavaScript syntax is supported for pretty printing minified scripts, including template strings, optional chaining, private variables and functions in classes, and static variables and functions.

Changes to Web Inspector in Safari 17.0 also include:

  • Elements tab: Added settings to always show rulers and element overlays for grid and flexbox when highlighting elements in Web Inspector or in Element Selection Mode.
  • Elements tab: Added editing controls for variation axes in the Fonts sidebar.
  • Console tab: Added setting to show timestamps for console messages.
  • Console tab: Added support for viewing the target of a WeakRef.
  • Sources tab: Added support for ES2022 Private Fields when inspecting and logging JavaScript objects.
  • Graphics tab: Added support for OffscreenCanvas.

Learn more by watching What’s new in Web Inspector at WWDC23.

Security

GPU Process

Last year brought GPU process support to WebKit on iOS, iPadOS and watchOS. This year we’re adding support on macOS Sonoma. The change moves all drawing (including the drawing of page content, 2D Canvas and WebGL rendering) so it occurs in the “GPU Process”. This new architecture allows WebKit to isolate powerful graphics hardware and driver access away from the WebContent process, which is the process that interacts with untrusted content from the internet. The new design also allows the WebContent process sandbox to completely block IOKit access, resulting in improved security.

WebKit API

New interfaces are added to WKWebsiteDataStore and related classes to further unlock potential of your WebKit apps. The new capabilities include creating persistent website data stores, configuring cookie policy, customizing proxy settings, requesting HTTPS upgrade for all navigations, and controlling state of inline prediction for autocomplete.

Browser changes

Safari Profiles

Safari 17.0 adds support for profiles. History, favorites, Tab Groups and website data such as cookies, caches, service workers, and Web Push subscriptions are scoped per-profile. Users can manage each profile’s data individually.

Safari Private Browsing

In Safari 17.0, Private Browsing gets even more private with added protection against some of the most advanced techniques used to track you. Technical changes include:

  • Blocking for known trackers and fingerprinting.
  • Support for mitigating trackers that map subdomains to third-party IP addresses.
  • Blocking for known tracking query parameters in links.
  • Noise to fingerprintable web APIs.
  • Console log messages when blocking requests to known trackers.
  • Support for blocking trackers that use third-party CNAME cloaking.
  • Support for Private Click Measurement for direct response advertising, similar to how it works for in-app direct response advertising.

Editing and Live Text

iOS 17, iPadOS 17, and macOS Sonoma feature a redesigned experience of editing text, with even more accurate autocorrect and predictions inline as you type. In Safari 17.0 on macOS Sonoma, the redesigned text cursor now uses the system accent color, just like iOS. CJK marked text also has a new appearance and matches the system accent color.

Safari 17.0 also improves the interoperability of the Range API and Selection API. And it adds Live Text support for vertical text recognition in images and videos.

Apple Pay via Payment Request API

You can now enable Apple Pay to be used in third-party iframes by setting the allow="payment" attribute. This “permissions policy” enables the Payment Request API on an iframe, allowing you to embed third-party payment handlers. If using this feature, be sure you also use the X-Frames-Options HTTP header to prevent your site from being embedded by malicious websites.

Authentication

Safari 17.0 adds support for largeBlob extension for passkeys. Websites can use the additional storage to save data that can later be retrieved when signing in with a passkey. These saved blobs are synced and shared along with passkeys.

We also are adding support for enterprise WebAuthn attestation for passkeys in iCloud Keychain. Managed devices can provide an attestation statement when creating passkeys, using a certificate provisioned through MDM.

Networking

Safari 17.0 adds support for HTTP Early Hints and preconnect.

Lockdown mode

Lockdown mode now:

  • Disables IndexedDB.
  • Disables the File API and FileReader API.
  • Disables support for the <embed> element.
  • Disables the Web Speech (Speech Synthesis) API.
  • Disables the WebLocks API.
  • Disables support for experimental APIs.
  • Supports select web fonts.

Lockdown Mode is also now supported in WebKit on watchOS.

Safari Extensions

Safari 17.0 now lets you customize where extensions run with even more granularity.

First, Safari App Extensions now have the same per-site permissions model as Safari Web Extensions. It puts users in control over the browsing data they share with every extension they use in Safari.

Second, as an additional layer of control, Safari Extensions can be turned off in Private Browsing. Extensions that access browsing data, like browsing history or webpage contents, will be off by default in Private Browsing but can be allowed with a single toggle in Safari Settings.

Third, all Safari Extensions can be turned on or off per Safari Profile. You can imagine this being useful for turning on an extension used only for school or work in a relevant profile, but keeping it off everywhere else. Each profile runs a separate instance of the extension — meaning there are unique storage areas, background pages, service workers, and more. However, per-site permissions are shared across profiles, so an extension only needs to be granted once. If your extension leverages native messaging capabilities to communicate with a host app, it’s possible to distinguish between profiles to ensure your extension behaves correctly across profiles.

Learn more by watching What’s new in Safari extensions at WWDC23.

Bug Fixes and more

In addition to the over 65 new features, WebKit for Safari 17.0 includes an incredible amount work polishing existing features.

Accessibility

  • Fixed aria-owns attribute for the radio role. (23630121)
  • Fixed incorrect accessible name from multiple <label>elements. (24033482)
  • Fixed HTML menu element to map to role=list. (55145117)
  • Fixed conveying focus movement when using aria-activedescendant to set the active cell within a grid. (84439987)
  • Fixed the wrong role displayed for input in Web Inspector. (103907008)
  • Fixed input[type=date] individual fields getting announced as “group”. (104928713)
  • Fixed VoiceOver when selecting “Sign in with Apple” on some websites. (105179300)
  • Fixed elements with the popovertarget attribute to expose expanded state to assistive technologies. (105425310)
  • Fixed some inputs not being treated as invalid despite being rendered as such. (105653691)
  • Fixed aria-errormessage to not be exposed when aria-invalid is false. (105813974)
  • Fixed form controls taking the accessibility text of an ancestor label over their own inner text. (106575817)
  • Fixed VoiceOver not reading entered text in text fields. (107226275)
  • Fixed labels for slot elements referenced with aria-labelledby. (107570512)
  • Fixed aria-describedby to be equivalent to aria-description and override it when both are present. (108386295)
  • Fixed slotted elements not being exposed to accessibility when inside <dialog> or aria-modal. (108704582)
  • Fixed some content on web pages not displaying on braille displays. (110758833)
  • Fixed: Prioritized HTML required attribute over aria-required when both are present. (111370591)
  • Fixed unexpected speech synthesis behavior for unordered lists. (112085797)

Canvas

  • Fixed createImageBitmap using ImageData to respect the premultiply flag. (89382358)
  • Fixed repaint issue when drawing VideoFrames to canvas. (109100283)

CSS

  • Fixed CSS @imports in HTML missing quote marks getting mistakenly hidden from the Preload Scanner. (46031271)
  • Fixed matching elements without a parent with the child-indexed pseudo-class. (91637426)
  • Fixed the bug that @supports selector() fails for all -webkit- prefixed pseudo elements. (95683424)
  • Fixed background-size to not accept unitless lengths. (97039770)
  • Fixed text-shadow and box-shadow with currentcolor. (102542182)
  • Fixed color() function incorrectly parsing missing components. (104679823)
  • Fixed text-emphasis marks to not be rendered if there is no emphasized character. (104688963)
  • Fixed: Improved image-set compatibility. (105097744)
  • Fixed values set by mask and background shorthands to not serialize as “initial”. (105114588)
  • Fixed :has() to support invalidation of :bufferingand :stalled pseudo-classes. (105163364)
  • Fixed cssText to follow CSS OM specifications. (105235157)
  • Fixed font-feature-settings and font-variation-settings to sort their tags alphabetically. (105483635)
  • Fixed transition-property: all to include custom properties. (105556538)
  • Fixed #x, such as 1x, to be recognized a resolution calc unit category. (105700660)
  • Fixed font variations for some fonts declared with CSS @font-face. (106635029)
  • Fixed applying certain user-agent styles to HTML elements, and not elements with other namespaces. (107162842)
  • Fixed image-set to accept zero resolution and clamp negative resolutions used in calc expressions. (107167273)
  • Fixed unknown function parsing in @supports rule. (107397723)
  • Fixed to not show cursor: pointer on unclickable <area>. (107591470)
  • Fixed CSSStyleValue.parse to accept properties from the document-derived context. (108249093)
  • Fixed invalidating the :dir() pseudo-class after removing the :dir content attribute from the document element. (108480507)
  • Fixed type() function for image-set() to only take one string. (108909363)
  • Fixed respecting style containment on list items. (109582377)
  • Fixed scrollbar to correctly pick up changed styles immediately. (109674102)
  • Fixed :has() to support invalidation of the :definedpseudo-class. (109896689)
  • Fixed cjk-earthly-branch and cjk-heavenly-stem counter styles to have fixed system. (110796633)
  • Fixed <ray-size> to be optional in ray() for CSS Motion Path. (110818689)
  • Fixed negative resolutions in Media Queries to be invalid. (110948170)
  • Fixed text-overflow: ellipsis so it works with overflow: clip. (111182654)
  • Fixed cjk-earthly-branch and cjk-heavenly-stem counter styles to fallback to cjk-decimal. (111208503)
  • Fixed inline-flex and inline-grid boxes to stop propagating underlines to align with other browsers. (111228920)
  • Fixed container units in a container query to evaluate against the ancestor container. (111446508)
  • Fixed cursor style to respect explicitly set cursor type over system default. (111469521)
  • Fixed container units to consider writing mode for unit resolution. (111565488)
  • Fixed @font-face { src: format() } to parse valid unsupported keywords. (112135869)
  • Fixed -webkit-box-decoration-break: clone with left and right padding causes unexpected wrapping of inline content. (112197978)

DOM

  • Fixed XML serialization to serialize implicit xmlns attributes first and use lowercase “ns” when generating prefixes. (103234827)

Editing

  • Fixed webpage translation for iframes. (59693219)
  • Fixed returning live range synchronized with selection from getRangeAt and throw errors as specified. (69015762)
  • Fixed selection API to work across shadow boundaries. (89481826)
  • Fixed webpage issues when translating to or from Ukranian. (100570016)
  • Fixed showing the software keyboard when programatically focusing a text field during a double-click event. (104600783)
  • Fixed “insertParagraph” to insert a <br> when the root editable element is phrasing content. (105438898)
  • Fixed “insertLineBreak” sometimes inserting a non-breaking space instead of a new line. (105439065)
  • Fixed an issue when breaking out of an empty list item in case of nested lists. (111724381)

Forms

  • Fixed CSS color getting adjusted for disabled input elements. (99826522)
  • Fixed input.validity reporting valid: true for partially completed dates and times. (102984901)
  • Fixed conditional passkey request presenting a conditional control even after AbortController.abort(). (104485543)
  • Fixed <input pattern> to use the regular expression v flag rather than u. (105268069)
  • Fixed saving recent searches on <input type="search">using the name attribute. (105369635)
  • Fixed HTML maxlength attribute treating emoji of string length 11 as length 1. (105926915)
  • Fixed HTMLOptionsCollection.length setter to use a limit of 100,000. (105988871)
  • Fixed reseting selection when changing multiple <select>to single. (106264081)
  • Fixed focus for a <summary> element with a tabindex. (106550778)
  • Fixed selecting text within a label element that is linked to an input field. (108566491)
  • Fixed textareas with overflow: hidden rendering too many columns. (109343502)
  • Fixed HTMLOptionElement text setter to not throw an exception. (109740566)
  • Fixed change event not firing when the user reverts the value of a color, date, or time input after JavaScript changed the value. (109843791)

HTML

  • Fixed handling unclosed parenthese at the end of the sizes attribute. (107509739)
  • Fixed the HTMLPreloadScanner to not preload scripts with unsupported types. (110905029)
  • Fixed popover incorrectly auto-hiding when using shadow DOM. (112410375)

HTTP

  • Fixed respecting Content-Type header for MIME type determination. (73343155)
  • Fixed a bug with empty header values in Headers objects with “request-no-cors” guard. (105207779)
  • Fixed Cross-Origin-Embedder-Policy incorrectly blocking an iframe on a cache hit. (107002434)
  • Fixed vary header behavior for opaque responses. (107769146)

JavaScript

  • Fixed: Improved performance of Object.entries() by 1.5×. (100783096)
  • Fixed /p{Number}--]/v; to be a syntax error. (109400589)
  • Fixed: Improved RegExp lookbehind character class backtracking. (111051833)
  • Fixed String#charAt to support out-of-bounds handling in DFG. (111421698)

Media

  • Fixed top CSS added to audio controls when the height of an <audio> element is adjusted on iOS. (99548840)
  • Fixed Netflix.com playback error S7381-1203. (103561991)
  • Fixed sound echos in higher speed video playback. (103940613)
  • Fixed SourceBuffer.timestampOffset behavior with WebM content. (105801920)
  • Fixed bufferedchange event to fire whenever an eviction occurs. (106168510)
  • Fixed MediaSource duration change algorithm to correctly update the duration. (106858912)
  • Fixed playing event to fire earlier. (107041118)
  • Fixed video playback failure for content that uses the prefixed WebKit EME APIs. (107202864)
  • Fixed Netflix.com playback error S7361-1253. (108052652)
  • Fixed video playback in Safari unexpectedly interrupting other apps playing audio. (108741963)
  • Fixed MediaRecorder producing empty chunks when attaching a MediaStream before the context in a canvas is created. (109705910)
  • Fixed muting capture in all other tabs when Safari starts camera and/or microphone capture in a tab. (109896538)

Rendering

  • Fixed rendering for border-image-repeat: round. (28213711)
  • Fixed text-overflow: ellipsis incorrectly truncating text in right-to-left mode. (29464657)
  • Fixed rendering fractional font sizes. (40829933)
  • Fixed rendering the label attribute for the <option>element on iOS. (53989128)
  • Fixed pixel artifacts when rendering background-clip: text and transform: rotate(…). (54325642)
  • Fixed text not getting truncated properly in vertical writing mode when overflow: hidden and text-overflow: ellipsis are set. (94330690)
  • Fixed CSS flexbox to use initial scroll position when computing the baseline. (100908615)
  • Fixed incorrect paint of translate property animation. (102064448)
  • Fixed statically positioned out-of-flow box location when display type changes from block to inline-block. (103637239)
  • Fixed <details> marker maintain the same margin in right-to-left as in left-to-right. (104275835)
  • Fixed table with fixed layout behaving like auto layout when its width is set by JavaScript instead of CSS. (105310280)
  • Fixed preserve-3d to apply to pseudo-element children. (105474987)
  • Fixed margins incorrectly accounting for before forced breaks in multi-column layout. (105631038)
  • Fixed placement of floats with clear. (105775276)
  • Fixed disabling <body> to root propagation when content: paint is set on the <body> or the root. (105850374)
  • Fixed self-collapsing children with an incorrect top offset at the end of a block container with margin-trim: block-end. (106524654)
  • Fixed ignoring calc() values on <colgroup> elements. (106692191)
  • Fixed a flash of mis-styled content due to a mechanism to block painting on a non-final style. (106805458)
  • Fixed text wrapping in a nested grid layout. (107002717)
  • Fixed width for a table flex-item inside inline-flexwith column flex-direction. (107029563)
  • Fixed repaint issue when adding text to a text box. (107038111)
  • Fixed incorrect out-of-flow box placement for display: inline content when text-align is not start. (107271178)
  • Fixed incorrect out-of-flow box placement for display: inline content when text-indent is present. (107280354)
  • Fixed incorrect out-of-flow box placement for display: inline content when a float is present. (107294351)
  • Fixed repainting newly position float boxes. (107318350)
  • Fixed out-of-flow inline content with a float and text-align. (107321638)
  • Fixed gradient object generation to be thread-safe. (107574124)
  • Fixed transform-style: preserve-3d preventing links when :after has a negative z-index. (107671388)
  • Fixed repainting MathML element in display: flex on content change. (107694159)
  • Fixed line-height to not affect the enclosing height. (107832246)
  • Fixed incorrect decorating box position in vertical writing mode. (107916341)
  • Fixed incorrect vertical positioning when an ideographic baseline is present. (107934783)
  • Fixed missing underline after the first character in contenteditable. (107996603)
  • Fixed rendering a checkbox in a flexbox layout. (108026194)
  • Fixed -webkit-line-clamp overlapping blocks even with overflow: hidden, when mixing <span> and <div>. (108116069)
  • Fixed content getting truncated too early due to subpixel flooring. (108570251)
  • Fixed negative letter-spacing breaking -webkit-box-decoration-break: clone. (108701795)
  • Fixed images with decoding="async" flickering while zooming in. (108930635)
  • Fixed overlapping list items when content has line-height: 0. (108988226)
  • Fixed alt text rendering horizontally in vertical writing mode. (109004347)
  • Fixed mapping align="abscenter" to vertical-align: middle (109081191)
  • Fixed complex text paths to not render visible tab glyphs. (109171681)
  • Fixed overflow: clip when an intrusive float is present. (109293228)
  • Fixed fragmentation of content with non-visible overflow when printing. (109320964)
  • Fixed incorrectly including the scrollbar thickness in the logical height of a textarea with overflow: auto. (109384976)
  • Fixed bordercolor attribute on table elements to not create a visible border. (109436009)
  • Fixed inline-level elements with a self-painting layer rendering overlapping ellipsis. (110408920)
  • Fixed list alignment when a list item has a flex container. (111217986)
  • Fixed canvas not showing the results of CanvasRenderingContext2D.putImageData until a forced re-render. (112901862)

Safari Extensions

  • Fixed the script API not returning a result when the funcparameter is used. (100034937)
  • Fixed WebNavigation events to no longer fire for webpages where the extension hasn’t been granted access. (100191647)
  • Fixed scripting.executeScript return types. (107044691)

Storage

  • Fixed removing HTTP credentials when the data store is removed. (106728064)

SVG

  • Fixed SVG textLength behavior. (32066826)
  • Fixed references for SVG fragments in shadow DOM trees. (64094920)
  • Fixed overflow="visible" having no effect on the dimension of a <use> element unless its dimensions are specified. (98577733)
  • Fixed mixed characters in right-to-left mode for SVG text. (101695671)
  • Fixed marker properties to allow any URI. (105483685)
  • Fixed text transformation not starting on initial render. (106485848)
  • Fixed <marker orient="-1"> to orient correctly. (109312083)
  • Fixed animateMotion to accumulate properly with rotate: auto or rotate: auto-reverse. (109489241)
  • Fixed nested use of the same SVG resource. (109917889)
  • Fixed computed display property for SVG elements. (109928375)
  • Fixed to not create an interval if a value in begin-value-list doesn’t have a matching value in end-value-list. (109935392)
  • Fixed textLength whitespace and chunk handling for <tspan> elements. (109981392)
  • Fixed the mapping from a point to a character index for the SVG <text> element. (110119702)
  • Fixed handling of a negative radius for feMorphology. (110504653)

Tables

  • Fixed table-layout: fixed not getting applied when the width is max-content. (105627723)
  • Fixed computing the percentage height of table cell children by removing the height of a horizontal scrollbar. (105627946)
  • Fixed percentage sizing of table cell replaced children with a scrollbar. (108459503)

Web Animations

  • Fixed logic to recompute keyframe styles to tie a change in computed keyframes on an accelerated animation while animating. (87766485)
  • Fixed handling transition-property: all to distinguish matching any CSS property or Animation object. (87785199)
  • Fixed keyframes to be recomputed when bolder or lighter is used on a font-weight property. (105098349)
  • Fixed the composite operation of implicit keyframes for CSS Animations to be “replace”. (105099774)
  • Fixed keyframes to be recomputed when a parent element changes value for a custom property set to inherit. (105099874)
  • Fixed the all value for the transition-property to parse as a keyword, not a CSS property. (105556116)
  • Fixed exposing CSSKeyFramesRule.length. (105565920)

Web API

  • Fixed Canvas context allocation failures due to exceeding the maximum canvas memory limit. (48609162)
  • Fixed firing an unexpected mousemove event when a modifier key is pressed. (81287778)
  • Fixed HTML comments added after <body> to not be included in document.body.innerHTML. (95557786)
  • Fixed serialization of Selectors. (97092572)
  • Fixed string serialization of functions to match other browsers. (97445158)
  • Fixed screen.colorDepth reporting the incorrect value on iOS. (99871925)
  • Fixed valid values for the as property in <link rel="preload">. (100161255)
  • Fixed: Improved GamePad compatibility with XBOX Cloud. (100337662)
  • Fixed: Improved Fetch API interoperability. (100582566)
  • Fixed the Content-Type for sliced blobs in fetch(). (101171705)
  • Fixed Blob range requests. (103171187)
  • Fixed: Adjusted text input scrollWidth and scrollHeight to include padding and any whitespace added by decorations. (104332108)
  • Fixed focus() method with delegatesFocus in Shadow DOM. (104927020)
  • Fixed Range APIs to construct and move trees in tree order. (105154132)
  • Fixed handling magnitude values passed to GamepadHapticActuator.playEffect(). (105175808)
  • Fixed Gamepad.vibrationActuator.type to be dual-rumble. (105175859)
  • Fixed location.href to throw a SyntaxError on a URL parser failure. (105631453)
  • Fixed the natural screen orientation on iPad and TV to be landscape-primary. (106062507)
  • Fixed postMessage for cross-origin iframes. (106439413)
  • Fixed Worklet.prototype.constructor. (106533500)
  • Fixed innertHTML serialization to not have special handling for javascript: URLs. (107362610)
  • Fixed not escaping <, >, &, and non-breaking space characters inside <noembed>, <noframes>, and <plaintext> elements when scripting is enabled. (107381507)
  • Fixed CacheStorageManager creating a “salt” file in the current working directory when there is no path. (107387306)
  • Fixed to no longer recognize the SVG contentScriptType, contentStyleType, and externalResourcesRequired attributes, and the XML xml:base attribute. (107428878)
  • Fixed Non-UTF-8 encoders to correctly emit the U+FFFD code point instead of surrogate code points. (107530253)
  • Fixed document.applets to no longer return any elements. (107926196)
  • Fixed data: URLs to behave the same everywhere. (107982669)
  • Fixed missing movementX and movementY in pointermove events. (108112600)
  • Fixed Wake Lock permission denied after visibilitychange. (108279602)
  • Fixed <frameset> inside <template> to be ignored. (109081113)
  • Fixed node depth computation for shadow nodes in ResizeObserver. (109166329)
  • Fixed WebSocket’s binaryType setter to not throw. (109192086)
  • Fixed exposing DeviceMotionEvent and DeviceOrientationEvent on the global Windowobject on macOS. (109580299)
  • Fixed remaining page height to never be 0. (109929893)
  • Fixed changing the dir attribute of documentElementnot updating a child element matching the :dir pseudo-class. (109976294)
  • Fixed: Set canvas-based VideoFrame color space to RGB. (110062111)
  • Fixed window.stop() to fire abort events on XMLHttpRequest asynchronously. (110086856)
  • Fixed selecting an OptGroup label not unselecting the selected item. (110088331)
  • Fixed <select> with multiple enabled not consistently firing the onchange event. (110274850)
  • Fixed style invalidation of IDs within :nth-child and :nth-last-child. (110451692)
  • Fixed MediaStream from a canvas (captureStream) to be able to render into a different canvas. (110696945)
  • Fixed XMLHttpRequest.responseXML.characterSet. (110863647)
  • Fixed window named getter to behave correctly when there are duplicate frame names. (110864556)
  • Fixed: Throttled mousemove events to one per rendering. (110921187)
  • Fixed Service Worker redirect losing the hash fragment. (111208014)
  • Fixed camera RAW files picked via file input getting returned as PNG on change. (111231838)
  • Fixed emoji characters sometimes getting incorrectly drawn in text style. (111411175)
  • Fixed HTMLTableSectionElement.insertRow(0) and HTMLTableRowElement.insertCell(0). (111791597)
  • Stopped parsing <command> as if it has no end tag. (107416609)
  • Removed vestigal support for <layer> and <nolayer>from the HTML parser. (107554605)
  • Removed deprecated uppercase URL attribute alias on the WebSocket interface. (109151597)

Web apps

  • Fixed passing NotificationOptions.silent. (107424158)
  • Fixed: Started using origin directory for DOMCache and ServiceWorkerRegistrations. (107843591)
  • Fixed Notifications API to default silent to the platform convention. (109390045)
  • Fixed Web Push notifications not working in some cases by running the service worker before firing the activateevent. (109411104)
  • Fixed service worker downloads failing when chunks are sent via postMessage. (109561888)
  • Fixed firing controllerchange event when a service worker gets deleted. (109567316)

Web Inspector

  • Fixed removing a CSS declaration when tabbing though the CSS selector in the Styles panel. (100492875)
  • Fixed Step Over behaving like Resume when stepping over a function with a falsy conditional breakpoint in the Sources tab. (101604843)
  • Fixed the box model to indicate a margin has been trimmed with margin-trim. (103374677)
  • Fixed “Inspect Element” not highlighting the selected element. (105177739)
  • Fixed display of color-mix CSS in the Styles sidebar of the Elements tab. (105732322)
  • Fixed failing to add a new CSS rule on the first attempt in the Elements tab. (106751396)
  • Fixed Web Inspector to not show the accessibility role in hover tooltips for elements where accessibility is ignored. (106771408)
  • Fixed missing console logging that occurs during main frame navigation in the Console tab. (106877298)
  • Fixed cleared items in the Network tab reappearing when Preserve Log is enabled. (107639797)
  • Fixed incorrect timestamps in the Console tab. (107660054)
  • Fixed non-enumerable properties appearing as though they are internal properties in the Console tab. (108005425)
  • Fixed internal properties not greyed-out in object previews in the Console tab. (108007438)
  • Fixed private symbols to be omitted in the scope chain. (108674026)
  • Fixed an issue where the width of the Sources details sidebar would reset when switching between Web Inspector tabs (109253229)
  • Fixed the error message for new URL("/") to be more explicit. (109253920)
  • Fixed editing for Local Storage that appears truncated. (109473191)
  • Fixed the resource type shown in the Network tab to use XHR when the XHR request has the same URL as the main resource. (110016863)
  • Fixed color swatch to not show an incorrect tooltip when read-only. (110409252)

WebGL

  • Fixed firing the context lost event for OffscreenCanvas. (104198422)
  • Fixed OffscreenCanvas to work as a TexImageSource in WebGL. (106700463)

WebRTC

  • Fixed preventing the display from going to sleep when the camera is on. (100423979)
  • Fixed layer context handling for the HTMLMediaElement. (105795272)
  • Fixed ending a muted microphone track when its device disappears. (108194510)
  • Fixed camera selection to use the system preferred camera on iOS. (109220107)
  • Fixed camera and microphone to all have groupIds. (109355290)

Feedback

We love hearing from you. Send a reply on X to @webkit to share your thoughts on Safari 17.0. You can find us on Mastodon at @jensimmons@front-end.social and @jondavis@mastodon.social. If you run into any issues, we welcome your feedback on Safari UI, or your WebKit bug report about web technologies or Web Inspector. Filing issues really does make a difference.

Download the latest Safari Technology Preview to stay at the forefront of the web platform and to use the latest Web Inspector features. You can also read the Safari 17.0 release notes.

September 18, 2023 05:00 PM

September 06, 2023

Release Notes for Safari Technology Preview 178

Surfin’ Safari

Safari Technology Preview Release 178 is now available for download for macOS Sonoma beta and macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

This release includes WebKit changes between: 266624@main…267312@main.

Web Inspector

  • Added color palette with CSS variables in color picker (266794@main)
  • Moved the details sidebar to the bottom when Web Inspector is too narrow (266784@main)

CSS

  • Implemented counter-set property (267137@main)
  • Fixed counter values to prevent them from overflowing or underflowing (266817@main)
  • Fixed <resolution> to not accept negative resolutions for @property (267134@main)
  • Fixed currentcolor to correctly inherit computed :visited style (267139@main)
  • Fixed color-mix() to respect :visited style to resolve “currentcolor” (267271@main)
  • Fixed baseline aligned flex items to also be aligned using their fallback alignment (267026@main)
  • Fixed border-image to fall back to the border property if the image is invalid (266749@main)
  • Fixed the scripting media query to never match initial-only (267198@main)
  • Fixed font-size-adjust toggling font sizes for system-ui font (266771@main)
  • Fixed :user-invalid and :user-valid interactions with form reset and submission (266702@main)
  • Added the support for mixed percentage and length/number arguments in CSS step functions (267072@main)

CSS Container Queries

  • Fixed container unit resolution to check if the selected container is eligible (267192@main)
  • Fixed container-name to use scoped names (267163@main)
  • Fixed container selection for container units in pseudo-elements (267197@main)
  • Fixed container query with font units to invalidate when the font changes (267258@main)

JavaScript

  • Enabled import attributes (266957@main)
  • Added support for Intl.NumberFormat‘s FormatApproximately operation (266645@main)
  • Changed Intl.DurationFormat digital’s default from narrow to short (266891@main)
  • Fixed a positive look-behind RegExp with alternatives of different minimum lengths (266912@main)
  • Increased minimumFractionDigits and maximumFractionDigits limit from 20 to 100 (266879@main)
  • Updated Intl.DateTimeFormat‘s to obtain options only once, matching spec changes (266868@main)
  • Updated Intl.NumberFormat and Intl.PluralRules roundingIncrement handling (267123@main)

SVG

  • Added the missing default value translate for animateTransform (266758@main)
  • Fixed paint-order property to inherit (267002@main)
  • Fixed SVG filters to prevent them from leaking visited hyperlinks (266683@main)

Accessibility

  • Fixed an issue where innerHTML and innerText changes to labels did not update their corresponding input element’s accessibility title (266919@main)

Media

  • Added support for negative timestamps of TextTrackCue (267042@main)
  • Fixed vertical multiline WebVTT captions getting cut off (267162@main)

IntersectionObserver

Web API

  • Enabled Fetch Priority by default (267196@main)
  • Enabled requestIdleCallback (267023@main, 266750@main)
  • Made event loop to execute idle callbacks at the end of each task (266877@main)
  • Enabled responsive images in <link rel=preload> (266787@main)
  • Added the change event for the Cookie Store API (266850@main)
  • Added more restrictions for top-frame navigations by a third-party iframe (266666@main)
  • Added support for from-image to ImageBitmapOptions (266893@main)
  • Changed navigable target names to _blank if they have dangling markup (267154@main)
  • Fixed ServiceWorkerRegistration data deletion (266882@main)
  • Fixed details element to use ToggleEvent for toggle events (267076@main)
  • Fixed SpeechSynthesisUtterance to not get GC’ed if there is a pending event (267161@main)
  • Added the support for key pair checks for Ed25519 in WebCrypto (267184@main)
  • Added basic support for SVGImageElement in createImageBitmap (267218@main)
  • Fixed <a> and <area> origin getters to return an empty string for non-parsable URLs (267222@main)
  • Fixed <a> and <area> protocol setters for non-parsable URLs (267265@main)

WebGL

  • Fixed WebGL to not send a non-standard webglcontextchanged event (266861@main)

September 06, 2023 09:37 PM

August 30, 2023

Building Profiles with new WebKit API

Surfin’ Safari

Profiles are useful. They allow users to organize their data into categories and manage them separately. Users can create different profiles for different purposes and delete any profile without worrying about messing with data from another profile. Profiles also make it easier to access different online identities. Users with multiple accounts on the same site can simultaneously log into them within different profiles. They don’t need to keep logging in and out to switch between accounts because cookies are separate between profiles.

An essential requirement to implement profiles is to have separate containers for website data. In WebKit, this means the client needs to have different data stores. Before macOS 14 and iOS 17, WebKit clients could have multiple non-persistent data stores, but only one persistent data store — the default one. Non-persistent data stores do not store data to disk, so they cannot be retained across sessions.

In macOS 14 and iOS 17, we’ve introduced a new set of APIs to let clients create and manage multiple persistent data stores. Let’s take a look at how to use them to build a “profiles” feature for your app.

Create a profile

When a user creates a profile, you can create a custom persistent WKWebsiteDataStore. To do that, you should provide an identifier that can uniquely identify the store. You will need to remember the identifier so the data store can be retrieved and the profile can be restored when your app relaunches.

let profileIdentifier = UUID()
let profileDataStore = WKWebsiteDataStore(forIdentifier: profileIdentifier)

Then you can assign the newly created WKWebsiteDataStore to a WKWebView via configuration, and use WKWebView to load web content using the new profile, see https://developer.apple.com/documentation/webkit/wkwebview/ for example.

let configuration = WKWebViewConfiguration()
configuration.websiteDataStore = profileDataStore
let webView = WKWebView(frame: .zero, configuration: configuration)

Delete a profile

When a user deletes a profile, you can delete its data store based on its identifier. The operation can fail if the specified data store is still in use, for example, by an active WKWebView that is displaying web content, or if there is a file system error. You will need to catch and handle the error properly.

do {
    try await WKWebsiteDataStore.remove(forIdentifier: profileIdentifier)
} catch {
    print("Removing profile failed with error: \(error)")
}

To find out if a WKWebView is using a data store, you can get the identifier of a WKWebsiteDataStore. Note that non-persistent WKWebsiteDataStores and the default WKWebsiteDataStore do not have identifiers.

if webView.configuration.websiteDataStore.identifier == profileIdentifier {
    print("Profile is in use")
}

Retrieve an existing profile

With the identifier, you can retrieve an existing data store. However, that would create a data store if one does not exist yet. If you just want to check if a data store with a specified identifier exists, not create it, you can use fetchAllDataStoreIdentifiers to get all the identifiers.

let identifiers = await WKWebsiteDataStore.allDataStoreIdentifiers
if !identifiers.contains(profileIdentifier) {
    print("Cannot find profile")
}

What’s next?

A profile may contain many other types of data belonging to the client, and not to WebKit, such as per-site settings, bookmarks, browsing history, etc. Those types are not covered by this API and you may need to separate them too to make the profile experience more complete.

If you want to add support for profiles in your app, trying out the new WebKit APIs is definitely a good start and an essential step. If you have any feedback or encounter any issue when using the API, please let us know by filing a bug on bugs.webkit.org.

August 30, 2023 04:00 PM

August 22, 2023

Release Notes for Safari Technology Preview 177

Surfin’ Safari

Safari Technology Preview Release 177 is now available for download for macOS Sonoma beta and macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

This release includes WebKit changes between: 266419@main…266623@main.

Web Inspector

CSS

  • Fixed mod() evaluation (266485@main)
  • Fixed round() evaluation when the number is a multiple of the step (266504@main)
  • Fixed computing the correct overflow-x and overflow-y values for <table> elements (266560@main)

Rendering

  • Fixed out-of-flow <br> to not trigger a line break (266475@main)

Popover

  • Fixed popover incorrectly auto-hiding when using shadow DOM (266457@main)

Media

  • Fixed fullscreen ready check to remove the hierarchy requirement (266426@main)
  • Fixed videos disappearing when switching from landscape to portrait (266531@main)
  • Fixed pausing media playback after suspending media playback to correctly pause after media playback is unsuspended (266590@main)

JavaScript

  • Optimized Array#splice to skip result array creation if it is not used at all (266591@main)

Web API

  • Fixed intermittent removal of adoptedStyleSheet CSSStyleSheet instances when assigning an adoptedStyleSheet array (266464@main)
  • Fixed keyboard scroll not stopping after pressing the down arrow if keyup is default prevented (266425@main)
  • Fixed window.postMessage with OffscreenCanvas with an isolated world message listener (266465@main)

Accessibility

  • Fixed non-accessible content within iframes with ARIA roles (266506@main)
  • Fixed VoiceOver word echo on text inputs with a combobox role (266569@main)

Apple Pay

  • Deprecated enabled in favor of available in shippingContactEditingMode (266493@main)

August 22, 2023 09:30 PM

August 10, 2023

Updates to Storage Policy

Surfin’ Safari

A website can store data on a user’s device using various storage APIs: localStorage, IndexedDB, File System, etc. It’s an important capability allowing websites to be functional offline with good performance by serving local resources. However, the storage capacity is not unlimited. In fact, it is usually much smaller than a device’s disk size. Bad things could happen when the capacity is full like failed storage operations or data eviction. As a web developer, understanding storage policy helps to avoid these unexpected results. This post will discuss the latest storage policy in WebKit apps including Safari.

Scope

There are many types of website data, and the policy discussed in this post is mostly related to the types created by storage APIs: localStorage, Cache API, IndexedDB, Service Worker, and File System. Other types like cookies and HTTP cache are currently not subject to the policy below — for example, they are not bounded by quota.

Storage Quota

Storage quota defines how much data can be stored. There are two types of quota in WebKit: origin quota and overall quota.

Origin quota

The origin quota is the storage limit of one origin. If the limit is reached, the storage operation that requires space will fail, and a QuotaExceededError exception will be thrown. Starting in Safari 17.0, and in WebKit apps for iOS 17, iPadOS 17 and macOS Sonoma:

  • For a browser app, the origin quota is up to 60% of the total disk space.
  • For other apps, the origin quota is up to 15% of the total disk space.

An app is a browser app if it can be set as default browser (see Apple Developer documentation). With this change, Safari 17.0 no longer prompts users about a website wanting to use more space.

A cross-origin frame uses a different storage partition than the frame it is embedded in to prevent tracking, and thus it has a different quota. The quota is currently 10% of the main frame’s origin quota.

Overall quota

The overall quota is the storage limit of all origins. Reaching the limit can lead to data eviction, which releases storage used by the app. Starting in Safari 17.0, and in WebKit apps for iOS 17, iPadOS 17 and macOS Sonoma:

  • For a browser app, overall quota is up to 80% of the total disk space.
  • For other apps, overall quota is up to 20% of the total disk space.

When a web app is running standalone (as Home Screen Web App on iOS or Web App added to dock on macOS), it has the same origin quota and overall quota as when it is opened in a browser app.

Storage Eviction

Eviction means automatic website data deletion that is not initiated by the user or website. It can happen under a few conditions: when exceeding the overall quota, when the system is under storage pressure, or when the site has not been interacted with by the user for some time (see Intelligent Tracking Prevention).

WebKit normally evicts data on an origin basis: the data of an origin will be deleted as a whole. The ordering of origins to be deleted is decided using a least-recently-used policy. The last use time is the time of the last user interaction, or the time of the last storage operation.

Origin might be excluded from eviction if it has active page at the time of eviction, or its storage is in persistent mode. By default, all origins use a best-effort mode, which means their persistence is not guaranteed and their data can be evicted. An origin can request persistent mode using the Storage API introduced below.

Storage API

Different browsers may have different storage policies, and the Storage API provides a standard way for a website to get information about the current storage policy. Starting in Safari 17.0, and in WebKit apps for iOS 17, iPadOS 17 and macOS Sonoma, the Storage API is fully supported.

An origin can get estimated usage and quota values with StorageManager.estimate(). Usage indicates how much space is already used, and the quota is the origin quota.

if (navigator.storage && navigator.storage.estimate) {
    const storageEstimate = await navigator.storage.estimate();
    const availableSpace = storageEstimate.quota > storageEstimate.usage ? storageEstimate.quota - storageEstimate.usage : 0;
}

Note that the quota is an upper limit of how much can be stored — there is no guarantee that a site can store that much, so error handling for QuotaExceededError is necessary. Also, to reduce fingerprinting risk introduced by exposing usage and quota, quota might change based on factors like existing usage and site visit frequency.

An origin can check whether storage is in persistent mode with StorageManager.persisted() and request to change the mode to be persistent with StorageManager.persist(). WebKit currently grants a request based on heuristics like whether the website is opened as a Home Screen Web App.

if (navgator.storage && navigator.storage.persisted) {
    const persistent = await navigator.storage.persisted();
    if (!persistent && navigator.storage.persist)
        const result = await navigator.storage.persist();
}

If your website or web app uses storage APIs and expects to store a lot, you should adopt the Storage API to make most out of limited space. If you have any feedback or encounter an issue, please file an issue on bugs.webkit.org under component “Website Storage”.

August 10, 2023 04:00 PM

August 09, 2023

Release Notes for Safari Technology Preview 176

Surfin’ Safari

Learn about the latest web technology updates in Safari Technology Preview: CSS, Rendering, Accessibility, Media, and Web API.

Overview

Safari Technology Preview Release 176 is now available for download for macOS Sonoma beta and macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

This release includes WebKit changes between: 266088@main…266418@main.

CSS

  • Added support for contain-intrinsic-size: inherit (266100@main)
  • Implemented linear(...) timing function for CSS animations & transitions (266195@main)
  • Fixed auto none support for contain-intrinsic-size (266136@main)
  • Fixed computing <hr> width attribute set to 0 or 0px (266418@main)

Rendering

  • Fixed out-of-flow boxes not showing (266366@main)
  • Fixed canvas not showing the results of CanvasRenderingContext2D.putImageData until a forced re-render (266397@main)
  • Fixed scrollbar not updating on CSS color-scheme change (266176@main)
  • Prevented invalidating columns when the entire table is being destroyed (266344@main)

Accessibility

  • Fixed display: contents elements sometimes missing their children (266407@main)
  • Fixed incorrect accessible name from multiple <label> elements (266151@main)
  • Fixed unexpected speech synthesis behavior for unordered lists (266383@main)

Media

  • Implemented automatic text track selection for 'metadata' tracks (266380@main)
  • Fixed RTCRtpSender maxFramerate encoding parameter having no effect (266128@main)
  • Fixed updating time stamps on media controls to update while scrubbing the timeline (266339@main)

Web API

  • Added support for the title attribute for pattern validation errors (266311@main)
  • Aligned naturalWidth and naturalHeight with spec, changing from int to unsigned (266302@main)
  • Changed to return opaque origin for blob: URL containing inner non-http(s): URL (266247@main)
  • Converted embed hidden into a proper boolean attribute (266399@main)
  • Throttled mousemove events to one per rendering update (266341@main)
  • Fixed ElementInternals.setFormValue(<nullish value>) to clear the submission value (266126@main)
  • Fixed custom highlight logic for checking author and set text color (266117@main)
  • Fixed custom highlight text decoration to respect priority (266184@main)
  • Fixed emoji characters sometimes getting incorrectly drawn in text style (266089@main)
  • Fixed URL pathname and search setter incorrectly stripping trailing spaces (266252@main)
  • Handled focusability for plugin elements which have browsing context (266286@main)

August 09, 2023 10:36 PM

July 28, 2023

Release Notes for Safari Technology Preview 175

Surfin’ Safari

Safari Technology Preview Release 175 is now available for download for macOS Sonoma beta and macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

This release includes WebKit changes between: 265694@main…266088@main.

Accessibility

  • Fixed some content on web pages not displaying on braille displays (265957@main)

CSS

  • Changed to allow an empty font-family name in @font-face and @font-palette-values (265997@main)
  • Fixed -webkit-box-decoration-break: clone with left and right padding causes unexpected wrapping of inline content (266051@main)
  • Fixed serializing CSS math function root nodes (265892@main, 265879@main, 265886@main, 265885@main, 265881@main)
  • Fixed result of tan() in degenerate cases (265881@main)
  • Fixed min() and max() with one argument to always collapse to calc() (265893@main)
  • Fixed NaN numeric representation to be 0 not Infinity (265891@main)
  • Fixed @font-face { src: format() } to parse valid unsupported keywords (266043@main)
  • Fixed @font-face { src: tech() } to parse valid unsupported keywords (265999@main)
  • Fixed font-tech() to not validate the descriptor for any invalid item (266032@main)
  • Fixed animation using padding-block or padding-inline not overriding the set padding style (265956@main)

Editing

  • Fixed an issue when breaking out of an empty list item in case of nested lists (265747@main)

Media

  • Added WebCodecs HEVC support (266044@main)
  • Fixed enumerateDevices to not include devices that can not be used (265947@main, 265923@main)
  • Fixed VideoFrame buffer constructor not respecting the codedWidth if visibleRect is present (265844@main)

Web API

  • Added support for priority to CSS Highlight API (265812@main)
  • Aligned <script type language> with the HTML Standard (265977@main)
  • Fixed camera RAW files picked via file input getting returned as PNG on change (266049@main)
  • Fixed HTMLTableSectionElement.insertRow(0) and HTMLTableRowElement.insertCell(0) (265768@main)
  • Fixed incorrect tab stop if the tab-size is a <length> and the distance to the next tab stop is less than 0.5ch (265922@main)
  • Fixed Service Worker redirect losing the hash fragment (265845@main)
  • Fixed setting the outerHTML on a child of DocumentFragment to not throw an error (266086@main)
  • Made nodeValue and textContent for Attr nodes not nullable (265769@main)

Web Inspector

  • Stopped using Number.prototype.toLocaleString() for numeric console format specifiers (266020@main)

July 28, 2023 12:05 AM

July 24, 2023

WebKit Features in Safari 16.6

Surfin’ Safari

Today’s release of Safari is the seventh since last fall. It focuses on key bug fixes and feature polish.

Bug Fixes

CSS

  • Fixed using currentcolor with color-mix().
  • Fixed content at block-start edge to have their trimmed margins reflected in the computed style.
  • Fixed trimmed block-end margins for block containers to be reflected in the computed style in a horizontal writing mode.
  • Fixed compression streams to handle large outputs during the flush stage.
  • Fixed trimming nested self-collapsing children at block-end.
  • Fixed the CSS hypot() function sometimes returning the result squared.
  • Fixed container query length units to use the content box instead of the border box.
  • Fixed serializing properties directly in the parent group rule only for the first nested style rule.

Forms

  • Fixed the value not updating on <meter> and <progress> elements.

Web API

  • Fixed putImageData to draw on the correct canvas.

Feedback

We love hearing from you. Send a tweet to @webkit to share your thoughts on Safari 16.6. Find us on Mastodon at @jensimmons@front-end.social and @jondavis@mastodon.social. If you run into any issues, we welcome your feedback on Safari UI, or your WebKit bug report about web technologies or Web Inspector. Filing issues really does make a difference.

Download the latest Safari Technology Preview to stay at the forefront of the web platform and to use the latest Web Inspector features. You can also read the Safari 16.6 release notes.

Updating to Safari 16.6

Safari 16.6 is available for macOS Ventura, macOS Monterey, macOS Big Sur, iPadOS 16, and iOS 16. You can update to Safari 16.6 on macOS Monterey or macOS Big Sur by going to System Preferences → Software Update → More info, and choosing to update Safari. To update macOS Ventura, iOS or iPadOS, go to Settings → General → Software Update.

July 24, 2023 05:00 PM

July 12, 2023

Release Notes for Safari Technology Preview 174

Surfin’ Safari

Safari Technology Preview Release 174 is now available for download for macOS Sonoma beta and macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

This release includes WebKit changes between: 265305@main…265693@main.

CSS

  • Added support for contain-intrinsic-size: auto none property syntax (265617@main)
  • Fixed text-overflow: ellipsis so it works with overflow: clip (265445@main)
  • Fixed cjk-earthly-branch and cjk-heavenly-stem counter styles to fallback to cjk-decimal (265474@main)
  • Fixed inline-flex and inline-grid boxes to stop propagating underlines to align with other browsers (265471@main)
  • Fixed CSS accelerated animation handling with multiple effects on the stack (265498@main)
  • Fixed cursor style to respect explicitly set cursor type over system default (265597@main)

CSS Container Queries

  • Fixed container units in a container query to evaluate against the ancestor container (265583@main)
  • Fixed container units to consider writing mode for unit resolution (265654@main)

Fixed how text decorations propagate into tables to align with other browsers (265488@main)

Layout

  • Fixed list alignment when a list item has a flex container (265464@main)
  • Fixed font size to allow use of fractional pixel values (265657@main)
  • Fixed bordercolor attribute on table elements to not create a visible border (265670@main)

JavaScript

  • Renamed .groupByToMap() on Array to .groupBy() on Object and Map in order to align with latest TC-39 proposal (265632@main)

Media

  • Added support for WebCodecs temporal scalabilityMode for software codecs, including parsing and error handling (265561@main)
  • Added support for WebM files with no track ID (265425@main)
  • Updated VTTCue to match latest W3C specification, including support for CSS updated default CSS properties, as well as support for vh, vw, cqh, and cqw units. (265596@main)

Popover

  • Fixed togglePopover() to always throw an exception if it’s disconnected or not a popover (265589@main)

Accessibility

  • Improved accessibility for tables and table components with display: flex, grid, block, inline-block, and contents (265486@main)
  • Prioritized HTML required attribute over aria-required when both are present (265552@main)

SVG

  • Fixed dominant-baseline CSS property to be inherited (265525@main)
  • Fixed references for SVG fragments in shadow DOM trees (265565@main)

Web API

  • Fixed constructing a SharedWorker in a detached document so it throws an exception (265483@main)
  • Removed artificial memory limit for canvas context, given it the same memory restrictions as other Web features (265628@main)

July 12, 2023 09:00 PM

July 08, 2023

Philippe Normand: GNOME Web Canary is back

Igalia WebKit

This is a short PSA post announcing the return of the GNOME Web Canary builds. Read on for the crunchy details.

A couple years ago I was blogging about the GNOME Web Canary flavor. In summary this special build of GNOME Web provides a preview of the upcoming version of …

By Philippe Normand at July 08, 2023 08:00 AM

June 28, 2023

Release Notes for Safari Technology Preview 173

Surfin’ Safari

Safari Technology Preview Release 173 is now available for download for macOS Sonoma beta and macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

Many of the new Safari 17 features are now available in Safari Technology Preview 173:

Feature Flags is a new section of Safari Technology Preview Settings and replaces the Experimental Features section of the Develop menu. It allows you to search for specific features and to easily see features toggled from their default state in bold. Feature flags have a status such as Stable, Testable, Preview, or Developer, and are now organized by topic.

A redesigned Develop menu makes it easier to find the key tools available to help you create websites, web apps, web content inside other apps, web extensions, and more.

Responsive Design Mode has been refreshed to focus on the responsiveness of a page’s design at any width or height on your Mac. Specify viewport size at the top of Responsive Design Mode or drag the resize handles around the view, and easily jump into device simulators.

Profiles on macOS Sonoma help you keep your browsing data separated including History, favorites, Tab Groups and website data such as Notification subscriptions, cookies, caches, and service workers.

Web apps on macOS Sonoma allows you to add any website to your Dock with this release of Safari Technology Preview.

Improved Private Browsing on macOS Sonoma locks your Private Browsing windows when not in use and adds protection against many more of the advanced techniques used to track you.

Managed Media Source combines the best features of HTTP Live Streaming and Media Source Extensions into an easy to adopt power-efficient low-level toolkit for adaptive streaming.

JPEG XL support on macOS Sonoma adds a new image format with an improved compression algorithm for better image quality at smaller file sizes than JPEG, but with the same progressive loading capability.

HEIC adds support for the file format used on iPhone and iPad to store photos taken with the camera, allowing developers to support importing and editing photos right in the browser.

Live Text adds support for vertical text recognition in images and videos.

A redesigned text cursor on macOS Sonoma uses the system accent color and matches iOS behavior. You can still customize the color with the caret-color CSS property.

In addition to these new Safari 17 features, this release includes WebKit changes between: 264855@main…265377@main.

Web Inspector

  • Fixed color swatch to not show an incorrect tooltip when read-only (265039@main)
  • Fixed details sidebar in the Sources tab to maintain its width when changing between tabs (265152@main)

CSS

  • Added a CSS rule nesting level limit (265309@main)
  • Fixed cjk-earthly-branch and cjk-heavenly-stem counter styles to have fixed system (265235@main)
  • Fixed the computed display of a form inside table elements to be display: none (265283@main)
  • Made <ray-size> optional in ray() for CSS Motion Path (265200@main)

Media Queries

Rendering

  • Fixed inline-level elements with a self-painting layer rendering overlapping ellipsis (264973@main)

Editing

  • Fixed <textarea> with float: left disappearing when editing text (264943@main)

JavaScript

  • Added global String.replace(/regexp-global/g, func) result caching for large strings (264967@main)
  • Optimized op_to_this for global object case (265373@main)
  • Optimized parseFloat(number) (265189@main)
  • Optimized ProxyObject’s “ownKeys” trap (265218@main)

Popover

  • Made popover methods forbid only modal dialogs, not all open dialogs (264876@main)
  • Made element.togglePopover() return a boolean (265064@main)

Images

  • Fixed main-resource content loads with Content-Type: image/heif to show the image instead of downloading it (265091@main)

Media

  • Fixed animation when making a video full screen (265051@main)
  • Fixed non-MSE blob URLs for the <source> element and src attribute (265045@main)
  • Fixed WebM files support with no track ID (265425@main)
  • Fixed video going black with only audio playing when exiting picture-in-picture (264974@main)
  • Fixed Safari Tab showing a speaker icon indicating the tab is playing audio even though it is paused (265052@main)
  • Set a limit for the number of samples stored in SourceBuffer (265355@main)

Web API

  • Changing the dir attribute of documentElement doesn’t update a child element matching :dir pseudo-class (265332@main)
  • Fixed images with decoding="async" flickering while zooming in. (265328@main)
  • Fixed serialization of Selectors (264980@main)
  • Fixed ensuring all ServiceWorkerRegistration files and directories are removed when registrations are cleared (264998@main)
  • Fixed style invalidation of IDs within :nth-child and :nth-last-child (264986@main)
  • Fixed MediaStream from canvas (captureStream) to be able to render into a different canvas (265128@main)
  • Fixed readAsDataURL.readAsDataURL() for empty blobs (265153@main)
  • Fixed remaining page height to never be 0 (264857@main)
  • Fixed <select> with multiple enabled not consistently firing the onchange event (264873@main)
  • Fixed HTMLPreloadScanner to not ignore the referrerpolicy attribute for <img> elements (265223@main)
  • Fixed window named getter to behave correctly when there are duplicate frame names (265211@main)
  • Fixed XMLHttpRequest.responseXML.characterSet (265210@main)
  • Set canvas-based VideoFrame color space to RGB (264881@main)

SVG

  • Changed to stop propagating text decorations on the outermost SVG roots (264894@main)
  • Changed to use a placeholder SVG as a mask to respect semantic color changes (265037@main)
  • Fixed <feColorMatrix> filter when defined inside then set directly on the <svg> element (265135@main)
  • Fixed setting the vector-effect attribute in the SVG <text> tag to “non-scaling-stroke” has no effect (265204@main)
  • Fixed handling of a negative radius for feMorphology (265007@main)

June 28, 2023 09:00 PM

June 14, 2023

Release Notes for Safari Technology Preview 172

Surfin’ Safari

Safari Technology Preview Release 172 is now available for download for macOS Ventura. If you already have Safari Technology Preview installed, you can update it in System Settings under General → Software Update.

This release includes WebKit changes between: 264302@main…264854@main.

Web Inspector

  • Fixed truncation for deeply nested async stack traces to avoid infinite nesting (264354@main)
  • Fixed XHR request with the same URL as the main resource to have an XHR type (264686@main)

CSS

  • Added unprefixed hyphens and hyphenate-character CSS properties (264628@main)
  • Added :has() invalidation support for :defined pseudo class (264602@main)
  • Added nowrap white-space to the User-Agent Stylesheet for the option element (264691@main)
  • Fixed child-indexed pseudo-classes to match root elements (264620@main)
  • Fixed baseline alignment to not synthesize the first baseline when a flex item block axis is parallel to a flex cross axis (264423@main)
  • Fixed input elements to respect line heights smaller than normal (264802@main)
  • Fixed computing table overflow to take overflow: clip into account (264849@main)
  • Fixed viewport layout size when a site specifies an initial scale (264842@main)

Image Set

  • Fixed type() function to only take one string (264310@main)
  • Fixed image-set options with identical resolutions to choose the first supported image type (264481@main)

Rendering

  • Fixed calculating the actual column count to avoid floating point precision issues (264667@main)
  • Fixed wrong input text position with line-height (264613@main)
  • Fixed which element scrollbar-width is resolved from for the viewport (264632@main)
  • Fixed resize handles to render correctly when scrollbar-width is none (264630@main)

Editing

  • Fixed option and optgroup to not be focusable in a menulist (264755@main)
  • Fixed the input renderer applying overflow clipping to the content box (264731@main)
  • Fixed matching elements without a parent with child-indexed pseudo-classes (264620@main)
  • Fixed overflowing placeholder text inside an input (264684@main)

JavaScript

Media

  • Fixed WebRTC backed media element rendering layer changes slowly (size or layer made hidden/visible) (264777@main)
  • Added the BufferedChangeEvent object (264472@main)
  • Fixed media recorder producing empty chunks (264478@main)
  • Fixed getDisplayMedia capture to mute other tabs when starting (264611@main)

Popover

  • Fixed hidePopover to prevent a recursive loop (264623@main)

SVG

  • Fixed animateMotion to accumulate properly with rotate: auto or rotate: auto-reverse (264595@main)
  • Fixed to not create an interval if a value in begin-value-list doesn’t have a matching value in end-value-list (264635@main)
  • Fixed using a nested SVG resource (264618@main)
  • Fixed the computed display for SVG elements (264627@main)
  • Fixed the mapping from a point to a character index for the SVG <text> element (264796@main)

Accessibility

  • Fixed aria-checked to work for role="treeitem" elements with display: contents (264761@main)
  • Fixed display: contents lists to return the correct sub-role (264644@main)
  • Fixed elements with the popovertarget attribute to expose expanded state to assistive technologies (264852@main)

HTML

  • Removed -webkit-user-select: none from draggable elements (264448@main)

IndexedDB

  • Fixed an array keyPath to yield an array key (264479@main)

Web API

  • Added applying cookie policy on WebSocket requests (264753@main)
  • Fixed the change event to fire when the user reverts the value of a color, date, time, or datetime input after JavaScript changed the value (264528@main)
  • Fixed images with decoding="async" flickering while zooming in (264433@main)
  • Fixed forbidden host and domain code points to align with specifications (264482@main)
  • Fixed to not fire a mousemove event when a modifier key is pressed (264455@main)
  • Fixed the heuristics for reporting storage quota (264446@main)
  • Fixed CSS.supports() to always use no-quirks mode (264835@main)
  • Fixed window.stop() to fire abort events on XMLHttpRequest asynchronously (264765@main)
  • Fixed navigator.credentials.preventSilentAccess() (264345@main)
  • Fixed HTMLOptionElement text setter to not have a non-conforming observable behavior (264442@main)
  • Fixed ignoring bidi control characters while collecting fallback fonts (264509@main)
  • Fixed missing network connection integrity policies when connecting via <link rel=preconnect> (264382@main)
  • Fixed to resolve percentage in use against the instance’s viewport element (264596@main)
  • Fixed selecting an OptGroup label not unselecting the selected item (264767@main)
  • Fixed ServiceWorker downloads when chunks are sent via postMessage (264412@main)

June 14, 2023 09:18 PM

June 12, 2023

MotionMark Moves to Open Governance

Surfin’ Safari

The WebKit team created the MotionMark benchmark in 2016 to measure graphics performance of web browsers. In the 7 years since then, it has proven to be a critical tool to help us guide our graphics performance improvements. It’s been successful not just for WebKit, but also for other browser engines, which have used it to help direct their own work. It is now the industry-standard benchmark for graphics on the web.

This is why we’re opening up MotionMark to the browser community and migrating to a new governance model. This new model is designed so that browser engine developers can collaboratively improve MotionMark together and is based on the governance model of the popular Speedometer benchmark.

We’re excited to work with the browser community to develop MotionMark further! Please feel free to file issues at github.com/WebKit/MotionMark, and please get involved!

June 12, 2023 04:00 PM

June 06, 2023

News from WWDC23: WebKit Features in Safari 17 beta

Surfin’ Safari

It’s been a fantastic year for WebKit. We’ve shipped eight Safari releases since WWDC22, with more than 140 new web technologies in the first half of 2023 alone. Now, we are pleased to announce another 88 web features coming this fall in Safari 17.

Web Apps

Web apps are coming to Mac. With macOS Sonoma, you can add a website — any website — to your Dock. Just go to File > Add to Dock, adjust the name and icon if desired, and the web app icon appears in your Dock.

Web apps on Mac let you focus on the websites you use all the time, separate from the rest of your browsing. Like all Mac apps, web apps work great with Stage Manager, Mission Control, and keyboard shortcuts like Command + Tab. Web apps can be opened from the Dock, Launchpad, and Spotlight Search. Web apps work with AutoFill credentials from iCloud Keychain and from third-party apps that have adopted the Credential Provider Extension API. And users can grant permission to a web app to use their camera, microphone and location in the same way they grant such permissions to other Mac apps through system prompts and the Privacy & Security section of System Settings. Web apps on Mac support web push, badging, and all the usual web standards implemented by WebKit, just like web apps on iOS and iPadOS.

A web app for WebKit Blog shown on macOS Sonoma. With three other web apps as Stage Manager windows off to the side. And four web app icons in the doc. Plus a push notification coming in from the WebKit web app.

When a user clicks on a web app icon, the website always opens in its own window as a web app, even if the site does not have a manifest file (or legacy meta tags). This expands the usefulness of web apps, putting users in charge of determining what becomes a web app and giving them the confidence it’s always something they can choose.

While the default web app experience on Mac is great, as a web app developer you can use web technologies like Service Workers to make it even better. By providing a web app manifest, you can customize the presentation of your web app, including the display mode, name, theme color, and start URL. Learn about the details by watching What’s new in Web Apps at WWDC23.

When a user adds a website to their Dock, Safari will copy the website’s cookies to the web app. That way, if someone is logged into their account in Safari, they will remain logged in within the web app. This will only work if the authentication state is stored within cookies. Safari does not copy over any other kind of local storage. After a user adds a web app to the Dock, no other website data is shared, which is great for privacy.

Add to Home Screen from Safari View Controller

Add to Home Screen is now available from Safari View Controller on iOS and iPadOS. Tapping a link within an app that uses Safari View Controller as the in-app browser allows the user to add the open website to their Home Screen right from there. Just like Add to Home Screen from Safari on iOS and iPadOS (or any other browser that implemented support), if the website has a manifest file with a display mode of standalone or fullscreen, it will open as a Home Screen web app.

Spatial Web

Three Safari windows floating in a room, almost reaching from floor to ceiling.

We can’t wait for you to try out Safari on Vision Pro. This truly is Safari, with the same WebKit engine — plus a few additions. All of your websites will work beautifully out of the box, thanks to its extensive support for web standards. You can see exactly how Safari on Vision Pro works by watching the WWDC23 Keynote and Meet Safari for spatial computing.

We are collaborating on two technologies to make the web in spatial computing even more powerful — the <model> element and WebXR.

Model

The <model> element will provide a way to easily present 3D content in a web page without any scripting. Just like with <img> and <video>, HTML makes it possible for <model> to work in a robust and simple manner across web browsers on any platform. Model is still undergoing specification and is subject to change, but we expect it will work like this:

<model src="asset/example-3d-model" width="400" height="300"></model>

By creating a declarative element, we can leverage well-known patterns for supporting multiple file formats, while simultaneously providing fallbacks for browsers without support.

<model width="400" height="300" interactive>
    <source src="assets/example.usdz" type="model/vnd.usdz+zip">
    <source src="assets/example.glb" type="model/gltf-binary">
    <picture>
        <source src="fallback-version.mp4" type="video/mp4">
        <source src="fallback-version.webp" type="image/webp">
        <img src="fallback-version.gif"/>
    </picture>
</model>

The interactive attribute will enable user interaction and allow people to rotate the model in place. An accompanying JavaScript API will provide even more capabilities, including access to the camera. The exact details of how <model> will work are currently being debated at the Immersive Web Community Group.

The ability to embed rich 3D content into a web page will open up a world of possibilities. For example, an online shoe store might provide models of all their shoes. Or a website for interior design inspiration could provide furniture models for people to “place” virtually in their homes. Safari on Vision Pro will take such experiences to the next level, with a full stereoscopic view and environmental lighting — all in a privacy-preserving way. What or where the user is looking is never exposed to the web page.

A Safari window floating in space, showing a tea shop website, offering teapots and tea cups for sale. On a table in the room, sits a virtual tea cup and teapot — from the website.

You can try out <model> in Safari on iOS, iPadOS, and macOS by turning on its feature flag and navigating to this demo page.

WebXR

When embedding a 3D model into a web page isn’t enough, WebXR provides the technology for creating a fully immersive experience on the web. WebXR is based on WebGL, and many popular WebGL libraries already have built in support.

A cartoon 3D world, mountains in the background. Lakes and swaps in the foreground.

Safari on Vision Pro currently has testable support for WebXR, available behind a feature flag while we collaborate with the W3C Immersive Web Working Group on updates to the web standard. WebKit supports the immersive-vr session type in WebXR. Vision Pro does not have external controllers. Instead, you can request the “hand-tracking” feature to let users interact with your content.

Visit the Immersive Web Working Group developer page at immersiveweb.dev to learn more about getting started with different frameworks that include WebXR support and to find one that best fits your project.

Images

JPEG XL

We are pleased to announce that support for JPEG XL is coming to Safari 17. Similar to JPEG, the new image format provides another modern option for finding the right balance between quality and file size. JPEG XL uses a new compression algorithm called “Modular Entropy Coding” that allows for greater flexibility in adjusting the compression ratio. With support for progressive loading, it’s well suited for images served over slow connections, since users start to see the image before the whole file is downloaded. And you can recompress existing JPEG files into JPEG XL without any loss of data, while reducing their size by an average of 20%. Or compress from the original image file to create a file that’s up to 60% smaller compared to JPEG!

Use the <picture> element to provide JPEG XL files to browsers that have support, while providing a fallback for browsers that don’t.

<picture>
  <source srcset="images/large/sophie.jxl" type="image/jxl">
  <img src="images/large/sophie.jpeg">
</picture>

JPEG XL will be supported by WebKit for Safari 17, Safari View Controller and WKWebView on macOS Sonoma, macOS Ventura and macOS Monterey, as well as iOS, iPadOS, watchOS, and visionOS.

HEIC

We are also adding support for HEIC images to Safari 17, which uses the HEVC video codec compression algorithm. HEIC is the file format used on iPhone and iPad to store photos taken with the camera. With support for HEIC in Safari, Safari View Controller, and WKWebView, developers can support importing and editing such photos right in the browser, without needing to convert them into another format. HEIC is also ideal for displaying images when using WKWebView inside an app.

Image set

Safari 17 also improves our implementation of image-set(), increasing interoperability with other browsers as part of our commitment to Interop 2023 , and adding support for the optional resolution and type arguments. The type argument provides you with a means to offer browsers multiple image formats to choose from, including JPEG XL and HEIC.

.component {
  background-image: image-set(
    url("images/trees.jxl") type("image/jxl"),
    url("images/trees.avif") type("image/avif"),
    url("images/trees.jpeg") type("image/jpeg")
  );
}

Video

Managed Media Source

WebKit for Safari 17 also brings the new Managed Media Source API. It provides a power-efficient solution fulfilling advanced needs as a low-level toolkit for streaming video.

Adaptive bitrate streaming allows for switching between media data formats — ensuring delivery of the best possible video quality based on the user’s internet connection speed and device capabilities, even as those conditions change. Media Source Extensions (MSE) is an existing low-level toolkit for adaptive streaming giving the web page more control and responsibilities for managing buffering and resolution. But MSE isn’t particularly good at managing buffer levels, network access, and media variant selection. And it uses a lot of power on mobile devices.

Managed Media Source adds the capabilities of MSE, without any of the drawbacks. It’s available on iPadOS 17 beta and macOS Sonoma beta, and is in preview on iOS 17 beta, where it can be tested by turning on its feature flag. Note that Managed Media Source is only made available when an AirPlay source alternative is present.

Learn more about JPEG XL, HEIC, and Managed Media Source API by watching Explore media formats for the web at WWDC23.

Media player stats overlay

Video in a video player, with an overlay showing the stats for that video.

If you’ve enabled Developer Features, WebKit now provides a media player stats overlay where you can see technical details about a video — its source type, size, performance metrics, resolution, codec string, and color configuration. To show the overlay, use the context menu on any <video> element and select “Show Media Stats”. Now you can tell at a glance the exact codec and configuration used by media on your page and use that information to craft accurate queries in MediaCapabilities.

And more video

WebKit now supports USB cameras on iPadOS 17. When a USB camera is attached to an iPad, it’s included in the output of enumerateDevices() and is selectable with getUserMedia() along with the built-in cameras.

Improvements to WebRTC add support for InputDeviceInfo, the inbound rtp trackIdentifier stat field, exposing zoom in MediaTrackCapabilities, and getDisplayMedia video track clone resizing.

WebKit for Safari 17 adds additional support for low-power mode — optimizing video streaming by tone mapping HDR video to SDR.

HTML

Popover

Safari 17 adds support for the popover attribute. It provides a framework for displaying overlays, popups, popovers, and dialogs. There are two types of popovers, which can be used as values for the popover attribute:

  • auto popovers, which automatically close when you click outside of the popover; and
  • manual popovers, which don’t have this automatic closing behavior.

Use a button (either a <button> element or button input type) to create the UI for opening and closing the popover. And add the appropriate HTML attributes to create the desired result.

The popovertarget attribute connects the button to the popover content through an ID. The optional popovertargetaction attribute takes show, hide, or toggle as values. By default, toggle is used.

<button popovertarget="info-box" popovertargetaction="show">More info</button>

<article id="info-box" popover="auto">
  <h2>Additional Information</h2>
  <p>Here’s something I wanted to tell you.</p>
  <button popovertarget="info-box" popovertargetaction="hide">Close</button>
</article>

This is just one UI pattern you might find useful. There are many possible combinations. Having a popover mechanism in HTML makes for quick work, while ensuring great usability and full accessibility.

To go beyond a simple button trigger, a JavaScript API opens up more powerful possibilities through showPopover(), hidePopover(), and togglePopover().

And more HTML

Safari 17 on macOS adds support for <hr> inside of <select>, which is a feature the WebKit team added to the HTML Standard. This makes it easier to create a visual separator between items without requiring the use of JavaScript.

<select>
  <option value="pizza">Pizza</option>
  <option value="hamburger">Hamburger</option>
  <hr>
  <option value="sushi">Ice cream</option>
  <option value="pasta">Cake</option>
</select>

The <menu> element is now mapped to role=list. Slotted elements are now announced when inside <dialog> or aria-modal. And now slot elements referenced with aria-labelledby are properly labeled.

CSS

Counter styles

Safari 17 adds support for CSS Counter Styles, providing a mechanism through @counter-style for changing a counter’s language or character set in CSS — both for ordered/unordered lists with list-style-type, and for CSS Counters.

@counter-style upper-serbian {
  system: alphabetic;
  symbols: 'А' 'Б' 'В' 'Г' 'Д' 'Ђ' 'Е' 'Ж' 'З' 'И' 'Ј' 'К' 'Л' 'Љ' 'М' 'Н' 'Њ' 'О' 'П' 'Р' 'С' 'Т' 'Ћ' 'У' 'Ф' 'Х' 'Ц' 'Ч' 'Џ' 'Ш';
}
ol { 
  list-style: upper-serbian; 
}

Font size adjust

In Safari 16.4, we shipped initial support for font-size-adjust, which allows you to easily make the visual size of different fonts consistent — even across all possible combinations of fallback fonts. The basic version of font-size-adjust lets you tell the browser to resize letters so that their x-height is a specific ratio of the font-size.

In Safari 17, we’re expanding support to include more advance capabilities of font-size-adjust, including the from-font value and two-value syntax. Instead of declaring a ratio with a number value, the from-font value allows you to ask the browser to pull the sizing metric from the main font being specified, and apply that ratio to all fonts. Two-value syntax lets you switch from adjusting ex-height to adjusting cap-height, ch-width, ic-width, or ic-height — providing support for a broader range of languages and design choices.

Let’s look at an example. Here, font-size-adjust tells the browser to make all of the fonts inside article match the size of the x-height of the main font being used. This means all of the text in paragraphs and code will visually appear to be the same size, no matter which font is applied from either stack, or how different the paragraph and code fonts appear in actual size.

article { 
  font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif;
  font-size: 1.4rem;
  font-size-adjust: from-font;
}
article code {
  font-family: "Courier New", monospace;
}

To learn much more about how font-size-adjust works, as well as all about Counter Styles, watch What’s new in CSS at WWDC23.

Safari 17 also brings support for @font-face size-adjust, which provides a way for you to normalize visual size when defining a font’s use.

Text transform

Safari 17 adds support for text-transform: full-width and full-size-kana, and adds support for multiple text-transform values. The full-width value transforms all the characters in a string of text to be “full-width” — to match the size of characters in an East Asian script like those for Chinese, Japanese, or Korean. It’s especially useful when wanting to improve consistency in sizing when typesetting CJK. The full-size-kana value transforms the size of Kana characters in Japanese to be full-size, rather than the typical small size — useful to make ruby text more legible when needed.

Font support

To expand what’s possible with web typography, Safari 17 adds two feature queries for writing CSS depending on the presence or absence of browser support for font tech or format: @supports font-tech() as well as @supports font-format(). Font tech refers to specific kinds of OpenType technology used in some fonts, like COLRv0. Safari 17 also adds support for @font-face { src: url() tech() }, making it easy to define the use of a font that depends on newer tech, while providing a fallback for browsers without support.

@font-face {
    font-family: "My Cool Font";
    src: url("mycoolfont-COLRv0.otf") format(opentype) tech(color-COLRv0),
         url("mycoolfont-outline.otf") format(opentype);
}

Media Queries 4

Safari 17 rounds out support for Media Queries level 4, with support for two new media queries. Like the others, overflow-block and overflow-inline provide a way to conditionally apply CSS depending on the qualities of a user’s device — in this case, how the device handles overflow. For example, can it scroll the page like a typical browser on a computer? Does it page the content, like an e-book reader? Or does it have no mechanism for handling overflow, like a digital billboard?

And more CSS

WebKit for Safari 17 includes multiple fixes to improve accessibility of display: contents, including making aria-activedescendant, aria-dropeffect, aria-flowto, aria-grabbed, aria-owns, AXAccessKey, CSS speak-as, and URL AX APIs work on elements that have display: contents applied. As well as computing the accessible name for display: contents elements that rely on labels or captions, and making display: contents elements to be able to return selected accessibility children.

Safari 17 also adds support for contain-intrinsic-size, providing a way to set the size of an element to use for layout when the element is subject to size containment.

To increase the usefulness of :has(), WebKit now supports :has(:buffering) and :has(:stalled) to expand the ability to apply CSS conditionally based on the state of media playback. And Safari 17 supports :has(:defined) for applying styling based on the presence of a custom element that has been defined.

To keep up with the most recent changes to the web standard for Container Queries, Safari 17 adds support for containerName and containerQuery, and updates conditionText to be containerName containerQuery in CSSContainerRule.

JavaScript and Web API

Offscreen Canvas

When using Canvas, the rendering, animation, and user interaction usually happens on the main execution thread of a web application. Offscreen Canvas provides a canvas that can be rendered off-screen, decoupling the DOM and the Canvas API so that the <canvas> element is no longer entirely dependent on the DOM. Rendering can be transferred to a worker context, allowing you to run tasks in a separate thread and avoid heavy work on the main thread that can negatively impact the user experience. The combination of DOM-independent operations and rendering of the main thread can provide a significantly better experience for users, especially on low-power devices. Support for Offscreen Canvas 2D operations shipped in Safari 16.4. Now, Safari 17 adds support for 3D contexts in Offscreen Canvas.

Storage

WebKit has made some big updates to the storage quota policy. Previously, an origin had a starting storage limit of 1 GB. When exceeding the limit, the subsequent storage operation would fail in Home Screen web apps, or the user would see a prompt asking to increase the quota for the origin in Safari. Starting in macOS Sonoma, iOS 17 and iPadOS 17, the quota is calculated based on total disk space without the user’s input. The origin generally gets a much higher limit, and the user isn’t prompted in Safari. To get the estimated value of the current origin quota and usage, you can use the newly supported navigator.storage.estimate() method.

As each origin gets a higher storage limit by default, WebKit will evict data by origin when the total usage of all origins is bigger than a certain value, the “overall quota”, calculated based on total disk space. An origin is exempt from eviction when its storage mode is persistent. To check the storage mode of your origin, you can use navigator.storage.persisted(); to request the mode be changed to persistent, you can use navigator.storage.persist(). Critical bug fixes have been made to ensure the storage mode value is remembered across sessions, and eviction will count on it. The Storage API is now fully supported.

RegEx

Safari 17 adds JavaScript support for two new Regular Expression features, RegExp v flag with set notation + properties of strings and RegExp duplicate named capture groups. The RegExp v flag feature allows for the creation of regular expressions containing Unicode properties, including some multi-character Emoji sequences. It also allows for creating regular expressions with union, intersection, and subtraction set operations on character classes and collections of strings.

The Duplicate Named Capture Group feature enables the creation of regular expressions with named captures where more than one capture group uses the same name. This allows you to create regular expressions with intuitive group names where there is more than a one-way pattern to search. An example is creating one regular expression that can search data strings written in multiple ways, e.g. M/D/Y versus D-M-Y, while extracting the matched results with captured group names month, day, and year regardless of which string format was matched.

Set Operations

Another new JavaScript feature adds several new Set operation methods, including intersection() and union() as well as comparison methods including difference(), isSubsetOf() and isSuperSetOf(). Together these new methods make Sets first class objects.

const setA = new Set(["apples", "oranges", "grapes"]);
const setB = new Set(["bananas", "grapes", "apples"]);

// Union into single set!
const union = setA.union(setB);

// Interection "apples" and "grapes"
const intersect = setA.intersection(setB);

// Difference "oranges"
const diff = setA.difference(setB);

And so on. Check out also the new .symmetricDifference() and .isDisjointFrom() methods, which open some interesting comparison possibilities.

Gamepad API

WebKit for Safari 17 adds support for Gamepad.prototype.vibrationActuator. It enables “dual-rumble” haptic feedback on gamepads. The API allows you to check if “dual-rumble” is supported by the gamepad, as well as control the duration and magnitude of the haptic effect.

const [gamepad] = navigator.getGamepads();
if (gamepad?.vibrationActuator?.canPlayEffectType("dual-rumble")) {
  const options = {
    duration: 1000, // 1 seconds
    startDelay: 0, // play now
    strongMagnitude: 0.5, // low-frequency vibration
    weakMagnitude: 0.2,  // high-frequency vibration
  };
  gamepad.vibrationActuator.playEffect("dual-rumble", options);
}

URL API

Traditionally, to ensure you could parse a URL, you needed to use a try sequence. Now, you can directly detect if an URL input can be parsed with URL.canParse(tentativeURL, optionalBase). The method will return true or false.

In addition, the has() and delete() methods on URLSearchParams have been extended. The has() method makes it possible to detect if a parameter has been set. And the delete() method can delete a parameter. Until now, you could only check for, and delete, by name alone. Now, the methods have been extended so that you can check for, and delete, specific name-value pairs.

For example, the following URL has currency as a duplicate key: https://example.com/?currency=USD&currency=JPY, before you could only check params.has('currency'). It is now possible to do: params.has('currency', 'JPY').

Be mindful that with this update, method signatures are not directly feature detectable, so they can return false positives. Until all browsers support these updates, be sure to run a small test to confirm support. For example:

// These return true only when the updated API is supported!
function supportsUpdatedURLHasMethod() {
    const param = new URLSearchParams({ key: "value" });
    return param.has("key", "does not exist") === false;
}

function supportsUpdatedURLDeleteMethod() {
    const param = new URLSearchParams({ key: "value" });
    param.delete("key", "does not exist");
    return param.has("key");
}

Web Sockets

You can now use relative URLs (as well as HTTP(S) URLs) in the WebSocket constructor — this makes it a lot easier to point to WebSocket endpoints without hard-coding URLs into your web application. For example, new WebSocket('/updates').

And more JavaScript and Web API

  • Support for <link rel="modulepreload">.
  • Support for the focus fixup rule.
  • Support for Ed25519 cryptography.
  • Support for pausing and resuming background fetches.
  • Support for ReadableStream.
  • Support for fetch priority hints.
  • Support for customElements.getName method.

Web Developer Tools

Redesigned Develop Menu

In Safari 17 on macOS Sonoma, macOS Ventura and macOS Monterey, a completely redesigned Develop menu makes it easier to find the key tools available to help you create websites, web apps, web content inside other apps, web extensions, and more.

the new Safari 17 Develop menu, with far fewer items, showing icons for iPhone and iPad

Devices and simulators are now more prominent in the Develop menu, making them easier to identify at a glance. Inside the menu for each iOS or iPadOS device, app icons make it easier to find the application or web content you want to inspect. On macOS Sonoma you can pair with Apple TV and Vision Pro directly from Safari to inspect those platforms.

Rethought Feature Flags

the Safari feature flag settings window with a list of technologies, some on, others off.

The new Feature Flags panel replaces the previous Experimental Features section of the Develop menu, allowing you to search for specific features and to easily see bolded features toggled from their default state. Feature flags are now organized by topic: Animation, CSS, HTML, JavaScript, Media and more. And each feature is clearly categorized into one of four statuses: Stable, Testable, Preview, and Developer.

Stable represents features that have recently shipped in Safari, on by default. These features can be turned off to help you debug an issue or test progressive enhancements. Stable features will eventually be removed from the list.

Testable features are disabled by default. These features might be in the process of being implemented, or they might be waiting for changes to the web standards. They have a ways to go, but still could be interesting enough to test out.

Preview is for features that have not yet shipped in Safari, but are closer to being complete. These features are on by default in Safari Technology Preview, and are ready for developers to try out. They may still have bugs, or may even undergo significant change as web standards evolve. This is a great time to help find and file bugs, and to comment on whether the web standard for a new technologies solves your needs.

Developer features are not as common. This category is for miscellaneous features added to the list of feature flags so developers can toggle them on and off for testing. Developer tools may appear here, for example.

New Developer settings panel

the new Safari Developer settings window, listing what can be toggled

The new Developer panel in Safari 17’s Settings let you toggle developer features that apply across all websites open in Safari, like Allow remote automation (which enables automating Safari with WebDriver) and other features that were previously in the Develop menu.

New tab-specific setting overlay

Web Inspector tab-specific settings overlay

Some previously-global settings from the Develop menu, like disabling CSS or changing WebRTC behavior, have moved to Web Inspector where they are now scoped to the inspected tab, allowing you to use other tabs and windows normally.

Redesigned Responsive Web Design Mode

Redesigned Responsive Design Mode in Safari with configurable viewport size, scale, and simulator menu

Responsive Design Mode has also been refreshed to focus on the responsiveness of a page’s design at any width or height on your Mac. You can type in a specific viewport size at the top of Responsive Design Mode in addition to dragging the resize handles around the view.

Also new is the ability to open the page in a Simulator right from Responsive Design Mode.

Simulators

You can also open any page from Safari in a Simulator directly from the Develop > Open Page With menu, even when you are not using Responsive Design Mode.

Using a Simulator is a great way to test the experiences you’re making on iOS, iPadOS, and coming soon, visionOS — including device-specific behaviors, like the rendered size of type, the effects of the viewport meta tag, double-tap to zoom, and even Home Screen web apps on iOS and iPadOS. Simulators are free, and come included with Xcode from the Mac App Store.

macOS Sonoma with a simulated iPhone on screen, showing a website. The Develop menu is open, with the user selecting the website in that simulator.

If you don’t have Xcode installed, a link to documentation is conveniently available in the Develop > Open Page With menu, as well as the Open with Simulator menu in Responsive Design Mode, to help you get started, or to add more devices and OS versions.

Learn all about the new Develop menu, redesigned Responsive Web Design mode, how to easily connect to directly to a real device, how to install and use a Simulator, and much more in Rediscover Safari developer features at WWDC23.

Web Inspector

We’ve also made improvements to Web Inspector. When working with minified sources, pretty printing in Web Inspector can help make the code easier to read, set breakpoints in, and debug. New in Safari 17, more JavaScript syntax is supported for pretty printing minified scripts, including template strings, optional chaining, private variables and functions in classes, and static variables and functions.

Changes to Web Inspector in Safari 17 also include:

  • Elements tab: Added settings to always show rulers and element overlays for grid and flexbox when highlighting elements in Web Inspector or in Element Selection Mode.
  • Elements tab: Added editing controls for variation axes in the Fonts sidebar.
  • Console tab: Added setting to show timestamps for console messages.
  • Console tab: Added support for viewing the target of a WeakRef.
  • Sources tab: Added support for ES2022 Private Fields when inspecting and logging JavaScript objects.
  • Graphics tab: Added support for OffscreenCanvas.

Learn more by watching What’s new in Web Inspector at WWDC23.

Security

GPU Process

Last year brought GPU process support to WebKit on iOS, iPadOS and watchOS. This year we’re adding support on macOS Sonoma. The change moves all drawing (including the drawing of page content, 2D Canvas and WebGL rendering) so it occurs in the “GPU Process”. This new architecture allows WebKit to isolate powerful graphics hardware and driver access away from the WebContent process, which is the process that interacts with untrusted content from the Internet. The new design also allows the WebContent process sandbox to completely block IOKit access, resulting in improved security.

WebGL

Improvements to WebGL include adding support for WEBGL_clip_cull_distance, EXT_disjoint_timer_query_webgl2, EXT_polygon_offset_clamp and GPUExternalTexture.

WebKit API

New interfaces are added to WKWebsiteDataStore and related classes to further unlock the potential of your WebKit apps. The new capabilities include creating persistent website data stores, configuring cookie policy, customizing proxy settings, requesting HTTPS upgrade for all navigations, and controlling state of inline prediction for autocomplete.

Browser changes

Safari Profiles

Safari 17 adds support for profiles. History, favorites, Tab Groups and website data such as cookies, caches, service workers, and Web Push subscriptions are scoped per-profile. Users can manage each profile’s data individually.

Safari Private Browsing

In Safari 17, Private Browsing gets even more private with added protection against some of the most advanced techniques used to track you. Technical changes include:

  • Adding blocking for known trackers and fingerprinting.
  • Adding support for mitigating trackers that map subdomains to third-party IP addresses.
  • Adding blocking for known tracking query parameters in links.
  • Adding noise to fingerprintable web APIs.
  • Adding console log messages when blocking requests to known trackers.
  • Adding support for blocking trackers that use third-party CNAME cloaking.
  • Adding support for Private Click Measurement for direct response advertising, similar to how it works for in-app direct response advertising.

Text cursor color

On macOS Sonoma, the redesigned text cursor now uses the system accent color and matches iOS behavior. You can still customize the color with the caret-color CSS property.

Live Text

Safari 17 adds support for vertical text recognition in images and videos.

Apple Pay via Payment Request API

You can now enable Apple Pay to be used in third-party iframes by setting the allow="payment" attribute. This “permissions policy” enables the Payment Request API on an iframe, allowing you to embed third-party payment handlers. If using this feature, be sure you also use the X-Frames-Options HTTP header to prevent your site from being embedded by malicious websites.

Authentication

Safari 17 adds support for largeBlob extension for passkeys. Websites can use the additional storage to save data that can later be retrieved when signing in with a passkey. These saved blobs are synced and shared along with passkeys.

We also are adding support for enterprise WebAuthn attestation for passkeys in iCloud Keychain. Managed devices can provide an attestation statement when creating passkeys, using a certificate provisioned through MDM.

Networking

Safari 17 adds support for preconnect via HTTP Early Hints.

Lockdown mode

Lockdown mode now:

  • Disables IndexedDB.
  • Disables the File API and FileReader API.
  • Disables support for the <embed> element.
  • Disables the Web Speech (Speech Synthesis) API.
  • Disables the WebLocks API.
  • Disables support for experimental APIs.
  • Supports select web fonts.

Lockdown Mode is also now supported in WebKit on watchOS.

Safari Extensions

Safari 17 now lets you customize where extensions run with even more granularity.

First, Safari App Extensions now have the same per-site permissions model as Safari Web Extensions. It puts users in control over the browsing data they share with every extension they use in Safari.

Second, as an additional layer of control, Safari Extensions can be turned off in Private Browsing. Extensions that access browsing data, like browsing history or webpage contents, will be off by default in Private Browsing but can be allowed with a single toggle in Safari Settings.

Third, all Safari Extensions can be turned on or off per Safari Profile. You can imagine this being useful for turning on an extension used only for school or work in a relevant profile, but keeping it off everywhere else. Each profile runs a separate instance of the extension — meaning there are unique storage areas, background pages, service workers, and more. However, per-site permissions are shared across profiles, so an extension only needs to be granted once. If your extension leverages native messaging capabilities to communicate with a host app, it’s possible to distinguish between profiles to ensure your extension behaves correctly across profiles.

Learn more by watching What’s new in Safari extensions at WWDC23.

Bug Fixes and more

To learn even more about what’s in Safari 17 for web developers, including an extensive list of bug fixes, read the Safari 17 beta release notes.

Help us Beta Test

You can test Safari 17 beta by installing the beta of macOS Sonoma, iOS 17, or iPadOS 17.

Or, if you’d like, you can try out Safari 17 beta on macOS Ventura or macOS Monterey by downloading the Safari 17.0 public beta, once it’s available later this summer. You will need to sign in using a free Apple ID to download. Note that installing Safari 17 beta will replace your existing Safari install with no way to revert to an earlier version.

Feedback

We love hearing from you. Send a tweet to @webkit to share your thoughts on Safari 17.0 beta. You can find us on Mastodon at @jensimmons@front-end.social and @jondavis@mastodon.social. If you run into any issues, we welcome your feedback on Safari UI, or your WebKit bug report about web technologies or Web Inspector. Filing issues really does make a difference.

Download the latest Safari Technology Preview to stay at the forefront of the web platform and to use the latest Web Inspector features.

June 06, 2023 12:00 PM

June 05, 2023

Web technology sessions at WWDC23

Surfin’ Safari

WWDC23 is here, and with it, a host of announcements of new web technology shipping in WebKit on macOS, iOS, iPadOS, and visionOS — plus new features for Safari, Web Inspector and Safari Web Extensions. Seven sessions at WWDC23 go into detail, demonstrating new technology directly relevant to web developers. New videos will be released each day this week.


Tuesday, June 6

Three Safari windows floating in a room, almost reaching from floor to ceiling.

Meet Safari for spatial computing

Discover the web for visionOS and learn how people can experience your web content in a whole new way. Explore the unique input model powering this platform and learn how you can optimize your website for spatial computing. We’ll also share how emerging standards are helping shape 3D experiences for the web.

A web app for WebKit Blog shown on macOS Sonoma. With three other web apps as Stage Manager windows off to the side. And four web app icons in the doc. Plus a push notification coming in from the WebKit web app.

What’s new in web apps

Discover web apps for Mac — a powerful way to experience your website from the Dock. Learn how you can customize your web app to give people the best experience when they add your site. We’ll also share how to take advantage of push notifications and badging for web apps for Mac and Home Screen web apps for iOS and iPadOS.


Wednesday, June 7

iPhone simulator showing in macOS Sonoma. With a menu open showing

Rediscover Safari developer features

Get ready to explore Safari’s rich set of tools for web developers and designers. Learn how you can inspect web content, find out about Responsive Design Mode and WebDriver, and get started with simulators and devices. We’ll also show you how to pair with Vision Pro, make content inspectable in your apps, and use Open with Simulator in Responsive Design Mode to help you test your websites on any device.

Diagram with Safari 16.0 through 17.0 beta on a timeline from Sept 2022 to June 2023. With a word cloud of many CSS features lightly showing in the background.

What’s new in CSS

Explore the latest advancements in CSS. Learn techniques and best practices for working with wide-gamut color, creating gorgeous typography, and writing simple and robust code. We’ll also peer into the future and preview upcoming layout and typography features.


Thursday, June 8

Three logos — for JPEG XL, HEIC, & AVIF, and the words

Explore media formats for the web

Learn about the latest image formats and video technologies supported in Safari 17. Discover how you can use JPEG XL, AVIF, and HEIC in your websites and experiences and learn how they differ from previous formats. We’ll also show you how the Managed Media Source API draws less power than Media Source Extensions (MSE) and explore how you can use it to more efficiently manage streaming video over 5G.


Friday, June 9

Web Inspector open in Safari 17 on macOS Sonoma.

What’s new in Web Inspector

Web Inspector provides a powerful set of tools to debug and inspect web pages, web extensions, and WKWebViews on macOS, iOS and iPadOS. We’ll share the latest updates, including improved typography inspection, editing tools for variable fonts, controls to emulate people’s preferences, element badges in the DOM node tree, and Symbolic breakpoints.

What’s new in Safari extensions

Learn about the latest improvements to Safari extensions. We’ll take you through new APIs, explore per-site permissions for Safari app extensions, and share how you can make sure your extensions work great in both Private Browsing and Profiles.

June 05, 2023 10:00 PM

June 01, 2023

Manuel Rego: Web Engines Hackfest 2023 is coming

Igalia WebKit

Next week Igalia is hosting a new edition of the Web Engines Hackfset in A Coruña.

As last year we’ll be back at Palexco an amazing venue and we have around 100 people registered to participate onsite. You can check the full schedule of the event at the wiki page.

We hope it’s going to be a great week for everyone, and we’re looking forward to the event!

Talks

On Monday 5th there will be five talks:

  • JavaScript Modules: Past, Present, and Future by Nicolò Ribaudo
  • Inside Kotlin/Wasm (or how your language could benefit from new proposals, like GC, EH, TFR) by Zalim Bashorov
  • Status of the WPE & GTK WebKit ports by Žan Doberšek
  • Servo 2023 by Delan Azabani
  • Ladybird: Building a new browser from scratch by Andreas Kling

I’m really happy about the set of talks, and particularly excited about the possibility to see the presentations about some less known web rendering engines like WPE, Servo and LibWeb. BTW, the talks will be live streamed in the Web Engines Hackfest YouTube channel.

Breakout Sessions

Apart from that we’ll have breakout sessions as usual. But this year, remote participation will be allowed on these sessions; you don’t need to register or anything like that, just join the room on the GitHub issues of each breakout session at the planned time.

Breakout Session Facilitator Issue
Cross-Shadow Root IDREF associations Alice Boxhall #10
Getting into web engine contributing CanadaHonk #20
Maintenace of Chromium downstream José Dapena Paz #9
Servo Martin Robinson #16
Standards and Web Performance Daniel Ehrenberg #8
Test262, Testing JavaScript Conformance Philip Chimento #19
Updates on accelerated compositing in WebKitGTK Carlos García Campos #18
Wasm GC in JavaScriptCore Zalim Bashorov #12
Wayland Antonio Gomes #13
WebKit and Linux graphics Žan Doberšek #15
WebViews and Apps Jonas Kruckenberg #11
WinterCG Andreu Botella #14
Wolvic: An open source XR browser Javier Fernández García-Boente #17

More sessions might be scheduled during the event so keep an eye to the hackfest wiki page and issues.

Sponsors

Last, but not least. Thanks to the Web Engines Hackfest sponsors Arm, Google and Igalia; without your support this event won’t be possible.

Web Engines Hackfest 2023 Sponsors

June 01, 2023 10:00 PM

April 03, 2023

Carlos García Campos: WebKitGTK accelerated compositing rendering

Igalia WebKit

Initial accelerated compositing support

When accelerated compositing support was added to WebKitGTK, there was only X11. Our first approach was quite simple, we sent the web view widget Xwindow ID to the web process to be used as rendering target using GLX. This was very efficient, but soon we realized it broke the GTK rendering model so it was not possible to use a web view inside a GtkOverlay, for example, to show status messages on top. The solution was to use a redirected Xcomposite window in the web process, and use its ID as the render target using GLX. The pixmap ID of the redirected Xcomposite window was sent to the UI process to be painted in the web view widget using a Cairo Xlib surface. Since the rendering happens in the web process, this approach required to use Xdamage to monitor when the redirected Xcomposite window was updated to schedule a web view redraw.

Wayland support

To support accelerated compositing under Wayland we initially added a nested Wayland compositor running in the UI process. The web process connected to the nested Wayland compositor and created a surface to be used as the rendering target using EGL. The good thing about this approach compared to the X11 one, is that we can create an EGLImage from Wayland buffers and use a GDK GL context to paint the contents in the web view. This is more efficient than X11 because we can use OpenGL both in web and UI processes.
WPE, when using the fdo backend, uses the same approach of running a nested Wayland compositor, but in a more efficient way, using DMABUF instead of Wayland buffers when available. So, we decided to use libwpe in the GTK port only for rendering under Wayland, and eventually remove our Wayland compositor implementation.
Before the removal of the custom Wayland compositor we had all these possible combinations:

  • UI Process
    • X11: Cairo Xlib surface
    • Wayland: EGL
  • Web Process
    • X11: GLX using redirected Xwindow
    • Wayland (nested Wayland compositor): EGL using Wayland surface
    • Wayland (libwpe): EGL using libwpe to get the Wayland surface

To reduce a bit the differences, and to make it easier to support WebGL with ANGLE we decided to change X11 to prefer EGL if possible, falling back to GLX only if EGL failed.

GTK4

GTK4 was released and we added support for it. The fact that GTK4 uses GL by default should make the rendering more efficient in accelerated compositing mode. This is definitely true under Wayland, because we are using a GL context already, so we just keep passing a texture to GTK to paint the contents in the web view. However, in the case of X11 we still have a Cairo Xlib surface that GTK paints into a Cairo image surface to be uploaded to the GPU. With GTK4 now we have two more combinations in the UI process side X11 + GTK3, X11 + GTK4, Wayland + GTK3 and Wayland + GTK4.

Reducing all the combinations to (almost) one: DMABUF

All these combinations to support the different platforms made it quite difficult to maintain, every time we get a bug report about something not working in accelerated compositing mode we have to figure out the combination actually used by the reporter, GTK3 or GTK4? X11 or Wayland? using EGL or GLX? custom Wayland compositor or libwpe? driver? version? etc.

We are already using DMABUF in WebKit for different things like WebGL and media rendering, so we thought that we could also use it for sharing the rendered buffer between the web and UI processes. That would be a more efficient solution but it would also drastically reduce the amount of combinations to maintain. The web process always uses the surfaceless platform, so it doesn’t matter if it’s under Wayland or X11. Then we create a surfaceless context as the render target and use EGL and GBM APIs to export the contents as a DMABUF buffer. The UI process imports the DMABUF buffer using EGL and GBM too, to be passed to GTK as a texture that is painted in the web view.

This theoretically recudes all the previous combinations to just one (note that we removed GLX support entirely, making EGL a requirement for accelerated compositing), but there’s a problem under X11: GTK3 doesn’t support EGL on X11 and GTK4 defaults to EGL but falls back to GLX if it doesn’t find an EGL config that perfectly matches the screen visual. In my system it never finds that EGL config because mesa doesn’t expose any 32 bit depth config. So, in the case of GTK3 we have to manually download the buffer to CPU and paint normally using Cairo, but in the case of GTK4 + GLX, GTK uploads the buffer again to be painted using GLX. I don’t think it’s possible to force GTK to use EGL from the API, but at least you can use GDK_DEBUG=gl-egl.

WebKitGTK 2.41.1

WebKitGTK 2.41.1 is the first unstable release of this cycle and already includes the DMABUF support that is used by default. We encourage everybody to try it out and provide feedback or report any issue. Please, export the contents of webkit://gpu and attach it to the bug report when reporting any problem related to graphics. To check if the issue is a regression of the DMABUF implementation you can use WEBKIT_DISABLE_DMABUF_RENDERER=1 to use the WPE renderer or X11 instead. This environment variable and the WPE render/X11 code will be eventually removed if DMABUF works fine.

WPE

If this approach works fine we plan to use something similar for the WPE port and get rid of the nested Wayland compositor there too.

By carlos garcia campos at April 03, 2023 08:57 AM

March 14, 2023

Víctor Jáquez: Review of Igalia Multimedia activities (2022)

Igalia WebKit

We, Igalia’s multimedia team, would like to share with you our list of achievements along the past 2022.

WebKit Multimedia

WebRTC

Phil already wrote a first blog post, of a series, on this regard: WebRTC in WebKitGTK and WPE, status updates, part I. Please, be sure to give it a glance, it has nice videos.

Long story short, last year we started to support Media Capture and Streams in WebKitGTK and WPE using GStreamer, either for input devices (camera and microphone), desktop sharing, webaudio, and web canvas. But this is just the first step. We are currently working on RTCPeerConnection, also using GStreamer, to share all these captured streams with other web peers. Meanwhile, we’ll wait for the second episode of Phil’s series 🙂

MediaRecorder

We worked in an initial implementation of MediaRecorder with GStreamer (1.20 or superior). The specification goes about allowing a web browser to record a selected stream. For example, a voice-memo or video application which could encode and upload a capture of your microphone / camera.

Gamepad

While WebKitGTK already has Gamepad support, WPE lacked it. We did the implementation last year, and there’s a blog post about it: Gamepad in WPEWebkit, with video showing a demo of it.

Capture encoded video streams from webcams

Some webcams only provide high resolution frames encoded in H.264 or so. In order to support these resolutions with those webcams we added the support for negotiate of those formats and decode them internally to handle the streams. Though we are just at the beginning of more efficient support.

Flatpak SDK maintenance

A lot of effort went to maintain the Flatpak SDK for WebKit. It is a set of runtimes that allows to have a reproducible build of WebKit, independently of the used Linux distribution. Nowadays the Flatpak SDK is used in Webkit’s EWS, and by many developers.

Among all the features added during the year we can highlight added Rust support, a full integrity check before upgrading, and offer a way to override dependencies as local projects.

MSE/EME enhancements

As every year, massive work was done in WebKit ports using GStreamer for Media Source Extensions and Encrypted Media Extensions, improving user experience with different streaming services in the Web, such as Odysee, Amazon, DAZN, etc.

In the case of encrypted media, GStreamer-based WebKit ports provide the stubs to communicate with an external Content Decryption Module (CDM). If you’re willing to support this in your platform, you can reach us.

Also we worked in a video demo showing how MSE/EME works in a Raspberry Pi 3 using WPE:

WebAudio demo

We also spent time recording video demos, such as this one, showing WebAudio using WPE on a desktop computer.

GStreamer

We managed to merge a lot of bug fixes in GStreamer, which in many cases can be harder to solve rather than implementing new features, though former are more interesting to tell, such as those related with making Rust the main developing language for GStreamer besides C.

Rust bindings and GStreamer elements for Vonage Video API / OpenTok

OpenTok is the legacy name of Vonage Video API, and is a PaaS (Platform As a Service) to ease the development and deployment of WebRTC services and applications.

We published our work in Github of Rust bindings both for the Client SDK for Linux and the Server SDK using REST API, along with a GStreamer plugin to publish and subscribe to video and audio streams.

GstWebRTCSrc

In the beginning there was webrtcbin, an element that implements the majority of W3C RTCPeerConnection API. It’s so flexible and powerful that it’s rather hard to use for the most common cases. Then appeared webrtcsink, a wrapper of webrtcbin, written in Rust, which receives GStreamer streams which will be offered and streamed to web peers. Later on, we developed webrtcsrc, the webrtcsink counterpart: an element which source pads push streams from web peers, such as another browser, and forward those Web streams as GStreamer ones in a pipeline. Both webrtcsink and webrtcsrc are written in Rust.

Behavior-Driven Development test framework for GStreamer

Behavior-Driven Development is gaining relevance with tools like Cucumber for Java and its domain specific language, Gherkin to define software behaviors. Rustaceans have picked up these ideas and developed cucumber-rs. The logical consequence was obvious: Why not GStreamer?

Last year we tinkered with GStreamer-Cucumber, a BDD to define behavior tests for GStreamer pipelines.

GstValidate Rust bindings

There have been some discussion if BDD is the best way to test GStreamer pipelines, and there’s GstValidate, and also, last year, we added its Rust bindings.

GStreamer Editing Services

Though not everything was Rust. We work hard on GStreamer’s nuts and bolts.

Last year, we gathered the team to hack GStreamer Editing Services, particularly to explore adding OpenGL and DMABuf support, such as downloading or uploading a texture before processing, and selecting a proper filter to avoid those transfers.

GstVA and GStreamer-VAAPI

We helped in the maintenance of GStreamer-VAAPI and the development of its near replacement: GstVA, adding new elements such as the H.264 encoder, the compositor and the JPEG decoder. Along with participation on the debate and code reviewing of negotiating DMABuf streams in the pipeline.

Vulkan decoder and parser library for CTS

You might have heard about Vulkan has now integrated in its API video decoding, while encoding is currently work-in-progress. We devoted time on helping Khronos with the Vulkan Video Conformance Tests (CTS), particularly with a parser based on GStreamer and developing a H.264 decoder in GStreamer using Vulkan Video API.

You can check the presentation we did last Vulkanised.

WPE Android Experiment

In a joint adventure with Igalia’s Webkit team we did some experiments to port WPE to Android. This is just an internal proof of concept so far, but we are looking forward to see how this will evolve in the future, and what new possibilities this might open up.

If you have any questions about WebKit, GStreamer, Linux video stack, compilers, etc., please contact us.

By vjaquez at March 14, 2023 10:45 AM