


Weekly Platform News: HTML Loading Attribute, the Main ARIA Specifications, and Moving from iFrame to Shadow DOM
This week’s platform news roundup: Chrome introduces a new loading attribute that provides accessibility specifications for web developers, and the BBC’s migration of visualizations to Shadow DOM.
Chrome launches loading attributes
Chrome now supports HTML loading properties for lazy loading images and iframes. You can add loading="lazy"
to<mark>延迟加载图像</mark>
and iframe (located below the viewport) and they will not be loaded until the user scrolls nearby.
Google recommends treating this feature as a progressive enhancement, or using it on top of existing JavaScript-based lazy loading solutions.
This feature has not been added to the HTML standard (but there is an open pull request), and its Chrome status page lists multiple links to Google Docs. (From web.dev)
ARIA Specification Overview
Key accessibility specifications for web developers:
Related: “Associate with the ARIA Authoring Practices Guide” by Simon Pieters and Valerie Young
Shadow DOM on the BBC website
The BBC has implemented embedded interactive visualization on its website from<iframe></iframe>
Migrate to Shadow DOM. This results in a significant improvement in loading performance ("more than 25% faster").
The available Shadow DOM polyfills cannot reliably prevent styles from leaking across Shadow DOM boundaries, so they decided to fall back to the browser that does not support Shadow DOM.<iframe></iframe>
.
Shadow DOM [...] can serve content in a similar way to an iframe, in terms of encapsulation, but without negative overhead [...] We want to encapsulate an element whose content will be displayed seamlessly as part of the page. Shadow DOM provides this for us without custom elements.
A major disadvantage of this new approach is that CSS media queries can no longer be used to conditionally apply styles based on the width of the content (because the content is no longer loaded into a separate embedded document).
When using an iframe, media query provides our content width; when using Shadow DOM, media query provides the device itself width. This is a huge challenge for us. We have no way of knowing the size of the content when it is provided.
(From Toby Cox)
Other news...
- The next version of Chrome will introduce the Largest Contentful Paint performance metric; this new metric more accurately replaces the first meaningful drawing, which measures when the largest element in the viewport is rendered (usually the largest image or text paragraph) (from Phil Walton)
- Microsoft has created a prototype of a new tool for viewing web DOM in 3D; this tool is now available experimentally in Edge Preview (from Edge DevTools)
- Tracking protection is enabled by default in Edge preview; it is set to balancing mode by default, which "blocks malicious trackers and some third-party trackers" (from Techdows)
Read more news in my new weekly Sunday edition . Visit webplatform.news for more information.
The above is the detailed content of Weekly Platform News: HTML Loading Attribute, the Main ARIA Specifications, and Moving from iFrame to Shadow DOM. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

It's out! Congrats to the Vue team for getting it done, I know it was a massive effort and a long time coming. All new docs, as well.

I had someone write in with this very legit question. Lea just blogged about how you can get valid CSS properties themselves from the browser. That's like this.

I'd say "website" fits better than "mobile app" but I like this framing from Max Lynch:

The other day, I spotted this particularly lovely bit from Corey Ginnivan’s website where a collection of cards stack on top of one another as you scroll.

If we need to show documentation to the user directly in the WordPress editor, what is the best way to do it?

There are a number of these desktop apps where the goal is showing your site at different dimensions all at the same time. So you can, for example, be writing

CSS Grid is a collection of properties designed to make layout easier than it’s ever been. Like anything, there's a bit of a learning curve, but Grid is

Questions about purple slash areas in Flex layouts When using Flex layouts, you may encounter some confusing phenomena, such as in the developer tools (d...
