Skip to content

Commit 37649c3

Browse files
committed
Editorial: improve notification member types
1 parent d5618b0 commit 37649c3

File tree

1 file changed

+75
-75
lines changed

1 file changed

+75
-75
lines changed

notifications.bs

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ urlPrefix: https://w3c.github.io/vibration/
1616
text: validate and normalize
1717
urlPrefix: #idl-def-; type: interface
1818
text: VibratePattern; url: vibratepattern
19-
urlPrefix: https://tc39.github.io/ecma262/#sec-object.; type: dfn
20-
text: freeze
19+
urlPrefix: https://tc39.github.io/ecma262/
20+
urlPrefix: #sec-object.; type: dfn
21+
text: freeze
22+
url: #sec-list-and-record-specification-type; type: dfn; text: Record
2123
</pre>
2224

2325

@@ -42,90 +44,88 @@ IDL, Service Workers, URL, and Vibration API Standards.
4244
<p>A <dfn id=concept-notification>notification</dfn> is an abstract
4345
representation of something that happened, such as the delivery of a message.
4446

45-
<p>A <a>notification</a> has an associated
47+
<p>A <a for=/>notification</a> has an associated
4648
<dfn for=notification id=service-worker-registration>service worker registration</dfn> (null
4749
or a <a for=/>service worker registration</a>). It is initially null.
4850

49-
<p>A <a>notification</a> has an associated
50-
<dfn for=notification id=concept-title>title</dfn> which is a string.
51+
<p>A <a for=/>notification</a> has an associated <dfn for=notification id=concept-title>title</dfn> (a string).
5152

52-
<p>A <a>notification</a> has an associated
53-
<dfn for=notification id=concept-direction>direction</dfn> which is "<code>auto</code>",
54-
"<code>ltr</code>", or "<code>rtl</code>".
53+
<p>A <a for=/>notification</a> has an associated
54+
<dfn for=notification id=concept-direction>direction</dfn> ("<code>auto</code>", "<code>ltr</code>",
55+
or "<code>rtl</code>").
5556

56-
<p>A <a>notification</a> has an associated
57-
<dfn for=notification id=concept-language>language</dfn> which is a string
58-
representing either a valid BCP 47 language tag or the empty string.
57+
<p>A <a for=/>notification</a> has an associated
58+
<dfn for=notification id=concept-language>language</dfn> (a string).
5959

60-
<p>A <a>notification</a> has an associated <dfn for=notification id=body>body</dfn> which is a
61-
string.
60+
<p>A <a for=/>notification</a> has an associated <dfn for=notification id=body>body</dfn> (a
61+
string).
6262

63-
<p>A <a>notification</a> has an associated
64-
<dfn for=notification id=tag>tag</dfn> which is a string.
63+
<p>A <a for=/>notification</a> has an associated <dfn for=notification id=tag>tag</dfn> (a string).
6564

66-
<p>A <a>notification</a> has an associated
67-
<dfn for=notification id=data>data</dfn>.
65+
<p>A <a for=/>notification</a> has an associated <dfn for=notification id=data>data</dfn> (a
66+
<a for=/>Record</a>).
6867

69-
<p>A <a>notification</a> has an associated <dfn for=notification id=timestamp>timestamp</dfn> which
70-
is an {{EpochTimeStamp}} representing the time.
68+
<p>A <a for=/>notification</a> has an associated <dfn for=notification id=timestamp>timestamp</dfn>
69+
(an {{EpochTimeStamp}}).
7170

7271
<p class=note>Timestamps can be used to indicate the time at which a notification
7372
is actual. For example, this could be in the past when a notification is used for
7473
a message that couldn't immediately be delivered because the device was offline,
7574
or in the future for a meeting that is about to start.
7675

77-
<p>A <a>notification</a> has an associated
78-
<dfn for=notification id=concept-origin>origin</dfn>.
76+
<p>A <a for=/>notification</a> has an associated
77+
<dfn for=notification id=concept-origin>origin</dfn> (an <a for=/>origin</a>).
7978

80-
<p>A <a>notification</a> has an associated
81-
<dfn for=notification id=renotify-preference-flag>renotify preference</dfn> boolean, which is
79+
<p>A <a for=/>notification</a> has an associated
80+
<dfn for=notification id=renotify-preference-flag>renotify preference</dfn> (a boolean). It is
8281
initially false. When true, indicates that the end user should be alerted after the
8382
<a>show steps</a> have run with a new notification that has the same <a for=notification>tag</a> as
8483
an existing notification.
8584

