Re: [w3c/push-api] Restructure the `push` event (#237)

martinthomson approved this pull request.



> -          <li>Set the <code>data</code> attribute of the event to a new <a>PushMessageData</a>
-          instance with <code>bytes</code> set to <var>b</var>.
-          </li>
-        </ol>
+            </li>
+            <li>Set <var>b</var> to the result of <a data-lt="extract a byte sequence">extracting a
+            byte sequence</a> from the "<code>data</code>" member of <var>eventInitDict</var>.
+            </li>
+            <li>Set the <code>data</code> attribute of the event to a new <a>PushMessageData</a>
+            instance with <code>bytes</code> set to <var>b</var>.
+            </li>
+          </ol>
+          <p>
+            The <dfn>data</dfn> attribute contains the data included in the <a>push message</a> when
+            included and the <a>user agent</a> verified its authenticity. The value will be set to
+            <code>null</code> in all other cases.

Yes, that's fine.

> +                    </li>
+                    <li>Discard the <a>push message</a>.
+                    </li>
+                    <li>Terminate this process.
+                    </li>
+                  </ol>A <code>push</code> event MUST NOT be fired for a <a>push message</a> that was
+                  not successfully decrypted using the key pair associated with the <a>push
+                  subscription</a>.
+                </li>
+                <li>Let <var>data</var> be a new <a>PushMessageData</a> instance with the decrypted
+                plain text of the <a>push message</a>.
+                </li>
+              </ol>
+            </li>
+            <li><a>Fire the push event</a> with <var>registration</var> and <var>data</var>, and
+            set <var>event</var> to the returned <a>trusted event</a>.

OK.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/pull/237#pullrequestreview-22855513

Received on Tuesday, 21 February 2017 00:02:50 UTC