惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Help Net Security
Help Net Security
G
Google Developers Blog
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
D
DataBreaches.Net
V
V2EX
Know Your Adversary
Know Your Adversary
T
The Exploit Database - CXSecurity.com
AWS News Blog
AWS News Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
P
Privacy & Cybersecurity Law Blog
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs
S
Schneier on Security
P
Proofpoint News Feed
NISL@THU
NISL@THU
V
Vulnerabilities – Threatpost
U
Unit 42
Jina AI
Jina AI
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
Netflix TechBlog - Medium
宝玉的分享
宝玉的分享
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Microsoft Security Blog
Microsoft Security Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
N
News and Events Feed by Topic
C
Cisco Blogs
B
Blog RSS Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
量子位
Google DeepMind News
Google DeepMind News
Cloudbric
Cloudbric
T
Tor Project blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Threat Research - Cisco Blogs
Stack Overflow Blog
Stack Overflow Blog
V2EX - 技术
V2EX - 技术
The Last Watchdog
The Last Watchdog
Latest news
Latest news

Recent Commits to csswg-drafts:main

[css-image-animation] and ids to section titles · w3c/csswg-drafts@f33b2e3 [css-color-4][editorial] fix warning about variable only used once [css-color-4][editorial] wpt · w3c/csswg-drafts@f37938a [css-color-4] Clarify carry-forward in color interpolation #14134 · w3c/csswg-drafts@526bc74 [css-link-params][editorial] Prepare for FPWD · w3c/csswg-drafts@c7d565c [css-view-tranitions-2] Update two-phase view transition explainer (#… [css-navigation-1] Remove controversial parts (#14138) [css-speech-1][editorial] Enforce positive <generic-voice> variant us… · w3c/csswg-drafts@b99f0c7 [selectors-4][editorial] Update previous versions · w3c/csswg-drafts@a3a7543 [selectors-4][editorial] silence bikeshed nitpicking · w3c/csswg-drafts@7780a1f [selectors-4][editorial] wpt · w3c/csswg-drafts@aa61b2c [selectors-4] Better description of :lang() psuedo class selector #3022. · w3c/csswg-drafts@1ed57ea [css-navigation-1] Change `:trigger-link` to `:nav-source` and includ… · w3c/csswg-drafts@d554423 Clarify note on ViewTransition/types manipulation. (#14110) · w3c/csswg-drafts@14685cd [selectors-4] Add CanIUse panels #1193 (#14120) [css-navigation-1] Move parameter resolution into <<route-location>> … Initial plan [cssom-view-1] Per flackr feedback, not worth making quirks mode care… · w3c/csswg-drafts@169b434 [css-overscroll-1] Clarify the wording to be about scrollable axis. · w3c/csswg-drafts@d5541f2 [css-conditional-5] Clarify a little bit that we can skip containers. · w3c/csswg-drafts@416c971 [css-overscroll-1] Never mind, exclude single-axis scrollers from the… · w3c/csswg-drafts@23ba67b [css-nav-1] Fix up 'can be manually scrolled' to care about axises, u… · w3c/csswg-drafts@8f211ee [css-nav-1] Clean up some of the bikeshed errors · w3c/csswg-drafts@f746899 [css-conditional-5] For the scroller queries, elements are only CQ co… · w3c/csswg-drafts@a017379 [css-conditional-5][editorial] Rewrap to semantic linebreaks · w3c/csswg-drafts@4be4924
[css-image-animations] Manual anchors · w3c/csswg-drafts@ea1b610
frivoal · 2026-07-10 · via Recent Commits to csswg-drafts:main