86-
<p>A <a>notification</a> has an associated
87-
<dfn for=notification id=silent-preference-flag>silent preference</dfn> boolean or null, which is
85+
<p>A <a for=/>notification</a> has an associated
86+
<dfn for=notification id=silent-preference-flag>silent preference</dfn> (null or a boolean). It is
8887
initially null. When true, indicates that no sounds or vibrations should be made. When null,
8988
indicates that producing sounds or vibrations should be left to platform conventions.
9089

91-
<p>A <a>notification</a> has an associated
90+
<p>A <a for=/>notification</a> has an associated
9291
<dfn for=notification id=require-interaction-preference-flag>require interaction preference</dfn>
93-
boolean, which is initially false. When true, indicates that on devices with a sufficiently large
92+
(a boolean). It is initially false. When true, indicates that on devices with a sufficiently large
9493
screen, the notification should remain readily available until the end user activates or dismisses
9594
the notification.
9695

97-
<p>A <a>notification</a> <em>can</em> have these associated graphics: an
96+
<p>A <a for=/>notification</a> <em>can</em> have these associated graphics: an
9897
<dfn for=notification id=image-url>image URL</dfn>,
9998
<dfn for=notification id=icon-url>icon URL</dfn>, and
10099
<dfn for=notification id=badge-url>badge URL</dfn>; and their corresponding
101100
<a for=notification>image resource</a>, <a for=notification>icon resource</a>, and
102101
<a for=notification>badge resource</a>.
103102

104103
<p>An <dfn for=notification id=image-resource>image resource</dfn> is a picture shown as part of the
105-
content of the <a>notification</a>, and should be displayed with higher visual priority than the
104+
content of the <a for=/>notification</a>, and should be displayed with higher visual priority than the
106105
<a for=notification>icon resource</a> and <a for=notification>badge resource</a>, though it may be
107106
displayed in fewer circumstances.
108107

109108
<p>An <dfn for=notification id=icon-resource>icon resource</dfn> is an image that reinforces the
110-
<a>notification</a> (such as an icon, or a photo of the sender).
109+
<a for=/>notification</a> (such as an icon, or a photo of the sender).
111110

112111
<p>A <dfn for=notification id=badge-resource>badge resource</dfn> is an icon representing the web
113-
application, or the category of the <a>notification</a> if the web application sends a wide variety
114-
of <a>notifications</a>. It <em>may</em> be used to represent the <a>notification</a> when there is
115-
not enough space to display the <a>notification</a> itself. It <em>may</em> also be displayed inside
116-
the <a>notification</a>, but then it should have less visual priority than the
112+
application, or the category of the <a for=/>notification</a> if the web application sends a wide variety
113+
of <a>notifications</a>. It <em>may</em> be used to represent the <a for=/>notification</a> when there is
114+
not enough space to display the <a for=/>notification</a> itself. It <em>may</em> also be displayed inside
115+
the <a for=/>notification</a>, but then it should have less visual priority than the
117116
<a for=notification>image resource</a> and <a for=notification>icon resource</a>.
118117

119-
<p>A <a>notification</a> has an associated
120-
<dfn for=notification id=vibration-pattern>vibration pattern</dfn>, which is initially « ».
118+
<p>A <a for=/>notification</a> has an associated
119+
<dfn for=notification id=vibration-pattern>vibration pattern</dfn> (a <a for=/>list</a>). It is
120+
initially « ».
121121

122122
<p class=note>Developers are encouraged to not convey information through an
123123
<a for=notification lt="image resource">image</a>, <a for=notification lt="icon resource">icon</a>,
124124
<a for=notification lt="badge resource">badge</a>, or <a for=notification>vibration pattern</a> that
125125
is not otherwise accessible to the end user, especially since notification platforms that do not
126126
support these features might ignore them.
127127

