Skip to content

Commit 025c56e

Browse files
authored
Editorial: make headings consistent (#371)
* Consistency heading is inconsistent * Editorial: make headings consistently imperative * Make Other Resources a top level section
1 parent 84bd433 commit 025c56e

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

index.bs

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ See also:
317317

318318
* [[LEAST-POWER]]
319319

320-
<h3 id="high-level-low-level">Resolving tension between high level and low level APIs</h3>
320+
<h3 id="high-level-low-level">Consider tradeoffs between high level and low level APIs</h3>
321321

322322
<!--
323323
See "High level or low-level APIs?"
@@ -371,7 +371,7 @@ Naming APIs well makes it much easier for authors to use them correctly.
371371
See the more detailed <a href="#naming-is-hard">Naming principles</a> section
372372
for specific guidance on naming.
373373

374-
<h3 id="consistency">Consistency</h3>
374+
<h3 id="consistency">Be consistent</h3>
375375

376376
It is good practice to consider precedent in the design of your API
377377
and to try to be consistent with it.
@@ -657,7 +657,7 @@ See also:
657657
* [Security and privacy are essential](https://www.w3.org/2001/tag/doc/ethical-web-principles/#privacy)
658658
* [What data does this specification expose to an origin?](https://www.w3.org/TR/security-privacy-questionnaire/#underlying-platform-data)
659659

660-
<h3 id="require-user-activation">Powerful APIs should require user activation</h3>
660+
<h3 id="require-user-activation">Require user activation for powerful APIs</h3>
661661

662662
Some powerful APIs can produce intrusive UI (eg. auto-playing audio),
663663
expose user data (eg. interacting with the clipboard),
@@ -1139,7 +1139,7 @@ See also:
11391139

11401140
* [Computed Values Patterns](https://wiki.csswg.org/spec/computed-values)
11411141

1142-
<h3 id="css-naming">Naming of CSS properties and values</h3>
1142+
<h3 id="css-naming">Name CSS properties and values appropriately</h3>
11431143

11441144
The names of CSS properties are usually nouns,
11451145
and the names of their values are usually adjectives (although sometimes nouns).
@@ -1176,7 +1176,7 @@ default as a result of something like `display: flex` or `position: relative`.
11761176

11771177
<h2 id="js">JavaScript Language</h2>
11781178

1179-
<h3 id="js-only">Web APIs are for JavaScript</h3>
1179+
<h3 id="js-only">Use JavaScript for Web APIs</h3>
11801180

11811181
When designing imperative APIs for the Web,
11821182
use JavaScript.
@@ -1519,7 +1519,7 @@ See also:
15191519

15201520
* [[#prefer-dict-to-bool]]
15211521

1522-
<h3 id="naming-optional-parameters">Naming optional arguments</h3>
1522+
<h3 id="naming-optional-parameters">Name optional arguments appropriately</h3>
15231523

15241524
Name optional arguments to make the default behavior obvious
15251525
without being named negatively.
@@ -1726,7 +1726,7 @@ which might be expressed as a bitmask in another language,
17261726
use a dictionary object instead.
17271727
This object can be passed around as easily as a single bitmask value.
17281728

1729-
<h3 id="properties-vs-methods">Properties vs. Methods</h3>
1729+
<h3 id="properties-vs-methods">Use properties and methods appropriately</h3>
17301730

17311731
Sometimes it is unclear whether to use a property or a method.
17321732

@@ -1812,7 +1812,7 @@ Similarly, add [=event handler IDL attributes=]
18121812
to {{WindowEventHandlers}} rather than {{Window}}.
18131813
</p>
18141814

1815-
<h3 id="events-are-for-notification">Events are for notification</h3>
1815+
<h3 id="events-are-for-notification">Use events for notification</h3>
18161816

18171817
Events shouldn't be used to trigger changes,
18181818
only to deliver a notification that a change has already finished happening.
@@ -1970,14 +1970,14 @@ as it implies that it's possible to dispatch an event asynchronously.
19701970
All events are dispatched synchronously.
19711971
What is more often implied by "asynchronous event" is to defer firing an event.
19721972

1973-
<h3 id="state-and-subclassing">State and {{Event}} subclasses</h3>
1973+
<h3 id="state-and-subclassing">Use plain {{Event}}s for state</h3>
19741974

19751975
Where possible, use a plain {{Event}} with a specified `type`,
19761976
and capture any state information in the {{Event/target}} object.
19771977

19781978
It's usually not necessary to create new subclasses of {{Event}}.
19791979

1980-
<h3 id="events-vs-observers">How to decide between Events and Observers</h3>
1980+
<h3 id="events-vs-observers">Use Events and Observers appropriately</h3>
19811981

19821982
In general, use {{EventTarget}} and notification {{Event}}s,
19831983
rather than an Observer pattern,
@@ -2527,7 +2527,7 @@ or even restricting it further to only the current active tab.
25272527
Additionally, APIs should be designed so that the applications
25282528
can gracefully handle physical disruption, such as a device being unplugged.
25292529

2530-
<h3 id="wrapper-apis">Native APIs don't typically translate well to the web</h3>
2530+
<h3 id="wrapper-apis">Adapt native APIs using web platform principles</h3>
25312531

25322532
When adapting native operating system APIs for the web,
25332533
make sure the new web APIs are designed with web platform principles in mind.
@@ -2562,7 +2562,7 @@ make sure the new web APIs are designed with web platform principles in mind.
25622562

25632563
<h2 id="other-considerations">Other API Design Considerations</h2>
25642564

2565-
<h3 id="polyfills">Polyfills</h3>
2565+
<h3 id="polyfills">Enable polyfills for new features</h3>
25662566

25672567
Polyfills can be hugely beneficial
25682568
in helping to roll out new features to the web platform.
@@ -2589,7 +2589,7 @@ we still recommend designing the feature with DedicatedWorker support in mind,
25892589
in order to not add assumptions that will later make it unnecessarily hard to expose
25902590
these APIs to DedicatedWorker.
25912591

2592-
<h3 id="new-data-formats">New Data Formats</h3>
2592+
<h3 id="new-data-formats">Add new data formats properly</h3>
25932593

25942594
Always define a corresponding MIME type and extend existing APIs to support this type
25952595
for any new data format.
@@ -2618,7 +2618,7 @@ due to security implications, and instead recommend enforcing strict MIME types
26182618

26192619
New MIME types should have a specification and should be registered with the Internet Assigned Numbers Authority (IANA).
26202620

2621-
<h3 id="new-http-header-syntax">New HTTP Headers</h3>
2621+
<h3 id="new-http-header-syntax">Conform new HTTP Headers to standards</h3>
26222622

26232623
If you are defining a new HTTP header,
26242624
its syntax mustn't go against
@@ -2704,7 +2704,7 @@ which meant converting the names to camel-cased version.
27042704
One such example is the <a href="https://w3c.github.io/image-resource/">image resource</a>.
27052705
For this reason, if a key can clearly be expressed as a single word, that is recommended.
27062706

2707-
<h3 id="debuggability">Features should be developer-friendly</h3>
2707+
<h3 id="debuggability">Ensure features are developer-friendly</h3>
27082708

27092709
Any new feature should be developer-friendly.
27102710
While it is hard to quantify friendliness, at least consider the following points.
@@ -2793,7 +2793,7 @@ or show different user interfaces for things like permission prompts.
27932793
Note: Implementers should file bugs against specifications
27942794
which don't give them clear enough information to write the implementation.
27952795

2796-
<h4 id="algorithms">Defining algorithms in specifications</h4>
2796+
<h4 id="algorithms">Define algorithms clearly</h4>
27972797

27982798
Write algorithms in a way that is clear and concise.
27992799

@@ -2912,9 +2912,9 @@ to name this API less directly connected to its return type. [[FETCH]]
29122912
Names must adhere to the local language restrictions, for example CSS ident rules etc.
29132913
and *should* be in the [=ascii code point|ASCII range=].
29142914

2915-
<h3 id="naming-consultation">Consultation</h4>
2915+
<h3 id="naming-consultation">Consult others on naming</h4>
29162916

2917-
Please consult widely on names in your APIs.
2917+
Consult widely on names in your APIs.
29182918

29192919
You may find good names or inspiration in surprising places.
29202920
- What are similar APIs named on other platforms,
@@ -2966,7 +2966,8 @@ If you need to refer to a generic persona,
29662966
such as an author or user,
29672967
use the generic pronoun "they", "their", etc.
29682968
For example, "A user may wish to adjust their preferences".
2969-
<h3 id="naming-future-proofing">Future-proofing</h4>
2969+
2970+
<h3 id="naming-future-proofing">Use future-proof names</h4>
29702971

29712972
Naming should be generic and future-proof whenever possible.
29722973

@@ -2993,7 +2994,7 @@ as they were to PS/2 and ADB keyboards back then. [[UIEVENTS]]
29932994

29942995
</div>
29952996

2996-
<h3 id="naming-consistency">Consistency</h4>
2997+
<h3 id="naming-consistency">Name things consistently</h4>
29972998
Naming schemes should aim for consistency, to avoid confusion.
29982999

29993000
Sets of related names should agree with each other in:
@@ -3093,7 +3094,7 @@ examples that violate the above rules are {{XMLHttpRequest}} and
30933094
initialisms, even if they are repeated.
30943095
</div>
30953096

3096-
<h3 id="naming-unsafe">Warning about dangerous features</h4>
3097+
<h3 id="naming-unsafe">Warn about dangerous features</h4>
30973098

30983099
Where possible, mark features that weaken
30993100
the guarantees provided to developers
@@ -3106,7 +3107,7 @@ CSP also provides features that weaken this guarantee,
31063107
such as the `unsafe-inline` keyword,
31073108
which reduces CSP's own protections by allowing inline scripts.
31083109

3109-
<h3 id="writing-resources">Other resources</h3>
3110+
<h2 id="writing-resources">Other resources</h2>
31103111

31113112
Some useful advice on how to write specifications is available elsewhere:
31123113
* <a href="https://ln.hixie.ch/?start=1140242962&amp;count=1">Writing

0 commit comments

Comments
 (0)