|
1 | 1 | { |
2 | 2 | "spec": { |
3 | | - "title": "Vibration API (Second Edition)", |
| 3 | + "title": "Vibration API", |
4 | 4 | "url": "https://www.w3.org/TR/vibration/" |
5 | 5 | }, |
6 | 6 | "algorithms": [ |
7 | 7 | { |
8 | 8 | "name": "processing vibration patterns", |
9 | 9 | "href": "https://www.w3.org/TR/vibration/#dfn-processing-vibration-patterns", |
10 | | - "html": "The rules for <dfn data-dfn-type=\"dfn\" id=\"dfn-processing-vibration-patterns\">processing vibration patterns</dfn> are as given in the following algorithm:", |
| 10 | + "html": "The rules for <dfn id=\"dfn-processing-vibration-patterns\" tabindex=\"0\" aria-haspopup=\"dialog\" data-dfn-type=\"dfn\">processing vibration patterns</dfn> are as given in\n the following algorithm:", |
11 | 11 | "rationale": "let", |
12 | 12 | "steps": [ |
13 | 13 | { |
14 | | - "html": "Let <var>pattern</var> be the first method argument of the\n <code><a href=\"https://www.w3.org/TR/vibration/#idl-def-navigator-vibrate(vibratepattern)\" class=\"internalDFN\" data-link-type=\"dfn\"><code>vibrate</code></a>()</code> method." |
| 14 | + "html": "Let <var>pattern</var> be the first method argument of the\n <code><a href=\"https://www.w3.org/TR/vibration/#dom-navigator-vibrate\" class=\"internalDFN\" data-link-type=\"idl\" id=\"ref-for-dom-navigator-vibrate-2\"><code>vibrate</code></a>()</code> method." |
15 | 15 | }, |
16 | 16 | { |
17 | | - "html": "Let <var>valid pattern</var> be the result of passing\n <var>pattern</var> to <a href=\"https://www.w3.org/TR/vibration/#dfn-validate-and-normalize\" class=\"internalDFN\" data-link-type=\"dfn\">validate and normalize</a>." |
| 17 | + "html": "Let <var>valid pattern</var> be the result of passing\n <var>pattern</var> to <a href=\"https://www.w3.org/TR/vibration/#dfn-validate-and-normalize\" class=\"internalDFN\" data-link-type=\"dfn\" id=\"ref-for-dfn-validate-and-normalize-1\">validate and normalize</a>." |
18 | 18 | }, |
19 | 19 | { |
20 | | - "html": "If the result of running the steps to <a href=\"https://w3c.github.io/page-visibility/#dfn-steps-to-determine-the-visibility-state\">\n determine the visibility state</a> [<cite><a class=\"bibref\" href=\"https://www.w3.org/TR/vibration/#bib-PAGE-VISIBILITY-2\">PAGE-VISIBILITY-2</a></cite>] is not <code>visible</code>, then return false and terminate these steps." |
| 20 | + "html": "If the <a data-link-type=\"dfn\" href=\"https://dom.spec.whatwg.org/#concept-document\">document</a>'s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/interaction.html#visibility-state\">visibility state</a> is not \n <code>visible</code>, then return false and terminate these steps." |
21 | 21 | }, |
22 | 22 | { |
23 | | - "html": "<a href=\"https://www.w3.org/TR/vibration/#dfn-perform-vibration\" class=\"internalDFN\" data-link-type=\"dfn\">Perform vibration</a> with <var>valid pattern</var>." |
| 23 | + "html": "<a href=\"https://www.w3.org/TR/vibration/#dfn-perform-vibration\" class=\"internalDFN\" data-link-type=\"dfn\" id=\"ref-for-dfn-perform-vibration-1\">Perform vibration</a> with <a data-link-type=\"dfn\" href=\"https://webidl.spec.whatwg.org/#this\">this</a>'s <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global\">relevant global object\n </a> and <var>valid pattern</var>." |
24 | 24 | } |
25 | 25 | ] |
26 | 26 | }, |
27 | 27 | { |
28 | 28 | "name": "validate and normalize", |
29 | 29 | "href": "https://www.w3.org/TR/vibration/#dfn-validate-and-normalize", |
30 | | - "html": "To <dfn data-dfn-type=\"dfn\" id=\"dfn-validate-and-normalize\">validate and normalize</dfn> a vibration pattern given\n <var>pattern</var>, run these steps:", |
| 30 | + "html": "To <dfn id=\"dfn-validate-and-normalize\" tabindex=\"0\" aria-haspopup=\"dialog\" data-dfn-type=\"dfn\">validate and normalize</dfn> a <a href=\"https://www.w3.org/TR/vibration/#dfn-vibration-pattern\" class=\"internalDFN\" data-link-type=\"dfn\" id=\"ref-for-dfn-vibration-pattern-1\">vibration pattern</a> given\n <var>pattern</var>, run these steps:", |
31 | 31 | "rationale": "if", |
32 | 32 | "steps": [ |
33 | 33 | { |
34 | | - "html": "If <var>pattern</var> is a list, proceed to the next step. Otherwise run the following substeps:", |
| 34 | + "html": "If <var>pattern</var> is a list, proceed to the next step.\n Otherwise run the following substeps:", |
35 | 35 | "rationale": "let", |
36 | 36 | "steps": [ |
37 | 37 | { |
|
43 | 43 | ] |
44 | 44 | }, |
45 | 45 | { |
46 | | - "html": "Let <var>max length</var> be an implementation-dependent maximum length of <var>pattern</var>." |
| 46 | + "html": "Let <var>max length</var> have the value 10." |
47 | 47 | }, |
48 | 48 | { |
49 | 49 | "html": "If the length of <var>pattern</var> is greater than <var>max\n length</var>, truncate <var>pattern</var>, leaving only the first <var>\n max length</var> entries." |
50 | 50 | }, |
51 | 51 | { |
52 | | - "html": "Let <var>max duration</var> be an implementation-dependent maximum duration for a single vibration entry in a <var>pattern</var>." |
| 52 | + "html": "Let <var>max duration</var> have the value 10000." |
53 | 53 | }, |
54 | 54 | { |
55 | 55 | "html": "For each entry in <var>pattern</var> whose value is greater than\n <var>max duration</var>, set the entry's value to <var>max\n duration</var>." |
|
62 | 62 | { |
63 | 63 | "name": "perform vibration", |
64 | 64 | "href": "https://www.w3.org/TR/vibration/#dfn-perform-vibration", |
65 | | - "html": "To <dfn data-dfn-type=\"dfn\" id=\"dfn-perform-vibration\">perform vibration</dfn> using <var>pattern</var>, run these steps:", |
66 | | - "rationale": "terminate these steps", |
| 65 | + "html": "To <dfn id=\"dfn-perform-vibration\" tabindex=\"0\" aria-haspopup=\"dialog\" data-dfn-type=\"dfn\">perform vibration</dfn> using a <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#global-object\">global object</a>\n <var>global</var> and a <a href=\"https://www.w3.org/TR/vibration/#dfn-vibration-pattern\" class=\"internalDFN\" data-link-type=\"dfn\" id=\"ref-for-dfn-vibration-pattern-2\">vibration pattern</a> <var>pattern</var>,\n run these steps:", |
| 66 | + "rationale": "if", |
67 | 67 | "steps": [ |
68 | 68 | { |
69 | | - "html": "An implementation <em class=\"rfc2119\" title=\"MAY\">MAY</em> return false and terminate these steps." |
| 69 | + "html": "If <var>global</var> does not have <a data-link-type=\"dfn\" href=\"https://html.spec.whatwg.org/multipage/interaction.html#sticky-activation\">sticky activation</a>,\n return false and terminate these steps." |
| 70 | + }, |
| 71 | + { |
| 72 | + "html": "An implementation <em class=\"rfc2119\">MAY</em> return false and terminate these steps." |
70 | 73 | }, |
71 | 74 | { |
72 | | - "html": "If another instance of the <a href=\"https://www.w3.org/TR/vibration/#dfn-perform-vibration\" class=\"internalDFN\" data-link-type=\"dfn\">perform vibration</a> algorithm is already running, run the following substeps:", |
| 75 | + "html": "If another instance of the <a href=\"https://www.w3.org/TR/vibration/#dfn-perform-vibration\" class=\"internalDFN\" data-link-type=\"dfn\" id=\"ref-for-dfn-perform-vibration-2\">perform vibration</a> algorithm is\n already running, run the following substeps:", |
73 | 76 | "rationale": "abort", |
74 | 77 | "steps": [ |
75 | 78 | { |
76 | | - "html": "Abort that other instance of the <a href=\"https://www.w3.org/TR/vibration/#dfn-perform-vibration\" class=\"internalDFN\" data-link-type=\"dfn\">perform vibration</a> algorithm, if any." |
| 79 | + "html": "Abort that other instance of the <a href=\"https://www.w3.org/TR/vibration/#dfn-perform-vibration\" class=\"internalDFN\" data-link-type=\"dfn\" id=\"ref-for-dfn-perform-vibration-3\">perform vibration</a>\n algorithm, if any." |
77 | 80 | }, |
78 | 81 | { |
79 | | - "html": "If <var>pattern</var> is an empty list, contains a single entry with a value of 0, or if the device is unable to vibrate, then return true and terminate these steps." |
| 82 | + "html": "If <var>pattern</var> is an empty list, contains a single entry\n with a value of 0, or if the device is unable to vibrate, then\n return true and terminate these steps." |
80 | 83 | } |
81 | 84 | ] |
82 | 85 | }, |
83 | 86 | { |
84 | 87 | "html": "Return true, and then continue running these steps asynchronously." |
85 | 88 | }, |
86 | 89 | { |
87 | | - "html": "For each <var>time</var> in <var>pattern</var>, run the following substeps:", |
| 90 | + "html": "For each <var>time</var> in <var>pattern</var>, run the following\n substeps:", |
88 | 91 | "rationale": "if", |
89 | 92 | "steps": [ |
90 | 93 | { |
91 | | - "html": "If the index of <var>time</var> is even (the first entry has index 0), vibrate the device for <var>time</var> milliseconds." |
| 94 | + "html": "If the index of <var>time</var> is even (the first entry has\n index 0), vibrate the device for <var>time</var> milliseconds." |
92 | 95 | }, |
93 | 96 | { |
94 | 97 | "html": "Otherwise wait for <var>time</var> milliseconds." |
|
0 commit comments