@@ -34,7 +34,7 @@ Previous Version: [https://github.com/webplatformco/project-image-animation/blob

3434

3. [Other Alternatives](#other-alternatives)

3535

</details>

363637-

## User Needs & Use Cases {#user-needs--use-cases}

37+

## User Needs & Use Cases <a id="user-needs--use-cases"></a>

3838

Animated images (as enabled by GIF, APNG, WebP) are in common use on the web,

3939

for a variety of reasons, such as:

4040

* Purely decorative design elements

@@ -97,9 +97,9 @@ But this is not always practical:

9797

being able to work directly with the markup's `<img>` tags

9898

is far easier than trying to replace them on the fly with something else.

9999100-

## User Research {#user-research}

100+

## User Research <a id="user-research"></a>

101101102-

### Developer & User Signals {#developer--user-signals}

102+

### Developer & User Signals <a id="developer--user-signals"></a>

103103

A few examples amongst many of people asking for that type of functionality.

104104

* Stack overflow:

105105

[1](https://stackoverflow.com/questions/20644209/play-gif-on-mouseover-and-pause-gif-on-mouse-out-without-replacing-images)

@@ -113,24 +113,24 @@ A few examples amongst many of people asking for that type of functionality.

113113

[1](https://old.reddit.com/r/HTML/comments/3hjccx/how_can_i_animate_and_stop_gifs_with_mouse_hover/)

114114

[2](https://old.reddit.com/r/FirefoxCSS/comments/1523xwr/stop_animated_gifs_play_on_hoverclick/)

115115116-

### Current Workarounds {#current-workarounds}

116+

### Current Workarounds <a id="current-workarounds"></a>

117117

Numerous workarounds exist (further highlighting author/user demand),

118118

all with a variety of downsides.

119119

See the [“Current Workarounds” section of the Images-in-video explainer](../images-in-video#user-content-current-workarounds) for a brief discussion.

120120121-

## Goals {#goals}

121+

## Goals <a id="goals"></a>

122122

* Provide declarative syntax to enable/disable animation of images

123123

* Handle images that are part of the content as well as decorative images

124124

* Enable applying different settings to different images

125125

* Enable simple user interactions (e.g. click to play)

126126

* Work with existing markup and/or without

127127128-

### Non-goals {#non-goals}

128+

### Non-goals <a id="non-goals"></a>

129129

* Turning animated images into fully fledged video player.

130130

(This [could be pursued separately](../images-in-video/README.md),

131131

but is not the focus of this explainer.)

132132133-

## Proposed Solution {#proposed-solution}

133+

## Proposed Solution <a id="proposed-solution"></a>

134134135135

The proposed solution is a css property to control animation of images.

136136

At its most basic version, it would take the following form:

@@ -176,7 +176,7 @@ all values have the same effect (i.e. none).

176176

the image animation plays,

177177

without synchronization with any other instance of the same image on the page.

178178179-

### Sample Code Snippets {#sample-code-snippets}

179+

### Sample Code Snippets <a id="sample-code-snippets"></a>

180180

Turn off all image animations on the page:

181181

```css

182182

:root { image-animation: paused; }

@@ -222,7 +222,7 @@ Interesting effects can easily be achieved in combination with other CSS:

222222

.carousel img:snapped { image-animation: play; }

223223

```

224224225-

### Beyond the Basics {#beyond-the-basics}

225+

### Beyond the Basics <a id="beyond-the-basics"></a>

226226227227

A key limitation of the above property is encountered

228228

when authors want to set up a means for users

@@ -236,7 +236,7 @@ to activate the animation.

236236

Two approaches are being considered to complement the basic design above.

237237238238239-

#### High-level Approach {#high-level-solution}

239+

#### High-level Approach <a id="high-level-solution"></a>

240240241241

An additional value can be added to the `image-animation` property:

242242

* **controlled**:

@@ -270,7 +270,7 @@ Same as above, in response to a [user request for reduced motion](https://drafts

270270

```

271271272272273-

#### Low-level Approach {#low-level-solution}

273+

#### Low-level Approach <a id="low-level-solution"></a>

274274275275

The `:animated-image` pseudo-class can be introduced,

276276

and represents content image elements

@@ -286,9 +286,9 @@ without having to modify the DOM to add additional markup,

286286

an `::overlay` pseudo-element could be added to `<img>`

287287

enabling generated content or other effects to be easily placed over the image.

288288289-

### Possible Extensions {#possible-extensions}

289+

### Possible Extensions <a id="possible-extensions"></a>

290290291-

#### Control Over Iterations {#control-over-iterations}

291+

#### Control Over Iterations <a id="control-over-iterations"></a>

292292

Animated image formats such as GIF, WebP, or APNG include information

293293

about how many times the animation is supposed to run.

294294

This could be made into an overridable default, with alternate possibilities being specified in CSS.

@@ -325,7 +325,7 @@ when the element is focused or hovered.

325325

}

326326

```

327327328-

#### Longhands And Further Controls {#longhands-and-further-controls}

328+

#### Longhands And Further Controls <a id="longhands-and-further-controls"></a>

329329

The property above could be broken down into longhands

330330

possibly similar to those of the `animation-*` family of properties

331331

(`image-animation-play-state`, `image-animation-iteration-count`).

@@ -341,12 +341,12 @@ For instance,

341341

`loop` in `animation-iteration-count` is actually called `infinite`,

342342

and `once` would be `1`.

343343344-

#### Control Over the Paused State {#control-over-the-paused-state}

344+

#### Control Over the Paused State <a id="control-over-the-paused-state"></a>

345345

The `paused` value could be extended to give control over which frame of the image is displayed when it is stopped.

346346347347

`paused [ first | last | last-shown | <time> | <percent> | <number> ] ?`

348348349-

### Accessibility Considerations {#accessibility-considerations}

349+

### Accessibility Considerations <a id="accessibility-considerations"></a>

350350

* Web pages can already contain animated images,

351351

and appropriate `alt` text is already expected to be provided.

352352

”Cartoon coyote being squashed by a falling anvil“

@@ -368,7 +368,7 @@ The `paused` value could be extended to give control over which frame of the ima

368368

`overflow: auto` / `scroll` makes elements focusable,

369369

only when there is something to scroll.

370370371-

### Privacy Considerations {#privacy-considerations}

371+

### Privacy Considerations <a id="privacy-considerations"></a>

372372

With regards to decorative images,

373373

this property enables control over image animation cross origin,

374374

without leaking any information about whether the image is actually animatable or not.

@@ -409,9 +409,9 @@ We argue that this is an acceptable trade-off:

409409

If implemented, it means the situation would not just be analogous,

410410

but that whether an image is animatable would already be knowable cross-origin anyway.

411411412-

## Complementary Solutions {#complementary-solutions}

412+

## Complementary Solutions <a id="complementary-solutions"></a>

413413414-

### Images in the `<video>` Element {#images-in-the-video-element}

414+

### Images in the `<video>` Element <a id="images-in-the-video-element"></a>

415415

See [the explainer for “Images in `<video>`](../images-in-video/README.md).

416416417417

Animated images are effectively videos without a sound track.

@@ -427,14 +427,14 @@ Pursuing both would make sense.

427427428428

***…insert summary table showing overlap and differences…***

429429430-

### What About `<img control>`? {#what-about-img-control}

430+

### What About `<img control>`? <a id="what-about-img-control"></a>

431431432432

***…insert discussion of why that's not a full substitute,

433433

but of how both features can be made compatible with each other if that's desired…***

434434435-

## Rejected Alternatives {#rejected-alternatives}

435+

## Rejected Alternatives <a id="rejected-alternatives"></a>

436436437-

### Provide this as a UA Setting {#provide-this-as-a-ua-setting}

437+

### Provide this as a UA Setting <a id="provide-this-as-a-ua-setting"></a>

438438

Firefox's `about:config` has `image.animation_mode`,

439439

which can turn off all image animations,

440440

and Safari respects macOS's “auto-play animated images” setting (default on, can be turn off).

@@ -476,7 +476,7 @@ More interestingly, the setting could be reinterpreted in terms of the CSS prope

476476

}

477477

```

478478479-

### Reuse the Existing `animation-*` Properties {#reuse-the-existing-animation--properties}

479+

### Reuse the Existing `animation-*` Properties <a id="reuse-the-existing-animation--properties"></a>

480480

Properties like `animation-play-state: running | paused`

481481

or `animation-iteration-count: infinite | <number [0,∞]>`

482482

have value space that are similar to what is proposed here.

@@ -505,7 +505,7 @@ If the regular `animation-*` properties cannot be made to apply by default and w

505505

it makes little sense to try and shoehorn image animations into them,

506506

even if there are similarities.

507507508-

### Other Alternatives {#other-alternatives}

508+

### Other Alternatives <a id="other-alternatives"></a>

509509510510

***This section is a work in progress.***

511511