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

推荐订阅源

C
Check Point Blog
AI
AI
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
U
Unit 42
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
WordPress大学
WordPress大学
Martin Fowler
Martin Fowler
博客园 - 【当耐特】
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
F
Full Disclosure
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Help Net Security
Recorded Future
Recorded Future
N
News and Events Feed by Topic
雷峰网
雷峰网
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
aimingoo的专栏
aimingoo的专栏
S
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Project Zero
Project Zero
罗磊的独立博客
G
GRAHAM CLULEY
腾讯CDC
P
Privacy International News Feed
V
V2EX
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
H
Heimdal Security Blog
L
LINUX DO - 热门话题
Forbes - Security
Forbes - Security
美团技术团队
MongoDB | Blog
MongoDB | Blog
Security Latest
Security Latest
M
MIT News - Artificial intelligence
T
Tor Project blog
Cisco Talos Blog
Cisco Talos Blog
宝玉的分享
宝玉的分享
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog

Recent Commits to design-principles:main

Event names should use the present tense (#592) Disambiguate when to add global event handlers (#612) · w3ctag/design-principles@41fee41 Handle non-fully-active documents (#597) chore: fix bikeshed warning about multiple definitions of the <a> ele… · w3ctag/design-principles@6ec7e11 Guidance on extensibility patterns: main spec revision vs registries … Un-escape ampersands in a URL to avoid a bikeshed bug. · w3ctag/design-principles@031a3de Trim trailing whitespace. Rewrite the "removing features" section, incorporating "Support Exist… · w3ctag/design-principles@62fc770 Replace asking for users for consent with designing for user intent (… Clarify when details should go on events vs targets (#585) · w3ctag/design-principles@79c2b78 Avoid abbreviations generally (#600) · w3ctag/design-principles@9fc15ba Update ethical-web-principles links and bibrefs (#601) · w3ctag/design-principles@63b43c9 Clean up link-defaults. · w3ctag/design-principles@993e58e Remove trailing whitespace (#593) · w3ctag/design-principles@98f4a02 Ignore index.html at the root. (#586) Fix example in Keep attributes in sync (#591) · w3ctag/design-principles@afb192e Remove notion of asking for consent to reveal AT use (#589) · w3ctag/design-principles@c35b9cd Reference HTTP WG style guide (#587) · w3ctag/design-principles@81e3ff2 Add 'Choose the Appropriate WebIDL Construct for Data and Behavior' (…
Add principles for task sources (#590) · w3ctag/design-principles@444a329
marcoscacere · 2025-10-21 · via Recent Commits to design-principles:main
Original file line numberDiff line numberDiff line change

@@ -2325,6 +2325,38 @@ See also:

23252325
23262326

* [Command–query separation on Wikipedia](https://en.wikipedia.org/wiki/Command–query_separation)

23272327
2328+

<h3 id="prefer-existing-task-sources">Prefer existing task sources</h3>

2329+
2330+

Use existing [=task sources=] for dispatching work where possible.

2331+
2332+

Only create a new [=task source=] when there is a clear reason to do so.

2333+

Specs use [=task sources=] to group related work (or "[=tasks=]") so UAs can schedule them sensibly.

2334+

A task is queued on a task source,

2335+

and each task source is associated with a task queue for an [=/event loop=].

2336+

Order is guaranteed within a source, while the UA chooses which queue to service next.

2337+
2338+

Use the generic or preexisting task sources whenever possible.

2339+

HTML defines [[html#generic-task-sources|generic task sources]] meant for broad reuse across specs.

2340+

This includes, but is not limited to:

2341+

the [=DOM manipulation task source=],

2342+

the [=user interaction task source=],

2343+

and the [=networking task source=].

2344+

If your feature matches one of these categories,

2345+

queue on that source rather than creating a new one.

2346+

Doing so improves interoperability, predictability, and performance scheduling across the platform.

2347+
2348+

Adding a task source has performance and complexity costs

2349+

that all browser implementations pay.

2350+

Only mint a new task source when you have a concrete, testable need.

2351+

For example, when the feature's timing/execution model must be isolated

2352+

from the generic task sources

2353+

(e.g., media elements get their own media element event task source to align with decoder/timeline semantics).

2354+
2355+

When writing a spec, prefer HTML's wrapper algorithms

2356+

([=queue a global task=], [=queue an element task=])

2357+

and avoid relying on a particular [=/event loop=].

2358+

And only be explicit about the event loop when appropriate (see also [[#event-design]]).

2359+
23282360

<h2 id="event-design">Event Design</h2>

23292361
23302362

<h3 id="one-time-events">Use promises for one time events</h3>