Skip to content

Commit be353e8

Browse files
authored
Removed conflicts from Jake Archibald pull request (#327)
* Removed conflicts between gh-pages and #305 * updated per Rouslan request * rouslan's fixes
1 parent e63b2d3 commit be353e8

File tree

1 file changed

+109
-75
lines changed

1 file changed

+109
-75
lines changed

index.html

Lines changed: 109 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -935,31 +935,45 @@ <h2>
935935
</li>
936936
<li>If <var>registration</var> is not found, terminate these steps.
937937
</li>
938-
<li>Invoke the <a>handle functional event</a> algorithm with a
939-
<a>ServiceWorkerRegistration</a> of <var>registration</var> and <var>
940-
callbackSteps</var> set to the following steps:
941-
<ol>
942-
<li>Set <var>global</var> to the global object that was provided
943-
as an argument.
944-
</li>
945-
<li>Create a <a>trusted event</a>, <var>e</var>, that uses the
946-
<a>CanMakePaymentEvent</a> interface, with the event type
947-
canmakepayment, which does not bubble, cannot be canceled, and
948-
has no default action.
949-
</li>
950-
<li>Set the <a data-lt=
951-
"PaymentRequestEvent.topOrigin">topOrigin</a>, <a data-lt=
952-
"PaymentRequestEvent.paymentRequestOrigin">paymentRequestOrigin</a>,
953-
and <a data-lt="PaymentRequestEvent.methodData">methodData</a>
954-
attributes of <var>e</var> the same way as when handling
955-
<a>PaymentRequestEvent</a>.
956-
</li>
957-
<li>Dispatch <var>e</var> to <var>global</var>.
958-
</li>
959-
<li>Wait for all of the promises in the <a>extend lifetime
960-
promises</a> of <var>e</var> to resolve.
961-
</li>
962-
</ol>
938+
<li>
939+
<p>
940+
<a>Fire Functional Event</a> "<code>canmakepayment</code>" using
941+
<a>CanMakePaymentEvent</a> on <var>registration</var> with the
942+
following properties:
943+
</p>
944+
<dl>
945+
<dt>
946+
<a data-lt="CanMakePaymentEvent.topOrigin">topOrigin</a>
947+
</dt>
948+
<dd>
949+
<a data-cite="!HTML#ascii-serialisation-of-an-origin">the
950+
serialization of the origin</a> of the top level payee web
951+
page.
952+
</dd>
953+
<dt>
954+
<a data-lt=
955+
"CanMakePaymentEvent.paymentRequestOrigin">paymentRequestOrigin</a>
956+
</dt>
957+
<dd>
958+
<a data-cite="!HTML#ascii-serialisation-of-an-origin">the
959+
serialization of the origin</a> of the context where
960+
PaymentRequest was initialized.
961+
</dd>
962+
<dt>
963+
<a data-lt="CanMakePaymentEvent.methodData">methodData</a>
964+
</dt>
965+
<dd>
966+
The result of executing the <a>MethodData Population
967+
Algorithm</a>.
968+
</dd>
969+
<dt>
970+
<a data-lt="CanMakePaymentEvent.modifiers">modifiers</a>
971+
</dt>
972+
<dd>
973+
The result of executing the <a>Modifiers Population
974+
Algorithm</a>.
975+
</dd>
976+
</dl>
963977
</li>
964978
</ol>
965979
</section>
@@ -1555,56 +1569,76 @@ <h2>
15551569
"<a>InvalidStateError</a>" <a>DOMException</a> and terminate these
15561570
steps.
15571571
</li>
1558-
<li>Invoke the <a>handle functional event</a> algorithm with a
1559-
<a>ServiceWorkerRegistration</a> of <var>registration</var> and <var>
1560-
callbackSteps</var> set to the following steps:
1572+
<li>
1573+
<p>
1574+
<a>Fire Functional Event</a> "<code>paymentrequest</code>" using
1575+
<a>PaymentRequestEvent</a> on <var>registration</var> with the
1576+
following properties:
1577+
</p>
1578+
<dl>
1579+
<dt>
1580+
<a data-lt="PaymentRequestEvent.topOrigin">topOrigin</a>
1581+
</dt>
1582+
<dd>
1583+
<a data-cite="!HTML#ascii-serialisation-of-an-origin">the
1584+
serialization of the origin</a> of the top level payee web
1585+
page.
1586+
</dd>
1587+
<dt>
1588+
<a data-lt=
1589+
"PaymentRequestEvent.paymentRequestOrigin">paymentRequestOrigin</a>
1590+
</dt>
1591+
<dd>
1592+
<a data-cite="!HTML#ascii-serialisation-of-an-origin">the
1593+
serialization of the origin</a> of the context where
1594+
PaymentRequest was initialized.
1595+
</dd>
1596+
<dt>
1597+
<a data-lt="PaymentRequestEvent.methodData">methodData</a>
1598+
</dt>
1599+
<dd>
1600+
The result of executing the <a>MethodData Population
1601+
Algorithm</a>.
1602+
</dd>
1603+
<dt>
1604+
<a data-lt="CanMakePaymentEvent.modifiers">modifiers</a>
1605+
</dt>
1606+
<dd>
1607+
The result of executing the <a>Modifiers Population
1608+
Algorithm</a>.
1609+
</dd>
1610+
<dt>
1611+
<a data-lt="PaymentRequestEvent.total">total</a>
1612+
</dt>
1613+
<dd>
1614+
A <a>structured clone</a> of the total field on the
1615+
<a>PaymentDetailsInit</a> from the corresponding
1616+
<a>PaymentRequest</a>.
1617+
</dd>
1618+
<dt>
1619+
<a data-lt=
1620+
"PaymentRequestEvent.paymentRequestId">paymentRequestId</a>
1621+
</dt>
1622+
<dd>
1623+
The [[\details]].<a>id</a> from the <a>PaymentRequest</a>.
1624+
</dd>
1625+
<dt>
1626+
<a data-lt=
1627+
"PaymentRequestEvent.instrumentKey">instrumentKey</a>
1628+
</dt>
1629+
<dd>
1630+
The <a>instrumentKey</a> of the selected
1631+
<a>PaymentInstrument</a>, or the empty string if none was
1632+
selected.
1633+
</dd>
1634+
</dl>
1635+
<p>
1636+
Then run the following steps in parallel, with
1637+
<var>dispatchedEvent</var>:
1638+
</p>
15611639
<ol>
1562-
<li>Set <var>global</var> to the global object that was provided
1563-
as an argument.
1564-
</li>
1565-
<li>Create a <a>trusted event</a>, <var>e</var>, that uses the
1566-
<a>PaymentRequestEvent</a> interface, with the event type
1567-
<a>paymentrequest</a>, which does not bubble, cannot be canceled,
1568-
and has no default action.
1569-
</li>
1570-
<li>Set the <a data-lt=
1571-
"PaymentRequestEvent.topOrigin">topOrigin</a> attribute of <var>
1572-
e</var> to <a data-cite=
1573-
"!HTML#ascii-serialisation-of-an-origin">the serialization of
1574-
the origin</a> of the top level payee web page.
1575-
</li>
1576-
<li>Set the <a data-lt=
1577-
"PaymentRequestEvent.paymentRequestOrigin">paymentRequestOrigin</a>
1578-
attribute of <var>e</var> to <a data-cite=
1579-
"!HTML#ascii-serialisation-of-an-origin">the serialization of the
1580-
origin</a> of the context where PaymentRequest was initialized.
1581-
</li>
1582-
<li>Set the <a data-lt=
1583-
"PaymentRequestEvent.paymentRequestId">paymentRequestId</a>
1584-
attribute of <var>e</var> to the [[\details]].<a>id</a> from the
1585-
<a>PaymentRequest</a>.
1586-
</li>
1587-
<li>Set the <a data-lt=
1588-
"PaymentRequestEvent.methodData">methodData</a> and <a data-lt=
1589-
"PaymentRequestEvent.modifiers">modifiers</a> attributes of <var>
1590-
e</var> by executing the <a>MethodData Population Algorithm</a>
1591-
and <a>Modifiers Population Algorithm</a> respectively.
1592-
</li>
1593-
<li>Set the <a data-lt="PaymentRequestEvent.total">total</a>
1594-
attribute of <var>e</var> to a <a>structured clone</a> of the
1595-
total field on the <a>PaymentDetailsInit</a> from the
1596-
corresponding <a>PaymentRequest</a>.
1597-
</li>
1598-
<li>Set the <a data-lt=
1599-
"PaymentRequestEvent.instrumentKey">instrumentKey</a> attribute
1600-
of <var>e</var> to the <a>instrumentKey</a> of the selected
1601-
<a>PaymentInstrument</a>, or the empty string if none was
1602-
selected.
1603-
</li>
1604-
<li>Dispatch <var>e</var> to <var>global</var>.
1605-
</li>
16061640
<li>Wait for all of the promises in the <a>extend lifetime
1607-
promises</a> of <var>e</var> to resolve.
1641+
promises</a> of <var>dispatchedEvent</var> to resolve.
16081642
</li>
16091643
<li>If the <a>payment handler</a> has not provided a
16101644
<a>PaymentHandlerResponse</a>, reject the <a>Promise</a> that was
@@ -2412,8 +2446,8 @@ <h2>
24122446
<code><dfn data-cite=
24132447
"!SERVICE-WORKERS#service-worker-global-scope">ServiceWorkerGlobalScope</dfn></code>,
24142448
<dfn data-cite=
2415-
"!SERVICE-WORKERS#handle-functional-event-algorithm">handle
2416-
functional event</dfn>, <dfn data-cite=
2449+
"!SERVICE-WORKERS#fire-functional-event-algorithm">fire functional
2450+
event</dfn>, <dfn data-cite=
24172451
"!SERVICE-WORKERS#dfn-extend-lifetime-promises">extend lifetime
24182452
promises</dfn>,<dfn data-cite=
24192453
"!SERVICE-WORKERS#dfn-pending-promises-count">pending promises

0 commit comments

Comments
 (0)