Here's what you need to know:
- Displaying
<ruby>
elements is better with line breaks. - Promise.try makes it easier to chain Promises.
- PointerEvent is extended to uniquely identify multiple pens.
- And there's plenty more.
I'm Adriana Jara. Let's dive in and see what's new for developers in Chrome 128.
Line breakable <ruby>
The <ruby>
element enhances text presentation, especially for East Asian languages. It lets you display phonetic annotations or other supplemental information above or beside base text.
A ruby element consists of two main parts, ruby base which is the main text and ruby text which is the annotation text, marked up with the element.
Previously if a ruby-base or a ruby-text was longer than a whole line, they were wrapped individually creating layout challenges.
Now line-breakable ruby, places wrapped ruby annotation text over wrapped base text achieving ideal text rendering.
Visit Line-breakable <ruby>
and CSS ruby-align property for examples and more information.
Promise.try
Promise.try
makes it easier to handle errors with Promises. There's a pattern where you have a function, f
. This function may be async, and return a Promise, or it may not. To use Promise semantics to handle errors in both cases, you wrap the function in a Promise.
One way to achieve this is with Promise.resolve().then(f)
, but in this case f
would be run needlessly asynchronously on the next tick.
To avoid this problem you need to use new Promise(resolve => resolve(f()))
which is not ergonomic at all.
Promise.try
, is the simple, straightforward way to accomplish the same. It lets you start a Promise chain that catches all errors in .catch
handlers instead of having to handle both synchronous and asynchronous exception flows.
To learn more check out the Promise.try
documentation.
PointerEvent.deviceProperties for multi-pen inking
Developers didn't have a way to distinguish between two individual pens on an ink-enabled digitizer. The existing PointerEvent.pointerId attribute is implemented in different ways and does not always persist for each ink stroke or interaction with the screen.
The PointerEvent
interface is now extended to include a new attribute: deviceProperties
. It contains the attribute uniqueId
, that represents a session-persistent, document isolated, unique identifier that a developer can reliably use to identify individual pens interacting with the page.
With this change you can, for example, set specific colors or pen shapes for each device interacting with the digitizer.
Read about getting started with pointer events in Pointing the way forward.
And more!
Of course there's plenty more.
The CSS
zoom
property is now aligned with the latest standard.AudioContext
creation and audio rendering errors are now reported throughAudioContext.onerror
.The DevTools Animations panel now captures animations and you can edit
@keyframes
live.
Further reading
This covers only some key highlights. Check the following links for additional changes in Chrome 128.
- What's new in Chrome DevTools (128)
- ChromeStatus.com updates for Chrome 128
- Chromium source repository change list
- Chrome release calendar
Subscribe
To stay up to date, subscribe to the Chrome Developers YouTube channel, and you'll get an email notification whenever we launch a new video.
Yo soy Adriana Jara, and as soon as Chrome 128 is released, I'll be right here to tell you what's new in Chrome!