Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 7 additions & 39 deletions notifications.bs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ Translation: ko https://ko.htmlspecs.com/notifications/
</pre>

<pre class=anchors>
urlPrefix: https://w3c.github.io/vibration/
urlPrefix: #dfn-; type: dfn
text: perform vibration
text: validate and normalize
urlPrefix: #idl-def-; type: interface
text: VibratePattern; url: vibratepattern
urlPrefix: https://tc39.github.io/ecma262/
urlPrefix: #sec-object.; type: dfn
text: freeze
Expand All @@ -29,15 +23,14 @@ urlPrefix: https://tc39.github.io/ecma262/
<p>This specification depends on the Infra Standard. [[!INFRA]]

<p>Some terms used in this specification are defined in the DOM, Fetch, High Resolution Time, HTML,
IDL, Service Workers, URL, and Vibration API Standards.
IDL, Service Workers, and URL Standards.
[[!DOM]]
[[!FETCH]]
[[!HR-TIME]]
[[!HTML]]
[[!WEBIDL]]
[[!SERVICE-WORKERS]]
[[!URL]]
[[!VIBRATION]]


<h2 id=notifications>Notifications</h2>
Expand Down Expand Up @@ -88,8 +81,8 @@ initially false. When true, indicates that the end user should be alerted after

<p>A <a for=/>notification</a> has an associated
<dfn for=notification id=silent-preference-flag>silent preference</dfn> (null or a boolean). It is
initially null. When true, indicates that no sounds or vibrations should be made. When null,
indicates that producing sounds or vibrations should be left to platform conventions.
initially null. When true, indicates that no sounds should be made. When null, indicates that
producing sounds should be left to platform conventions.
Comment on lines +84 to +85
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be kept intact, because notifications can still make vibrations regardless of Vibration API?


<p>A <a for=/>notification</a> has an associated
<dfn for=notification id=require-interaction-preference-flag>require interaction preference</dfn>
Expand Down Expand Up @@ -119,15 +112,10 @@ not enough space to display the <a for=/>notification</a> itself. It <em>may</em
the <a for=/>notification</a>, but then it should have less visual priority than the
<a for=notification>image resource</a> and <a for=notification>icon resource</a>.

<p>A <a for=/>notification</a> has an associated
<dfn for=notification id=vibration-pattern>vibration pattern</dfn> (a <a for=/>list</a>). It is
initially « ».

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

<p>A <a for=/>notification</a> has associated <dfn export for=notification id=actions>actions</dfn>
(a <a for=/>list</a> of zero or more <a for=/>notification actions</a>). A
Expand Down Expand Up @@ -203,10 +191,6 @@ important information through, e.g., loss of color or clipped corners.
<ol>
<li><p>Let <var>notification</var> be a new <a for=/>notification</a>.

<li><p>If <var>options</var>["{{NotificationOptions/silent}}"] is true and
<var>options</var>["{{NotificationOptions/vibrate}}"] <a for=map>exists</a>, then <a>throw</a> a
{{TypeError}}.

<li><p>If <var>options</var>["{{NotificationOptions/renotify}}"] is true and
<var>options</var>["{{NotificationOptions/tag}}"] is the empty string, then <a>throw</a> a
{{TypeError}}.
Expand Down Expand Up @@ -250,10 +234,6 @@ important information through, e.g., loss of color or clipped corners.
<var>notification</var>'s <a for=notification>badge URL</a> to the return value. (Otherwise
<var>notification</var>'s <a for=notification>badge URL</a> is not set.)

<li><p>If <var>options</var>["{{NotificationOptions/vibrate}}"] <a for=map>exists</a>, then
<a>validate and normalize</a> it and set <var>notification</var>'s
<a for=notification>vibration pattern</a> to the return value.

<li><p>If <var>options</var>["{{NotificationOptions/timestamp}}"] <a for=map>exists</a>, then set
<var>notification</var>'s <a for=notification>timestamp</a> to the value. Otherwise, set
<var>notification</var>'s <a for=notification>timestamp</a> to <var>fallbackTimestamp</var>.
Expand Down Expand Up @@ -660,15 +640,8 @@ the end user, the <a>close steps</a> for it must be run.

<h3 id=alerting-the-user>Alerting the end user</h3>

<div algorithm>
<p>The <dfn>alert steps</dfn> for alerting the end user about a given <a for=/>notification</a>
<var>notification</var> are:

<ol>
<li><p><a>Perform vibration</a> using <var>notification</var>'s
<a for=notification>vibration pattern</a>, if any.
</ol>
</div>
<p>The <dfn>alert steps</dfn> for alerting the end user about a given <a for=/>notification</a> are
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily something should be done in this PR, but this can probably just be inlined.

to optionally alert the end user in a user-agent-defined manner (e.g., by playing a sound).


<h2 id=api>API</h2>
Expand Down Expand Up @@ -697,7 +670,6 @@ interface Notification : EventTarget {
readonly attribute USVString image;
readonly attribute USVString icon;
readonly attribute USVString badge;
[SameObject] readonly attribute FrozenArray&lt;unsigned long> vibrate;
readonly attribute EpochTimeStamp timestamp;
readonly attribute boolean renotify;
readonly attribute boolean? silent;
Expand All @@ -717,7 +689,6 @@ dictionary NotificationOptions {
USVString image;
USVString icon;
USVString badge;
VibratePattern vibrate;
EpochTimeStamp timestamp;
boolean renotify = false;
boolean? silent = null;
Expand Down Expand Up @@ -948,9 +919,6 @@ return the <a>maximum number of actions</a> supported.
<a lt="URL serializer">serialized</a>.
</ol>

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

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

Expand Down
Loading