128-
<p>A <a>notification</a> has associated <dfn for=notification id=actions>actions</dfn> (a
128+
<p>A <a for=/>notification</a> has associated <dfn for=notification id=actions>actions</dfn> (a
129129
<a for=/>list</a> of zero or more <a for=/>actions</a>). An <dfn>action</dfn> represents a choice
130130
for an end user. Each <a for=/>action</a> has an associated:
131131

@@ -157,10 +157,10 @@ corners or painting it in a specific color. Developers are encouraged to use an
157157
such cases gracefully and does not lose important information through, e.g., loss of color or
158158
clipped corners.
159159

160-
<p>A <dfn>non-persistent notification</dfn> is a <a>notification</a> whose
160+
<p>A <dfn>non-persistent notification</dfn> is a <a for=/>notification</a> whose
161161
<a for=notification>service worker registration</a> is null.
162162

163-
<p tracking-vector>A <dfn>persistent notification</dfn> is a <a>notification</a> whose
163+
<p tracking-vector>A <dfn>persistent notification</dfn> is a <a for=/>notification</a> whose
164164
<a for=notification>service worker registration</a> is non-null.
165165

166166
<hr>
@@ -193,7 +193,7 @@ clipped corners.
193193
<var>fallbackTimestamp</var>:
194194

195195
<ol>
196-
<li><p>Let <var>notification</var> be a new <a>notification</a>.
196+
<li><p>Let <var>notification</var> be a new <a for=/>notification</a>.
197197

198198
<li><p>If <var>options</var>["{{NotificationOptions/silent}}"] is true and
199199
<var>options</var>["{{NotificationOptions/vibrate}}"] <a for=map>exists</a>, then <a>throw</a> a
@@ -333,32 +333,32 @@ section of HTML. [[!HTML]]
333333
https://html.spec.whatwg.org/multipage/rendering.html#text-rendered-in-native-user-interfaces -->
334334

335335
<p>User agents are expected to honor the Unicode semantics of the text of a
336-
<a>notification</a>'s <a for=notification>title</a>, <a for=notification>body</a>, and the
336+
<a for=/>notification</a>'s <a for=notification>title</a>, <a for=notification>body</a>, and the
337337
<a for=action>title</a> of each of its <a for=notification>actions</a>. Each is expected
338338
to be treated as an independent set of one or more bidirectional algorithm
339339
paragraphs when displayed, as defined by the bidirectional algorithm's rules P1,
340340
P2, and P3, including, for instance, supporting the paragraph-breaking behavior
341341
of U+000A LINE FEED (LF) characters. For each paragraph of the
342342
<a for=notification>title</a>, <a for=notification>body</a> and the
343343
<a for=action>title</a> of each of the <a for=notification>actions</a>, the
344-
<a>notification</a>'s
344+
<a for=/>notification</a>'s
345345
<a for=notification>direction</a> provides the higher-level override of
346346
rules P2 and P3 if it has a value other than "<code>auto</code>". [[!BIDI]]
347347

348-
<p>The <a>notification</a>'s <a for=notification>direction</a> also determines the relative order in
349-
which the <a>notification</a>'s <a for=notification>actions</a> should be displayed to the end user,
350-
if the notification platform displays them side by side.
348+
<p>The <a for=/>notification</a>'s <a for=notification>direction</a> also determines the relative
349+
order in which the <a for=/>notification</a>'s <a for=notification>actions</a> should be displayed
350+
to the end user, if the notification platform displays them side by side.
351351

352352

353353
<h3 id=language>Language</h3>
354354

355355
<!-- keep this in sync with
356356
https://html.spec.whatwg.org/multipage/dom.html#attr-lang -->
357357

358-
<p>The <a>notification</a>'s <a for=notification>language</a> specifies the primary language for the
359-
<a>notification</a>'s <a for=notification>title</a>, <a for=notification>body</a> and the
360-
<a for=notification>title</a> of each of its <a for=notification>actions</a>. Its value is a string.
361-
The empty string indicates that the primary language is unknown. Any other string must be
358+
<p>The <a for=/>notification</a>'s <a for=notification>language</a> specifies the primary language
359+
for the <a for=/>notification</a>'s <a for=notification>title</a>, <a for=notification>body</a> and
360+
the <a for=notification>title</a> of each of its <a for=notification>actions</a>. Its value is a
361+
string. The empty string indicates that the primary language is unknown. Any other string must be
362362
interpreted as a language tag. Validity or well-formedness are not enforced. [[!BCP47]]
363363

364364
<p class=note>Developers are encouraged to only use valid language tags.
@@ -478,7 +478,7 @@ interpreted as a language tag. Validity or well-formedness are not enforced. [[!
478478

479479
<li><p>Let <var>shown</var> be false.
480480

481-
<li><p>Let <var>oldNotification</var> be the <a>notification</a> in the
481+
<li><p>Let <var>oldNotification</var> be the <a for=/>notification</a> in the
482482
<a>list of notifications</a> whose <a for=notification>tag</a> is not the empty string and is
483483
<var>notification</var>'s <a for=notification>tag</a>, and whose <a for=notification>origin</a> is
484484
<a>same origin</a> with <var>notification</var>'s <a for=notification>origin</a>, if any, and null
@@ -572,8 +572,8 @@ platform supports activation, the user agent must (unless otherwise specified) r
572572

573573
<h3 id=closing-a-notification>Closing a notification</h3>
574574

575-
<p>When a <a>notification</a> is closed, either by the underlying notification platform or by the
576-
end user, the <a>close steps</a> for it must be run.
575+
<p>When a <a for=/>notification</a> is closed, either by the underlying notification platform or by
576+
the end user, the <a>close steps</a> for it must be run.
577577

578578
<div algorithm>
579579
<p>The <dfn>close steps</dfn> for a given <a for=/>notification</a> <var>notification</var> are:
@@ -702,7 +702,7 @@ object and can be created through {{Notification}}'s
702702
<h3 id=garbage-collection>Garbage collection</h3>
703703

704704
<p>A {{Notification}} object must not be garbage collected while the <a>list of notifications</a>
705-
<a for=list>contains</a> its corresponding <a>notification</a> and it has an
705+
<a for=list>contains</a> its corresponding <a for=/>notification</a> and it has an
706706
<a for=/>event listener</a> whose <b>type</b> is <code>click</code>, <code>show</code>,
707707
<code>close</code>, or <code>error</code>.
708708

@@ -835,70 +835,70 @@ return the <a>maximum number of actions</a> supported.
835835
</table>
836836

837837
<p>The <dfn method for=Notification><code>close()</code></dfn> method steps are to run the
838-
<a>close steps</a> for <a>this</a>'s <a>notification</a>.
838+
<a>close steps</a> for <a>this</a>'s <a for=/>notification</a>.
839839

840840
<p>The <dfn attribute for=Notification><code>title</code></dfn> getter steps are to return
841-
<a>this</a>'s <a>notification</a>'s <a for=notification>title</a>.
841+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>title</a>.
842842

843843
<p>The <dfn attribute for=Notification><code>dir</code></dfn> getter steps are to return
844-
<a>this</a>'s <a>notification</a>'s <a for=notification>direction</a>.
844+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>direction</a>.
845845

846846
<p>The <dfn attribute for=Notification><code>lang</code></dfn> getter steps are to return
847-
<a>this</a>'s <a>notification</a>'s <a for=notification>language</a>.
847+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>language</a>.
848848

849849
<p>The <dfn attribute for=Notification><code>body</code></dfn> getter steps are to return
850-
<a>this</a>'s <a>notification</a>'s <a for=notification>body</a>.
850+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>body</a>.
851851

852852
<p>The <dfn attribute for=Notification><code>tag</code></dfn> getter steps are to return
853-
<a>this</a>'s <a>notification</a>'s <a for=notification>tag</a>.
853+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>tag</a>.
854854

855855
<p>The <dfn attribute dfn-for=Notification><code>image</code></dfn> getter steps are:
856856

857857
<ol>
858-
<li><p>If there is no <a>this</a>'s <a>notification</a>'s <a for=notification>image URL</a>, then
858+
<li><p>If there is no <a>this</a>'s <a for=/>notification</a>'s <a for=notification>image URL</a>, then
859859
return the empty string.
860860

861-
<li><p>Return <a>this</a>'s <a>notification</a>'s <a for=notification>image URL</a>,
861+
<li><p>Return <a>this</a>'s <a for=/>notification</a>'s <a for=notification>image URL</a>,
862862
<a lt="URL serializer">serialized</a>.
863863
</ol>
864864

865865
<p>The <dfn attribute for=Notification><code>icon</code></dfn> getter steps are:
866866

867867
<ol>
868-
<li><p>If there is no <a>this</a>'s <a>notification</a>'s <a for=notification>icon URL</a>, then
868+
<li><p>If there is no <a>this</a>'s <a for=/>notification</a>'s <a for=notification>icon URL</a>, then
869869
return the empty string.
870870

871-
<li><p>Return <a>this</a>'s <a>notification</a>'s <a for=notification>icon URL</a>,
871+
<li><p>Return <a>this</a>'s <a for=/>notification</a>'s <a for=notification>icon URL</a>,
872872
<a lt="URL serializer">serialized</a>.
873873
</ol>
874874

875875
<p>The <dfn attribute for=Notification><code>badge</code></dfn> getter steps are:
876876

877877
<ol>
878-
<li><p>If there is no <a>this</a>'s <a>notification</a>'s <a for=notification>badge URL</a>, then
878+
<li><p>If there is no <a>this</a>'s <a for=/>notification</a>'s <a for=notification>badge URL</a>, then
879879
return the empty string.
880880

881-
<li><p>Return <a>this</a>'s <a>notification</a>'s <a for=notification>badge URL</a>,
881+
<li><p>Return <a>this</a>'s <a for=/>notification</a>'s <a for=notification>badge URL</a>,
882882
<a lt="URL serializer">serialized</a>.
883883
</ol>
884884

885885
<p>The <dfn attribute for=Notification><code>vibrate</code></dfn> getter steps are to return
886-
<a>this</a>'s <a>notification</a>'s <a for=notification>vibration pattern</a>.
886+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>vibration pattern</a>.
887887

888888
<p>The <dfn attribute for=Notification><code>timestamp</code></dfn> getter steps are to return
889-
<a>this</a>'s <a>notification</a>'s <a for=notification>timestamp</a>.
889+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>timestamp</a>.
890890

891891
<p>The <dfn attribute for=Notification><code>renotify</code></dfn> getter steps are to return
892-
<a>this</a>'s <a>notification</a>'s <a for=notification>renotify preference</a>.
892+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>renotify preference</a>.
893893

894894
<p>The <dfn attribute for=Notification><code>silent</code></dfn> getter steps are to return
895-
<a>this</a>'s <a>notification</a>'s <a for=notification>silent preference</a>.
895+
<a>this</a>'s <a for=/>notification</a>'s <a for=notification>silent preference</a>.
896896

897897
<p>The <dfn attribute for=Notification><code>requireInteraction</code></dfn> getter steps are to
898-
return <a>this</a>'s <a>notification</a>'s <a for=notification>require interaction preference</a>.
898+
return <a>this</a>'s <a for=/>notification</a>'s <a for=notification>require interaction preference</a>.
899899

900900
<p>The <dfn attribute for=Notification><code>data</code></dfn> getter steps are to return
901-
<a abstract-op>StructuredDeserialize</a>(<a>this</a>'s <a>notification</a>'s
901+
<a abstract-op>StructuredDeserialize</a>(<a>this</a>'s <a for=/>notification</a>'s
902902
<a for=notification>data</a>, <a>this</a>'s <a>relevant Realm</a>). If this throws an exception,
903903
then return null.
904904
<!-- Relies on SameObject becoming Cached as proposed -->
@@ -909,7 +909,7 @@ then return null.
909909
<li><p>Let <var>frozenActions</var> be an empty list of type {{NotificationAction}}.
910910

911911
<li>
912-
<p><a for=list>For each</a> <var>entry</var> of <a>this</a>'s <a>notification</a>'s
912+
<p><a for=list>For each</a> <var>entry</var> of <a>this</a>'s <a for=/>notification</a>'s
913913
<a for=notification>actions</a>:
914914

915915
<ol>
@@ -1138,9 +1138,9 @@ method steps are:
11381138
<ol>
11391139
<li><p>Let <var>objects</var> be a <a for=/>list</a>.
11401140

1141-
<li><p><a for=list>For each</a> <a>notification</a> in <var>notifications</var>, in creation
1141+
<li><p><a for=list>For each</a> <a for=/>notification</a> in <var>notifications</var>, in creation
11421142
order, create a <a for=/>new</a> {{Notification}} object with <var>realm</var> representing
1143-
<a>notification</a>, and <a for=list>append</a> it to <var>objects</var>.
1143+
<a for=/>notification</a>, and <a for=list>append</a> it to <var>objects</var>.
11441144

11451145
<li><p><a for=/>Resolve</a> <var>promise</var> with <var>objects</var>.
11461146
</ol>
@@ -1150,7 +1150,7 @@ method steps are:
11501150
</ol>
11511151

11521152
<p class=note>This method returns zero or more new {{Notification}} objects which might represent
1153-
the same underlying <a>notification</a> of {{Notification}} objects already in existence.
1153+
the same underlying <a for=/>notification</a> of {{Notification}} objects already in existence.
11541154
</div>
11551155

11561156
<hr>

0 commit comments

Comments
 (0)