Skip to content

Commit c88f3d9

Browse files
Merge the HTTP guidance into the "consult other specs" section. (#546)
SHA: 0975d2b Reason: push, by martinthomson Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent c151966 commit c88f3d9

File tree

1 file changed

+27
-34
lines changed

1 file changed

+27
-34
lines changed

index.html

Lines changed: 27 additions & 34 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 97a1608be, updated Mon Feb 3 16:09:34 2025 -0800" name="generator">
8+
<meta content="Bikeshed version f5998b114, updated Tue Feb 18 08:22:15 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="b4e70865479471e7945ec93befcd19689ded07be" name="revision">
11+
<meta content="0975d2b1df2a80496024b1ced9fb6881254d8e21" 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-02-13">13 February 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-18">18 February 2025</time></p>
706706
<details open>
707707
<summary>More details about this document</summary>
708708
<div data-fill-with="spec-metadata">
@@ -876,12 +876,11 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
876876
</ol>
877877
<li><a href="#expose-everywhere"><span class="secno">10.3</span> <span class="content">Only purely computational features should be exposed everywhere</span></a>
878878
<li><a href="#new-data-formats"><span class="secno">10.4</span> <span class="content">Add new data formats properly</span></a>
879-
<li><a href="#using-http"><span class="secno">10.5</span> <span class="content">Consult documentation on best practices when using HTTP</span></a>
880-
<li><a href="#extend-manifests"><span class="secno">10.6</span> <span class="content">Extend existing manifest files rather than creating new ones</span></a>
881-
<li><a href="#serialization"><span class="secno">10.7</span> <span class="content">Consider consumers when serializing</span></a>
882-
<li><a href="#debuggability"><span class="secno">10.8</span> <span class="content">Ensure features are developer-friendly</span></a>
883-
<li><a href="#crypto"><span class="secno">10.9</span> <span class="content">Use the best crypto, and expect it to evolve</span></a>
884-
<li><a href="#client-hints"><span class="secno">10.10</span> <span class="content">Do not expose new information through Client Hints</span></a>
879+
<li><a href="#extend-manifests"><span class="secno">10.5</span> <span class="content">Extend existing manifest files rather than creating new ones</span></a>
880+
<li><a href="#serialization"><span class="secno">10.6</span> <span class="content">Consider consumers when serializing</span></a>
881+
<li><a href="#debuggability"><span class="secno">10.7</span> <span class="content">Ensure features are developer-friendly</span></a>
882+
<li><a href="#crypto"><span class="secno">10.8</span> <span class="content">Use the best crypto, and expect it to evolve</span></a>
883+
<li><a href="#client-hints"><span class="secno">10.9</span> <span class="content">Do not expose new information through Client Hints</span></a>
885884
</ol>
886885
<li>
887886
<a href="#spec-writing"><span class="secno">11</span> <span class="content">Writing good specifications</span></a>
@@ -1290,12 +1289,13 @@ <h3 class="heading settled" data-level="2.5" id="specs-include-guidance"><span c
12901289
<p><a href="https://encoding.spec.whatwg.org/#specification-hooks">Encoding</a></p>
12911290
<li data-md>
12921291
<p><a href="https://fetch.spec.whatwg.org/#fetch-elsewhere">Fetch</a></p>
1292+
<li data-md>
1293+
<p><span id="using-http"><a data-biblio-display="inline" data-link-type="biblio" href="https://httpwg.org/specs/rfc9205.html"><cite>Building Protocols with HTTP</cite></a></span>,
1294+
especially on <a href="https://httpwg.org/specs/rfc9205.html#section-4.7">defining header fields</a>, and <a href="https://datatracker.ietf.org/doc/search?name=HTTP&amp;sort=&amp;rfcs=on&amp;by=group&amp;group=httpbis">other HTTP RFCs</a></p>
12931295
<li data-md>
12941296
<p><a href="https://w3c.github.io/hr-time/#sec-tools">Time</a></p>
12951297
<li data-md>
12961298
<p><a href="https://url.spec.whatwg.org/#url-apis-elsewhere">URLs</a></p>
1297-
<li data-md>
1298-
<p><a href="#using-http">§ 10.5 Consult documentation on best practices when using HTTP</a></p>
12991299
</ul>
13001300
<p>Consult with the relevant community
13011301
when using their specification.
@@ -1703,10 +1703,10 @@ <h3 class="heading settled" data-level="3.2" id="html-lists"><span class="secno"
17031703
</div>
17041704
<p>Consistency with other parts of the Web Platform is important,
17051705
even if this means using another character to separate values.</p>
1706-
<div class="example" id="example-ca508580">
1707-
<a class="self-link" href="#example-ca508580"></a>
1706+
<div class="example" id="example-03f014a3">
1707+
<a class="self-link" href="#example-03f014a3"></a>
17081708
<p>The <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/input.html#attr-input-accept" id="ref-for-attr-input-accept">accept</a></code> attribute is a comma-separated list of values,
1709-
because it needs to match the syntax of the <code>Accept</code> HTTP header. (See <a href="#using-http">guidance on HTTP headers</a>)</p>
1709+
because it needs to match the syntax of the `<code><a data-link-type="http-header" href="https://www.rfc-editor.org/rfc/rfc9110.html#name-accept" id="ref-for-name-accept">Accept</a></code>` HTTP header.</p>
17101710
</div>
17111711
<p>Regardless of syntax, attributes should only be used for short lists of values.
17121712
For longer lists, embedding the entire list in an attribute is discouraged.
@@ -3312,21 +3312,7 @@ <h3 class="heading settled" data-level="10.4" id="new-data-formats"><span class=
33123312
the <a href="https://mimesniff.spec.whatwg.org/#image-type-pattern-matching-algorithm">pattern matching algorithm</a>,
33133313
due to security implications, and instead recommend enforcing strict MIME types for newer formats.</p>
33143314
<p>New MIME types should have a specification and should be registered with the Internet Assigned Numbers Authority (IANA).</p>
3315-
<h3 class="heading settled" data-level="10.5" id="using-http"><span class="secno">10.5. </span><span class="content">Consult documentation on best practices when using HTTP</span><a class="self-link" href="#using-http"></a></h3>
3316-
<p>When using <a data-link-type="biblio" href="#biblio-rfc9110" title="HTTP Semantics">HTTP</a>,
3317-
consult <a data-biblio-display="inline" data-link-type="biblio" href="https://httpwg.org/specs/rfc9205.html"><cite>Building Protocols with HTTP</cite></a> for advice on correct usage of the protocol.</p>
3318-
<p><a href="https://fetch.spec.whatwg.org/">Fetch</a> is the way that
3319-
user agents most often interact with servers.
3320-
Fetch defines the CORS protocol and necessary security checks.
3321-
Outside of those constraints necessary for security,
3322-
Fetch does not provide guidelines on how to best use HTTP.
3323-
Appropriate use of methods, header fields, content types, caching, and other HTTP features
3324-
might need to be defined.</p>
3325-
<p>Recommendations on best practices for HTTP
3326-
can be found in <a data-biblio-display="inline" data-link-type="biblio" href="https://httpwg.org/specs/rfc9205.html"><cite>Building Protocols with HTTP</cite></a> and <a href="https://datatracker.ietf.org/doc/search?name=HTTP&amp;sort=&amp;rfcs=on&amp;by=group&amp;group=httpbis">other HTTP RFCs</a>.
3327-
RFC 9205 includes advice on <a href="https://httpwg.org/specs/rfc9205.html#section-4.3">specifying client behavior</a>, <a href="https://httpwg.org/specs/rfc9205.html#section-4.7">defining header fields</a>, <a href="https://httpwg.org/specs/rfc9205.html#section-4.8">use of media types</a>, <a href="https://httpwg.org/specs/rfc9205.html#section-4.16">evolving specifications</a>, and
3328-
other advice on how to get the most out of HTTP.</p>
3329-
<h3 class="heading settled" data-level="10.6" id="extend-manifests"><span class="secno">10.6. </span><span class="content">Extend existing manifest files rather than creating new ones</span><a class="self-link" href="#extend-manifests"></a></h3>
3315+
<h3 class="heading settled" data-level="10.5" id="extend-manifests"><span class="secno">10.5. </span><span class="content">Extend existing manifest files rather than creating new ones</span><a class="self-link" href="#extend-manifests"></a></h3>
33303316
<p>If your feature requires a manifest,
33313317
investigate whether you can extend an existing manifest schema.</p>
33323318
<p>New web features should be self-contained and self-describing and ideally should not require an additional manifest file.
@@ -3371,7 +3357,7 @@ <h3 class="heading settled" data-level="10.6" id="extend-manifests"><span class=
33713357
which meant converting the names to camel-cased version.
33723358
One such example is the <a href="https://w3c.github.io/image-resource/">image resource</a>.
33733359
For this reason, if a key can clearly be expressed as a single word, that is recommended.</p>
3374-
<h3 class="heading settled" data-level="10.7" id="serialization"><span class="secno">10.7. </span><span class="content">Consider consumers when serializing</span><a class="self-link" href="#serialization"></a></h3>
3360+
<h3 class="heading settled" data-level="10.6" id="serialization"><span class="secno">10.6. </span><span class="content">Consider consumers when serializing</span><a class="self-link" href="#serialization"></a></h3>
33753361
When adding or extending features that involve a parser or a serializer you should consider their effect on
33763362
serialization. The following are constituencies of serialization results that must be considered:
33773363
<ul>
@@ -3393,7 +3379,7 @@ <h3 class="heading settled" data-level="10.7" id="serialization"><span class="se
33933379
<li data-md>
33943380
<p>Should not add to error accumulation - taking the serialized output of an API and feeding it back to the same API in a loop should result in the same internal state</p>
33953381
</ul>
3396-
<h3 class="heading settled" data-level="10.8" id="debuggability"><span class="secno">10.8. </span><span class="content">Ensure features are developer-friendly</span><a class="self-link" href="#debuggability"></a></h3>
3382+
<h3 class="heading settled" data-level="10.7" id="debuggability"><span class="secno">10.7. </span><span class="content">Ensure features are developer-friendly</span><a class="self-link" href="#debuggability"></a></h3>
33973383
<p>Any new feature should be developer-friendly.
33983384
While it is hard to quantify friendliness, at least consider the following points.</p>
33993385
<p>While error text in exceptions should be generic,
@@ -3409,13 +3395,13 @@ <h3 class="heading settled" data-level="10.8" id="debuggability"><span class="se
34093395
it also ensures a consistent development experience for the users.</p>
34103396
<p>A good example where debuggability was defined as
34113397
part of the specification is <a href="https://www.w3.org/TR/web-animations-1/#use-cases">Web Animations</a>.</p>
3412-
<h3 class="heading settled" data-level="10.9" id="crypto"><span class="secno">10.9. </span><span class="content">Use the best crypto, and expect it to evolve</span><a class="self-link" href="#crypto"></a></h3>
3398+
<h3 class="heading settled" data-level="10.8" id="crypto"><span class="secno">10.8. </span><span class="content">Use the best crypto, and expect it to evolve</span><a class="self-link" href="#crypto"></a></h3>
34133399
<p>Use only cryptographic algorithms
34143400
that have been impartially reviewed by security experts,
34153401
and make sure your choice of algorithm is proven, and up-to-date.
34163402
Not only do they become obsolete or insecure,
34173403
cryptographic protocols and algorithms also evolve quickly.</p>
3418-
<h3 class="heading settled" data-level="10.10" id="client-hints"><span class="secno">10.10. </span><span class="content">Do not expose new information through Client Hints</span><a class="self-link" href="#client-hints"></a></h3>
3404+
<h3 class="heading settled" data-level="10.9" id="client-hints"><span class="secno">10.9. </span><span class="content">Do not expose new information through Client Hints</span><a class="self-link" href="#client-hints"></a></h3>
34193405
<p>When using Client Hints, don’t expose information that the web page does not already have access to.</p>
34203406
<p>Client hints are an important optimization, but cannot be the sole means by which information
34213407
is exposed to sites. As it says in <cite><a href="https://datatracker.ietf.org/doc/html/rfc8942#section-4.1-5">RFC 8942 §4.1</a></cite> where client hints are defined:</p>
@@ -4420,6 +4406,11 @@ <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span cla
44204406
<ul>
44214407
<li><span class="dfn-paneled" id="ea2e2ea4">timeRemaining()</span>
44224408
</ul>
4409+
<li>
4410+
<a data-link-type="biblio">[RFC9110]</a> defines the following terms:
4411+
<ul>
4412+
<li><span class="dfn-paneled" id="3c05c488">Accept</span>
4413+
</ul>
44234414
<li>
44244415
<a data-link-type="biblio">[UIEVENTS]</a> defines the following terms:
44254416
<ul>
@@ -4901,6 +4892,7 @@ <h2 class="no-num no-ref heading settled" id="property-index"><span class="conte
49014892
"37ef25b8": {"dfnID":"37ef25b8","dfnText":"HTMLHtmlElement","external":true,"refSections":[{"refs":[{"id":"ref-for-htmlhtmlelement"}],"title":"Use casing rules consistent with existing APIs"}],"url":"https://html.spec.whatwg.org/multipage/semantics.html#htmlhtmlelement"},
49024893
"3a2db83f": {"dfnID":"3a2db83f","dfnText":"localStorage","external":true,"refSections":[{"refs":[{"id":"79d831630"}],"title":"2.10. Consider how your API should behave in private browsing mode"},{"refs":[{"id":"ref-for-dom-localstorage"}],"title":"10.3. Only purely computational features should be exposed everywhere"}],"url":"https://html.spec.whatwg.org/multipage/webstorage.html#dom-localstorage"},
49034894
"3b64181e": {"dfnID":"3b64181e","dfnText":"none","external":true,"refSections":[{"refs":[{"id":"ref-for-valdef-font-size-adjust-none"}],"title":"11.4.1. If you need to monkey patch"}],"url":"https://drafts.csswg.org/css-fonts-5/#valdef-font-size-adjust-none"},
4895+
"3c05c488": {"dfnID":"3c05c488","dfnText":"Accept","external":true,"refSections":[{"refs":[{"id":"ref-for-name-accept"}],"title":"3.2. Use space-separated attributes for short lists of values, separate elements for longer lists"}],"url":"https://www.rfc-editor.org/rfc/rfc9110.html#name-accept"},
49044896
"3da24a47": {"dfnID":"3da24a47","dfnText":"ping","external":true,"refSections":[{"refs":[{"id":"ref-for-ping"}],"title":"3.6. Name URL-containing attributes based on their primary purpose"}],"url":"https://html.spec.whatwg.org/multipage/links.html#ping"},
49054897
"3f03fff1": {"dfnID":"3f03fff1","dfnText":"datalist","external":true,"refSections":[{"refs":[{"id":"ref-for-the-datalist-element"}],"title":"3.2. Use space-separated attributes for short lists of values, separate elements for longer lists"}],"url":"https://html.spec.whatwg.org/multipage/form-elements.html#the-datalist-element"},
49064898
"3f597ac1": {"dfnID":"3f597ac1","dfnText":"createImageBitmap(image, options)","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-createimagebitmap"}],"title":"6.8. Classes should have constructors when possible"}],"url":"https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#dom-createimagebitmap"},
@@ -5079,7 +5071,7 @@ <h2 class="no-num no-ref heading settled" id="property-index"><span class="conte
50795071
"fdf6efd5": {"dfnID":"fdf6efd5","dfnText":"font-size","external":true,"refSections":[{"refs":[{"id":"ref-for-propdef-font-size"},{"id":"ref-for-propdef-font-size\u2460"},{"id":"ref-for-propdef-font-size\u2461"}],"title":"4.2. Make appropriate choices for whether CSS properties are inherited"},{"refs":[{"id":"ref-for-propdef-font-size\u2462"},{"id":"ref-for-propdef-font-size\u2463"},{"id":"ref-for-propdef-font-size\u2464"},{"id":"ref-for-propdef-font-size\u2465"},{"id":"ref-for-propdef-font-size\u2466"}],"title":"4.3. Choose the computed value type based on how the property should inherit"}],"url":"https://drafts.csswg.org/css-fonts-4/#propdef-font-size"},
50805072
"ff87eaf9": {"dfnID":"ff87eaf9","dfnText":"remove","external":true,"refSections":[{"refs":[{"id":"ref-for-abortsignal-remove"},{"id":"ref-for-abortsignal-remove\u2460"}],"title":"7.6. Guard against potential recursion"}],"url":"https://dom.spec.whatwg.org/#abortsignal-remove"},
50815073
"live-object": {"dfnID":"live-object","dfnText":"live object","external":false,"refSections":[],"url":"#live-object"},
5082-
"monkey-patch": {"dfnID":"monkey-patch","dfnText":"monkey patch","external":false,"refSections":[{"refs":[{"id":"ref-for-monkey-patch"}],"title":"10.6. Extend existing manifest files rather than creating new ones"},{"refs":[{"id":"ref-for-monkey-patch\u2460"}],"title":"11.4.1. If you need to monkey patch"}],"url":"#monkey-patch"},
5074+
"monkey-patch": {"dfnID":"monkey-patch","dfnText":"monkey patch","external":false,"refSections":[{"refs":[{"id":"ref-for-monkey-patch"}],"title":"10.5. Extend existing manifest files rather than creating new ones"},{"refs":[{"id":"ref-for-monkey-patch\u2460"}],"title":"11.4.1. If you need to monkey patch"}],"url":"#monkey-patch"},
50835075
"propdef-font-size-adjust": {"dfnID":"propdef-font-size-adjust","dfnText":"font-size-adjust","external":false,"refSections":[],"url":"#propdef-font-size-adjust"},
50845076
"static-object": {"dfnID":"static-object","dfnText":"static object","external":false,"refSections":[],"url":"#static-object"},
50855077
};
@@ -5708,6 +5700,7 @@ <h2 class="no-num no-ref heading settled" id="property-index"><span class="conte
57085700
"https://webidl.spec.whatwg.org/#idl-unrestricted-double": {"displayText":"unrestricted double","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"unrestricted double","type":"interface","url":"https://webidl.spec.whatwg.org/#idl-unrestricted-double"},
57095701
"https://webidl.spec.whatwg.org/#idl-unsigned-long-long": {"displayText":"unsigned long long","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"unsigned long long","type":"interface","url":"https://webidl.spec.whatwg.org/#idl-unsigned-long-long"},
57105702
"https://webidl.spec.whatwg.org/#sequence-type": {"displayText":"sequence type","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"sequence type","type":"dfn","url":"https://webidl.spec.whatwg.org/#sequence-type"},
5703+
"https://www.rfc-editor.org/rfc/rfc9110.html#name-accept": {"displayText":"Accept","export":true,"for_":[],"level":"","normative":true,"shortname":"rfc9110","spec":"rfc9110","status":"anchor-block","text":"accept","type":"http-header","url":"https://www.rfc-editor.org/rfc/rfc9110.html#name-accept"},
57115704
"https://www.w3.org/TR/payment-request/#dfn-state": {"displayText":"[[state]]","export":true,"for_":[],"level":"","normative":true,"shortname":"payment-request","spec":"payment-request","status":"anchor-block","text":"[[state]]","type":"dfn","url":"https://www.w3.org/TR/payment-request/#dfn-state"},
57125705
"https://xhr.spec.whatwg.org/#dom-progressevent-loaded": {"displayText":"loaded","export":true,"for_":["ProgressEvent"],"level":"1","normative":true,"shortname":"xhr","spec":"xhr","status":"current","text":"loaded","type":"attribute","url":"https://xhr.spec.whatwg.org/#dom-progressevent-loaded"},
57135706
"https://xhr.spec.whatwg.org/#dom-progressevent-total": {"displayText":"total","export":true,"for_":["ProgressEvent"],"level":"1","normative":true,"shortname":"xhr","spec":"xhr","status":"current","text":"total","type":"attribute","url":"https://xhr.spec.whatwg.org/#dom-progressevent-total"},

0 commit comments

Comments
 (0)