Skip to content

Commit 71e33c0

Browse files
Take Lea out of the editors, as her term has sadly ended. (#552)
SHA: ff03ce4 Reason: push, by martinthomson Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 3f484b5 commit 71e33c0

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

index.html

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<title>Web Platform Design Principles</title>
66
<meta content="ED" name="w3c-status">
77
<link href="https://www.w3.org/StyleSheets/TR/2021/W3C-ED" rel="stylesheet">
8-
<meta content="Bikeshed version ac5ea272d, updated Fri Dec 6 15:45:15 2024 -0800" name="generator">
8+
<meta content="Bikeshed version 97a1608be, updated Mon Feb 3 16:09:34 2025 -0800" name="generator">
99
<link href="https://www.w3.org/TR/design-principles/" rel="canonical">
1010
<link href="https://www.w3.org/2008/site/images/favicon.ico" rel="icon">
11-
<meta content="0379b875a3b6245c533c1e764e18a24a8872646b" name="revision">
11+
<meta content="ff03ce4204d71488d35841117a7d8f61e69a9b80" name="revision">
1212
<meta content="dark light" name="color-scheme">
1313
<link href="https://www.w3.org/StyleSheets/TR/2021/dark.css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css">
1414
<style>
@@ -702,7 +702,7 @@
702702
<div class="head">
703703
<p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2021/logos/W3C" width="72"> </a> </p>
704704
<h1 class="p-name no-ref" id="title">Web Platform Design Principles</h1>
705-
<p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2025-01-15">15 January 2025</time></p>
705+
<p id="w3c-state"><a href="https://www.w3.org/standards/types/#ED">Editor’s Draft</a>, <time class="dt-updated" datetime="2025-02-06">6 February 2025</time></p>
706706
<details open>
707707
<summary>More details about this document</summary>
708708
<div data-fill-with="spec-metadata">
@@ -714,10 +714,10 @@ <h1 class="p-name no-ref" id="title">Web Platform Design Principles</h1>
714714
<dt>Feedback:
715715
<dd><a href="https://github.com/w3ctag/design-principles/issues/">GitHub</a>
716716
<dt class="editor">Editors:
717-
<dd class="editor p-author h-card vcard" data-editor-id="52258"><a class="p-name fn u-url url" href="https://lea.verou.me">Lea Verou</a> (<span class="p-org org">Invited Expert</span>)
718717
<dd class="editor p-author h-card vcard" data-editor-id="68503"><a class="p-name fn u-url url" href="https://lowentropy.net/">Martin Thomson</a> (<a class="p-org org" href="https://www.mozilla.org/">Mozilla</a>)
719718
<dd class="editor p-author h-card vcard" data-editor-id="72192"><span class="p-name fn">Jeffrey Yasskin</span> (<a class="p-org org" href="https://www.google.com/">Google</a>)
720719
<dt class="editor">Former Editors:
720+
<dd class="editor p-author h-card vcard" data-editor-id="52258"><a class="p-name fn u-url url" href="https://lea.verou.me">Lea Verou</a> (<span class="p-org org">Invited Expert</span>)
721721
<dd class="editor p-author h-card vcard" data-editor-id="42399"><a class="p-name fn u-url url" href="https://sangwhan.com">Sangwhan Moon</a> (<a class="p-org org" href="https://www.google.com/">Google</a>)
722722
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="https://domenic.me/">Domenic Denicola</a> (<a class="p-org org" href="https://www.google.com/">Google</a>) <a class="u-email email" href="mailto:[email protected]">[email protected]</a>
723723
<dd class="editor p-author h-card vcard"><a class="p-name fn u-email email" href="mailto:[email protected]">Travis Leithead</a> (<span class="p-org org">Microsoft</span>)
@@ -748,7 +748,6 @@ <h2 class="no-num no-toc no-ref heading settled" id="sotd"><span class="content"
748748
draft document and may be updated, replaced or obsoleted by other documents
749749
at any time. It is inappropriate to cite this document as other than work in
750750
progress. </p>
751-
<p></p>
752751
<p> Feedback and comments on this document are welcome. Please <a href="https://github.com/w3ctag/design-principles/issues">file an issue</a> in this document’s <a href="https://github.com/w3ctag/design-principles/">GitHub repository</a>. </p>
753752
<p> This document is governed by the <a href="https://www.w3.org/policies/process/20231103/" id="w3c_process_revision">03 November 2023 W3C
754753
Process Document</a>. </p>
@@ -1449,8 +1448,8 @@ <h3 class="heading settled" data-level="2.9" id="do-not-expose-use-of-private-br
14491448
websites should not be able to detect that private browsing mode is engaged.</p>
14501449
<div class="example" id="example-52cad010"><a class="self-link" href="#example-52cad010"></a> User Agents which support <a href="https://www.w3.org/TR/IndexedDB/">IndexedDB</a> should not disable it in private browsing mode,
14511450
because that would reveal that private browsing mode is engaged </div>
1452-
<div class="example" id="example-bc7df47d">
1453-
<a class="self-link" href="#example-bc7df47d"></a> The <a href="https://www.w3.org/TR/payment-request/">Payment Request API</a>'s <a href="https://www.w3.org/TR/payment-request/#show-method">show() method</a>,
1451+
<div class="example" id="example-26556da1">
1452+
<a class="self-link" href="#example-26556da1"></a> The <a href="https://www.w3.org/TR/payment-request/">Payment Request API</a>s <a href="https://www.w3.org/TR/payment-request/#show-method">show() method</a>,
14541453
when called,
14551454
allows User Agents <q cite="https://www.w3.org/TR/payment-request/#show-method">to act
14561455
as if the user had immediately <a href="https://www.w3.org/TR/payment-request/#dfn-user-aborts-the-payment-request">aborted the payment request</a></q>.
@@ -1761,14 +1760,14 @@ <h3 class="heading settled" data-level="3.5" id="html-idl-must-by-synced"><span
17611760
results in confusion, and should be avoided.</p>
17621761
<div class="note" role="note"> This does not hold the other way around.
17631762
A new IDL attribute does not always warrant a content attribute counterpart. </div>
1764-
<div class="example" id="example-ae20f706"><a class="self-link" href="#example-ae20f706"></a> A counterpattern to this guidance can be found in <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/input.html#the-input-element" id="ref-for-the-input-element④">input</a></code>'s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/input.html#attr-input-value" id="ref-for-attr-input-value">value</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-option-element" id="ref-for-the-option-element①">option</a></code>'s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-option-selected" id="ref-for-attr-option-selected">selected</a></code>, and <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/input.html#the-input-element" id="ref-for-the-input-element⑤">input</a></code>'s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/input.html#attr-input-checked" id="ref-for-attr-input-checked">checked</a></code> where the HTML attributes were never updated
1763+
<div class="example" id="example-6013821e"><a class="self-link" href="#example-6013821e"></a> A counterpattern to this guidance can be found in <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/input.html#the-input-element" id="ref-for-the-input-element④">input</a></code>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/input.html#attr-input-value" id="ref-for-attr-input-value">value</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-option-element" id="ref-for-the-option-element①">option</a></code>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-option-selected" id="ref-for-attr-option-selected">selected</a></code>, and <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/input.html#the-input-element" id="ref-for-the-input-element⑤">input</a></code>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/input.html#attr-input-checked" id="ref-for-attr-input-checked">checked</a></code> where the HTML attributes were never updated
17651764
and the IDL attribute was the single source of truth. </div>
17661765
<h3 class="heading settled" data-level="3.6" id="naming-of-url-attributes"><span class="secno">3.6. </span><span class="content">Name URL-containing attributes based on their primary purpose</span><a class="self-link" href="#naming-of-url-attributes"></a></h3>
17671766
<p>If the element enables the user to navigate to the URL contained in the attribute, call the attribute <code>href</code>, like the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element" id="ref-for-the-a-element">a</a></code> element’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-href" id="ref-for-attr-hyperlink-href">href</a></code> attribute.</p>
1768-
<p class="note" role="note"><span class="marker">Note:</span> In hindsight, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/forms.html#the-form-element" id="ref-for-the-form-element">form</a></code>'s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-action" id="ref-for-attr-fs-action">action</a></code> attribute should have been named <code>href</code>.</p>
1767+
<p class="note" role="note"><span class="marker">Note:</span> In hindsight, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/forms.html#the-form-element" id="ref-for-the-form-element">form</a></code>s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-action" id="ref-for-attr-fs-action">action</a></code> attribute should have been named <code>href</code>.</p>
17691768
<p>If the element causes the resource at the given URL to be loaded, call the attribute <code>src</code>, like the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element" id="ref-for-the-img-element①">img</a></code> element’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-src" id="ref-for-attr-img-src">src</a></code> attribute or the <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/scripting.html#script" id="ref-for-script①">script</a></code> element’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/scripting.html#attr-script-src" id="ref-for-attr-script-src">src</a></code> attribute.</p>
1770-
<p class="note" role="note"><span class="marker">Note:</span> HTML has a number of legacy inconsistencies that should not be emulated, like the way <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element" id="ref-for-the-link-element①">link</a></code>'s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-href" id="ref-for-attr-link-href">href</a></code> attribute might allow for navigation or for resource loading, depending on the value of the element’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-rel" id="ref-for-attr-link-rel">rel</a></code> attribute. </p>
1771-
<p>If the attribute identifies a URL that is auxilliary to the element’s purpose, like <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/media.html#video" id="ref-for-video①">video</a></code>'s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/media.html#attr-video-poster" id="ref-for-attr-video-poster">poster</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element" id="ref-for-the-q-element">q</a></code>'s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#attr-q-cite" id="ref-for-attr-q-cite">cite</a></code>, or <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element" id="ref-for-the-a-element①">a</a></code>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/links.html#ping" id="ref-for-ping">ping</a></code>, name the attribute after its semantics.</p>
1769+
<p class="note" role="note"><span class="marker">Note:</span> HTML has a number of legacy inconsistencies that should not be emulated, like the way <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/semantics.html#the-link-element" id="ref-for-the-link-element①">link</a></code>s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-href" id="ref-for-attr-link-href">href</a></code> attribute might allow for navigation or for resource loading, depending on the value of the element’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-rel" id="ref-for-attr-link-rel">rel</a></code> attribute. </p>
1770+
<p>If the attribute identifies a URL that is auxilliary to the element’s purpose, like <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/media.html#video" id="ref-for-video①">video</a></code>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/media.html#attr-video-poster" id="ref-for-attr-video-poster">poster</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-q-element" id="ref-for-the-q-element">q</a></code>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#attr-q-cite" id="ref-for-attr-q-cite">cite</a></code>, or <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element" id="ref-for-the-a-element①">a</a></code>’s <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/links.html#ping" id="ref-for-ping">ping</a></code>, name the attribute after its semantics.</p>
17721771
<p class="note" role="note"><span class="marker">Note:</span> remember that attributes containing URLs should be represented in IDL as <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString">USVString</a></code>; see <a href="#idl-string-types">§ 8.2 Represent strings appropriately</a>.</p>
17731772
<h3 class="heading settled" data-level="3.7" id="html-overloading"><span class="secno">3.7. </span><span class="content">Give each HTML element a single purpose</span><a class="self-link" href="#html-overloading"></a></h3>
17741773
<p>Each HTML element should have a clear purpose.
@@ -2581,15 +2580,15 @@ <h3 class="heading settled" data-level="7.6" id="guard-against-recursion"><span
25812580
causing the same event handler to be fired, and so on.</p>
25822581
<p>To prevent this, make sure that any "recursive" call into the API method
25832582
simply returns immediately. This technique is "guarding" the algorithm.</p>
2584-
<div class="example" id="example-685bd37b">
2585-
<a class="self-link" href="#example-685bd37b"></a> <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal①">AbortSignal</a></code>'s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-add" id="ref-for-abortsignal-add">add</a>, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-remove" id="ref-for-abortsignal-remove">remove</a> and <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortcontroller-signal-abort" id="ref-for-abortcontroller-signal-abort">signal abort</a> each begin with a check to see if the signal is <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-aborted" id="ref-for-abortsignal-aborted">aborted</a>.
2583+
<div class="example" id="example-ce590887">
2584+
<a class="self-link" href="#example-ce590887"></a> <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal①">AbortSignal</a></code>s <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-add" id="ref-for-abortsignal-add">add</a>, <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-remove" id="ref-for-abortsignal-remove">remove</a> and <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortcontroller-signal-abort" id="ref-for-abortcontroller-signal-abort">signal abort</a> each begin with a check to see if the signal is <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-aborted" id="ref-for-abortsignal-aborted">aborted</a>.
25862585
If the signal is <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-aborted" id="ref-for-abortsignal-aborted①">aborted</a>, the rest of the algorithm doesn’t run.
25872586
<p>In this case, a lot of the important complexity is
25882587
in the algorithms run during the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortcontroller-signal-abort" id="ref-for-abortcontroller-signal-abort①">signal abort</a> steps.
25892588
These steps iterate through a collection of algorithms
25902589
which are managed by the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-add" id="ref-for-abortsignal-add①">add</a> and <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-remove" id="ref-for-abortsignal-remove①">remove</a> methods.</p>
25912590
<p>For example, the <a href="https://streams.spec.whatwg.org/#readable-stream-pipe-to">ReadableStreamPipeTo</a> definition <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortsignal-add" id="ref-for-abortsignal-add②">add</a>s an algorithm
2592-
into the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal②">AbortSignal</a></code>'s set of algorithms to be run
2591+
into the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortsignal" id="ref-for-abortsignal②">AbortSignal</a></code>s set of algorithms to be run
25932592
when the <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#abortcontroller-signal-abort" id="ref-for-abortcontroller-signal-abort②">signal abort</a> steps are triggered,
25942593
by calling <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#dom-abortcontroller-abort" id="ref-for-dom-abortcontroller-abort①">abort()</a></code> on the <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#abortcontroller" id="ref-for-abortcontroller①">AbortController</a></code> associated with the signal.</p>
25952594
<p>This algorithm is likely to resolve promises causing code to run,
@@ -2663,7 +2662,7 @@ <h3 class="heading settled" data-level="7.6" id="guard-against-recursion"><span
26632662
to ensure that when a deferred event fires,
26642663
the behavior of inspecting or changing state is well-defined.</p>
26652664
<p><span class="informative">For example, in <a data-link-type="biblio" href="#biblio-payment-request" title="Payment Request API">[payment-request]</a>,
2666-
the <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/payment-request/#dom-paymentrequest" id="ref-for-dom-paymentrequest">PaymentRequest</a></code>'s <a data-link-type="dfn" href="https://www.w3.org/TR/payment-request/#dfn-state" id="ref-for-dfn-state">[[state]]</a> internal slot
2665+
the <code class="idl"><a data-link-type="idl" href="https://w3c.github.io/payment-request/#dom-paymentrequest" id="ref-for-dom-paymentrequest">PaymentRequest</a></code>s <a data-link-type="dfn" href="https://www.w3.org/TR/payment-request/#dfn-state" id="ref-for-dfn-state">[[state]]</a> internal slot
26672666
explicitly tracks the object’s state
26682667
through its well-defined transitions.</span></p>
26692668
<ul>

0 commit comments

Comments
 (0)