<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[225849] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/225849">225849</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2017-12-13 10:02:28 -0800 (Wed, 13 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
https://bugs.webkit.org/show_bug.cgi?id=180737
<rdar://problem/36013152>

Reviewed by Brady Eidson.

Source/WebCore:

Instead of firing a non-standard "applepaypaymentmethodupdate" event when the payment method
changes, use the PaymentDetailsModifier mechanism to allow the merchant to specify override
totals and additional display items per payment method type.

Test: http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html

* DerivedSources.make:
* Modules/applepay/ApplePayLineItem.idl:
* Modules/applepay/ApplePayPaymentMethod.h:
* Modules/applepay/ApplePayPaymentMethod.idl:
* Modules/applepay/ApplePayPaymentMethodType.h: Added.
* Modules/applepay/ApplePayPaymentMethodType.idl: Added.
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
* Modules/applepay/paymentrequest/ApplePayModifier.h: Added.
* Modules/applepay/paymentrequest/ApplePayModifier.idl: Added.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::show):
(WebCore::ApplePayPaymentHandler::computeTotalAndLineItems):
(WebCore::ApplePayPaymentHandler::detailsUpdated):
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
(WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
(WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
(WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Removed.
* Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Removed.
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequest.idl:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
* testing/MockPaymentCoordinator.cpp:
(WebCore::convert):
(WebCore::MockPaymentCoordinator::updateTotalAndLineItems):
(WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
(WebCore::MockPaymentCoordinator::completeShippingContactSelection):
(WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:

LayoutTests:

* http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt: Added.
* http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html: Added.
* http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt: Removed.
* http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html: Removed.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayApplePayLineItemidl">trunk/Source/WebCore/Modules/applepay/ApplePayLineItem.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayApplePayPaymentMethodh">trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayApplePayPaymentMethodidl">trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaycocoaPaymentMethodCocoamm">trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentHandlercpp">trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentHandlerh">trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h</a></li>
<li><a href="#trunkSourceWebCoreModulespaymentrequestPaymentRequesth">trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulespaymentrequestPaymentRequestidl">trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomEventNamesh">trunk/Source/WebCore/dom/EventNames.h</a></li>
<li><a href="#trunkSourceWebCoredomEventNamesin">trunk/Source/WebCore/dom/EventNames.in</a></li>
<li><a href="#trunkSourceWebCoretestingMockPaymentCoordinatorcpp">trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingMockPaymentCoordinatorh">trunk/Source/WebCore/testing/MockPaymentCoordinator.h</a></li>
<li><a href="#trunkSourceWebCoretestingMockPaymentCoordinatoridl">trunk/Source/WebCore/testing/MockPaymentCoordinator.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestssslapplepayApplePayPaymentDetailsModifierhttpsexpectedtxt">trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssslapplepayApplePayPaymentDetailsModifierhttpshtml">trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayApplePayPaymentMethodTypeh">trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.h</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayApplePayPaymentMethodTypeidl">trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaypaymentrequestApplePayModifierh">trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaypaymentrequestApplePayModifieridl">trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestssslapplepayApplePayPaymentMethodUpdateEventhttpsexpectedtxt">trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssslapplepayApplePayPaymentMethodUpdateEventhttpshtml">trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventcpp">trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventh">trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventidl">trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/LayoutTests/ChangeLog 2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-12-13  Andy Estes  <aestes@apple.com>
+
+        [Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
+        https://bugs.webkit.org/show_bug.cgi?id=180737
+        <rdar://problem/36013152>
+
+        Reviewed by Brady Eidson.
+
+        * http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt: Added.
+        * http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html: Added.
+        * http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt: Removed.
+        * http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html: Removed.
+
</ins><span class="cx"> 2017-12-13  Matt Lewis  <jlewis3@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Added missing expectation file for fast/text/user-installed-fonts/shadow-postscript-family.html
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssslapplepayApplePayPaymentDetailsModifierhttpsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt (0 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt                              (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https-expected.txt 2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+Test PaymentDetailsModifier with Apple Pay.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing PaymentDetailsModifier after selecting a 'credit' payment method type.
+PASS internals.mockPaymentCoordinator.total.label is 'Credit total override'
+PASS internals.mockPaymentCoordinator.total.amount is '15.00'
+PASS internals.mockPaymentCoordinator.lineItems.length is 2
+PASS internals.mockPaymentCoordinator.lineItems[0].label is 'Item'
+PASS internals.mockPaymentCoordinator.lineItems[0].amount is '10.00'
+PASS internals.mockPaymentCoordinator.lineItems[1].label is 'Credit surcharge'
+PASS internals.mockPaymentCoordinator.lineItems[1].amount is '5.00'
+
+Testing PaymentDetailsModifier after selecting a 'debit' payment method type.
+PASS internals.mockPaymentCoordinator.total.label is 'Debit total override'
+PASS internals.mockPaymentCoordinator.total.amount is '13.00'
+PASS internals.mockPaymentCoordinator.lineItems.length is 2
+PASS internals.mockPaymentCoordinator.lineItems[0].label is 'Item'
+PASS internals.mockPaymentCoordinator.lineItems[0].amount is '10.00'
+PASS internals.mockPaymentCoordinator.lineItems[1].label is 'Debit surcharge'
+PASS internals.mockPaymentCoordinator.lineItems[1].amount is '3.00'
+
+Testing PaymentDetailsModifier after selecting an unmodified payment method type.
+PASS internals.mockPaymentCoordinator.total.label is 'Total'
+PASS internals.mockPaymentCoordinator.total.amount is '10.00'
+PASS internals.mockPaymentCoordinator.lineItems.length is 1
+PASS internals.mockPaymentCoordinator.lineItems[0].label is 'Item'
+PASS internals.mockPaymentCoordinator.lineItems[0].amount is '10.00'
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssslapplepayApplePayPaymentDetailsModifierhttpshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html (0 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html                              (rev 0)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html 2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -0,0 +1,184 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src="/js-test-resources/ui-helper.js"></script>
+<script src="/resources/js-test-pre.js"></script>
+<script src="/resources/payment-request.js"></script>
+</head>
+<body>
+<script>
+
+description("Test PaymentDetailsModifier with Apple Pay.");
+
+window.jsTestIsAsync = true;
+
+function validPaymentMethod() {
+    return {
+        supportedMethods: 'https://apple.com/apple-pay',
+        data: {
+            version: 2,
+            merchantIdentifier: '',
+            countryCode: 'US',
+            supportedNetworks: ['visa', 'masterCard'],
+            merchantCapabilities: ['supports3DS'],
+        },
+    }
+}
+
+function validPaymentDetails() {
+    return {
+        total: {
+            label: 'Total',
+            amount: {
+                currency: 'USD',
+                value: '10.00',
+            },
+        },
+        displayItems: [{
+            label: 'Item',
+            amount: {
+                currency: 'USD',
+                value: '10.00',
+            },
+        }],
+        modifiers: [{
+            supportedMethods: 'https://apple.com/apple-pay',
+            total: {
+                label: 'Credit total override',
+                amount: {
+                    currency: 'USD',
+                    value: '15.00',
+                },
+            },
+            additionalDisplayItems: [{
+                label: 'Credit surcharge',
+                amount: {
+                    currency: 'USD',
+                    value: '5.00',
+                },
+            }],
+            data: {
+                paymentMethodType: 'credit',
+            },
+        }, {
+            supportedMethods: 'https://apple.com/apple-pay',
+            total: {
+                label: 'Duplicate credit total override',
+                amount: {
+                    currency: 'USD',
+                    value: '17.00',
+                },
+            },
+            additionalDisplayItems: [{
+                label: 'Duplicate credit surcharge',
+                amount: {
+                    currency: 'USD',
+                    value: '7.00',
+                },
+            }],
+            data: {
+                paymentMethodType: 'credit',
+            },
+        }, {
+            supportedMethods: 'https://apple.com/apple-pay',
+            total: {
+                label: 'Debit total override',
+                amount: {
+                    currency: 'USD',
+                    value: '13.00',
+                },
+            },
+            additionalDisplayItems: [{
+                label: 'Debit surcharge',
+                amount: {
+                    currency: 'USD',
+                    value: '3.00',
+                },
+            }],
+            data: {
+                paymentMethodType: 'debit',
+            },
+        }],
+    }
+}
+
+async function runTests() {
+    await new Promise((resolve, reject) => {
+        debug("Testing PaymentDetailsModifier after selecting a 'credit' payment method type.");
+
+        var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
+
+        activateThen(() => {
+            paymentRequest.show().then((response) => {
+                shouldBe("internals.mockPaymentCoordinator.total.label", "'Credit total override'");
+                shouldBe("internals.mockPaymentCoordinator.total.amount", "'15.00'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems.length", "2");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[0].label", "'Item'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[0].amount", "'10.00'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[1].label", "'Credit surcharge'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[1].amount", "'5.00'");
+                response.complete("success");
+                resolve();
+            });
+
+            internals.mockPaymentCoordinator.changePaymentMethod({ type: 'credit' });
+            internals.mockPaymentCoordinator.acceptPayment();
+        });
+    });
+    debug("");
+    
+    await new Promise((resolve, reject) => {
+        debug("Testing PaymentDetailsModifier after selecting a 'debit' payment method type.");
+
+        var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
+
+        activateThen(() => {
+            paymentRequest.show().then((response) => {
+                shouldBe("internals.mockPaymentCoordinator.total.label", "'Debit total override'");
+                shouldBe("internals.mockPaymentCoordinator.total.amount", "'13.00'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems.length", "2");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[0].label", "'Item'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[0].amount", "'10.00'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[1].label", "'Debit surcharge'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[1].amount", "'3.00'");
+                response.complete("success");
+                resolve();
+            });
+
+            internals.mockPaymentCoordinator.changePaymentMethod({ type: 'debit' });
+            internals.mockPaymentCoordinator.acceptPayment();
+        });
+    });
+    debug("");
+
+    await new Promise((resolve, reject) => {
+        debug("Testing PaymentDetailsModifier after selecting an unmodified payment method type.");
+
+        var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
+
+        activateThen(() => {
+            paymentRequest.show().then((response) => {
+                shouldBe("internals.mockPaymentCoordinator.total.label", "'Total'");
+                shouldBe("internals.mockPaymentCoordinator.total.amount", "'10.00'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems.length", "1");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[0].label", "'Item'");
+                shouldBe("internals.mockPaymentCoordinator.lineItems[0].amount", "'10.00'");
+                response.complete("success");
+                resolve();
+            });
+
+            internals.mockPaymentCoordinator.changePaymentMethod({ type: 'prepaid' });
+            internals.mockPaymentCoordinator.acceptPayment();
+        });
+    });
+    debug("");
+
+    finishJSTest();
+}
+
+runTests();
+</script>
+<script src="/resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssslapplepayApplePayPaymentMethodUpdateEventhttpsexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt    2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https-expected.txt       2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>-Test the applepaypaymentmethodchanged event.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Testing ApplePayMerchantValidationEvent
-
-PASS event.paymentMethod.displayName is expectedPaymentMethod.displayName
-PASS event.paymentMethod.network is expectedPaymentMethod.network
-PASS event.paymentMethod.type is expectedPaymentMethod.type
-PASS event.paymentMethod.paymentPass.primaryAccountIdentifier is expectedPaymentMethod.paymentPass.primaryAccountIdentifier
-PASS event.paymentMethod.paymentPass.primaryAccountNumberSuffix is expectedPaymentMethod.paymentPass.primaryAccountNumberSuffix
-PASS event.paymentMethod.paymentPass.deviceAccountIdentifier is expectedPaymentMethod.paymentPass.deviceAccountIdentifier
-PASS event.paymentMethod.paymentPass.deviceAccountNumberSuffix is expectedPaymentMethod.paymentPass.deviceAccountNumberSuffix
-PASS event.paymentMethod.paymentPass.activationState is expectedPaymentMethod.paymentPass.activationState
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestshttptestssslapplepayApplePayPaymentMethodUpdateEventhttpshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html    2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html       2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -1,84 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<script src="/js-test-resources/ui-helper.js"></script>
-<script src="/resources/js-test-pre.js"></script>
-<script src="/resources/payment-request.js"></script>
-</head>
-<body>
-<script>
-
-description("Test the applepaypaymentmethodchanged event.");
-
-window.jsTestIsAsync = true;
-
-function validPaymentMethod() {
-    return {
-        supportedMethods: 'https://apple.com/apple-pay',
-        data: {
-            version: 2,
-            merchantIdentifier: '',
-            countryCode: 'US',
-            supportedNetworks: ['visa', 'masterCard'],
-            merchantCapabilities: ['supports3DS'],
-        },
-    }
-}
-
-function validPaymentDetails() {
-    return {
-        total: { label: 'Your label', amount: { currency: 'USD', value: '10.00' } },
-    }
-}
-
-async function go() {
-    debug("Testing ApplePayMerchantValidationEvent");
-    debug("");
-
-    expectedPaymentMethod = {
-        displayName: 'test',
-        network: 'test',
-        type: 'prepaid',
-        paymentPass: {
-            primaryAccountIdentifier: 'test',
-            primaryAccountNumberSuffix: 'test',
-            deviceAccountIdentifier: 'test',
-            deviceAccountNumberSuffix: 'test',
-            activationState: 'requiresActivation',
-        },
-    };
-
-    var paymentRequest = new PaymentRequest([validPaymentMethod()], validPaymentDetails());
-    paymentRequest.onapplepaypaymentmethodchanged = (event) => {
-        shouldBe("event.paymentMethod.displayName", "expectedPaymentMethod.displayName");
-        shouldBe("event.paymentMethod.network", "expectedPaymentMethod.network");
-        shouldBe("event.paymentMethod.type", "expectedPaymentMethod.type");
-        shouldBe("event.paymentMethod.paymentPass.primaryAccountIdentifier", "expectedPaymentMethod.paymentPass.primaryAccountIdentifier");
-        shouldBe("event.paymentMethod.paymentPass.primaryAccountNumberSuffix", "expectedPaymentMethod.paymentPass.primaryAccountNumberSuffix");
-        shouldBe("event.paymentMethod.paymentPass.deviceAccountIdentifier", "expectedPaymentMethod.paymentPass.deviceAccountIdentifier");
-        shouldBe("event.paymentMethod.paymentPass.deviceAccountNumberSuffix", "expectedPaymentMethod.paymentPass.deviceAccountNumberSuffix");
-        shouldBe("event.paymentMethod.paymentPass.activationState", "expectedPaymentMethod.paymentPass.activationState");
-
-        document.querySelector("button").remove();
-        finishJSTest();
-    };
-
-    activateThen(() => {
-        paymentRequest.show();
-        internals.mockPaymentCoordinator.changePaymentMethod(expectedPaymentMethod);
-    });
-}
-
-window.onload = function() {
-    var button = document.querySelector("button");
-    let x = button.offsetLeft + 2;
-    let y = button.offsetTop + 2;
-    UIHelper.activateAt(x, y);
-}
-
-</script>
-<button onclick='go()'>Go</button>
-<script src="/resources/js-test-post.js"></script>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/ChangeLog      2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2017-12-13  Andy Estes  <aestes@apple.com>
+
+        [Payment Request] Remove ApplePayPaymentMethodUpdateEvent and use PaymentDetailsModifiers instead
+        https://bugs.webkit.org/show_bug.cgi?id=180737
+        <rdar://problem/36013152>
+
+        Reviewed by Brady Eidson.
+
+        Instead of firing a non-standard "applepaypaymentmethodupdate" event when the payment method
+        changes, use the PaymentDetailsModifier mechanism to allow the merchant to specify override
+        totals and additional display items per payment method type.
+
+        Test: http/tests/ssl/applepay/ApplePayPaymentDetailsModifier.https.html
+
+        * DerivedSources.make:
+        * Modules/applepay/ApplePayLineItem.idl:
+        * Modules/applepay/ApplePayPaymentMethod.h:
+        * Modules/applepay/ApplePayPaymentMethod.idl:
+        * Modules/applepay/ApplePayPaymentMethodType.h: Added.
+        * Modules/applepay/ApplePayPaymentMethodType.idl: Added.
+        * Modules/applepay/cocoa/PaymentMethodCocoa.mm:
+        * Modules/applepay/paymentrequest/ApplePayModifier.h: Added.
+        * Modules/applepay/paymentrequest/ApplePayModifier.idl: Added.
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+        (WebCore::ApplePayPaymentHandler::show):
+        (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems):
+        (WebCore::ApplePayPaymentHandler::detailsUpdated):
+        (WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
+        (WebCore::ApplePayPaymentHandler::shippingOptionUpdated):
+        (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
+        (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
+        * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Removed.
+        * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Removed.
+        * Modules/paymentrequest/PaymentRequest.h:
+        * Modules/paymentrequest/PaymentRequest.idl:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/EventNames.h:
+        * dom/EventNames.in:
+        * testing/MockPaymentCoordinator.cpp:
+        (WebCore::convert):
+        (WebCore::MockPaymentCoordinator::updateTotalAndLineItems):
+        (WebCore::MockPaymentCoordinator::completeShippingMethodSelection):
+        (WebCore::MockPaymentCoordinator::completeShippingContactSelection):
+        (WebCore::MockPaymentCoordinator::completePaymentMethodSelection):
+        * testing/MockPaymentCoordinator.h:
+        * testing/MockPaymentCoordinator.idl:
+
</ins><span class="cx"> 2017-12-12  Zalan Bujtas  <zalan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         is<HTMLTextFormControlElement> reports the input type.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make 2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/DerivedSources.make    2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayPaymentContact.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayPaymentMethod.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl \
</span><ins>+    $(WebCore)/Modules/applepay/ApplePayPaymentMethodType.idl \
</ins><span class="cx">   $(WebCore)/Modules/applepay/ApplePayPaymentMethodUpdate.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayPaymentPass.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayPaymentRequest.idl \
</span><span class="lines">@@ -109,7 +110,7 @@
</span><span class="cx">  $(WebCore)/Modules/applepay/ApplePayShippingMethodUpdate.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/ApplePayValidateMerchantEvent.idl \
</span><span class="cx">     $(WebCore)/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl \
</span><del>-    $(WebCore)/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl \
</del><ins>+    $(WebCore)/Modules/applepay/paymentrequest/ApplePayModifier.idl \
</ins><span class="cx">     $(WebCore)/Modules/applepay/paymentrequest/ApplePayRequest.idl \
</span><span class="cx">     $(WebCore)/Modules/beacon/NavigatorBeacon.idl \
</span><span class="cx">     $(WebCore)/Modules/cache/DOMWindowCaches.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayApplePayLineItemidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/ApplePayLineItem.idl (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/ApplePayLineItem.idl       2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayLineItem.idl  2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=APPLE_PAY,
</span><ins>+    ExportMacro=WEBCORE_EXPORT,
+    JSGenerateToJSObject,
</ins><span class="cx"> ] dictionary ApplePayLineItem {
</span><span class="cx">     ApplePayLineItemType type = "final";
</span><span class="cx">     DOMString label;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayApplePayPaymentMethodh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h    2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.h       2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-enum class ApplePayPaymentMethodType { Debit, Credit, Prepaid, Store };
</del><ins>+enum class ApplePayPaymentMethodType;
</ins><span class="cx"> 
</span><span class="cx"> struct ApplePayPaymentMethod {    
</span><span class="cx">     using Type = ApplePayPaymentMethodType;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayApplePayPaymentMethodidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl  2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethod.idl     2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -25,15 +25,6 @@
</span><span class="cx"> 
</span><span class="cx"> [
</span><span class="cx">     Conditional=APPLE_PAY,
</span><del>-] enum ApplePayPaymentMethodType { 
-    "debit", 
-    "credit",
-    "prepaid",
-    "store" 
-};
-
-[
-    Conditional=APPLE_PAY,
</del><span class="cx">     ExportMacro=WEBCORE_EXPORT,
</span><span class="cx">     JSGenerateToJSObject
</span><span class="cx"> ] dictionary ApplePayPaymentMethod {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayApplePayPaymentMethodTypehfromrev225848trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.h (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.h   2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLE_PAY)
+
+namespace WebCore {
+
+enum class ApplePayPaymentMethodType {
+    Debit,
+    Credit,
+    Prepaid,
+    Store,
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayApplePayPaymentMethodTypeidlfromrev225848trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.idl (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.idl                              (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentMethodType.idl 2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=APPLE_PAY,
+] enum ApplePayPaymentMethodType {
+    "debit",
+    "credit",
+    "prepaid",
+    "store"
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaycocoaPaymentMethodCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm        2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMethodCocoa.mm   2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx"> 
</span><span class="cx"> #import "ApplePayPaymentMethod.h"
</span><ins>+#import "ApplePayPaymentMethodType.h"
</ins><span class="cx"> #import <pal/spi/cocoa/PassKitSPI.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaypaymentrequestApplePayModifierhfromrev225848trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h                          (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.h     2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
+
+#include "ApplePayPaymentMethodType.h"
+
+namespace WebCore {
+
+struct ApplePayModifier {
+    ApplePayPaymentMethodType paymentMethodType;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaypaymentrequestApplePayModifieridlfromrev225848trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl (from rev 225848, trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl) (0 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl                                (rev 0)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayModifier.idl   2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=APPLE_PAY&PAYMENT_REQUEST,
+] dictionary ApplePayModifier {
+    required ApplePayPaymentMethodType paymentMethodType;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp  2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp     2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> #include "ApplePayContactField.h"
</span><span class="cx"> #include "ApplePayMerchantCapability.h"
</span><span class="cx"> #include "ApplePayMerchantValidationEvent.h"
</span><ins>+#include "ApplePayModifier.h"
</ins><span class="cx"> #include "ApplePayPayment.h"
</span><del>-#include "ApplePayPaymentMethodUpdateEvent.h"
</del><span class="cx"> #include "ApplePaySessionPaymentRequest.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="lines">@@ -190,21 +190,8 @@
</span><span class="cx">     auto convertedLineItems = convertAndValidate(m_paymentRequest->paymentDetails().displayItems, expectedCurrency);
</span><span class="cx">     if (convertedLineItems.hasException())
</span><span class="cx">         return convertedLineItems.releaseException();
</span><ins>+    request.setLineItems(convertedLineItems.releaseReturnValue());
</ins><span class="cx"> 
</span><del>-    auto lineItems = convertedLineItems.releaseReturnValue();
-    for (auto& modifier : m_paymentRequest->paymentDetails().modifiers) {
-        auto convertedIdentifier = convertAndValidatePaymentMethodIdentifier(modifier.supportedMethods);
-        if (!convertedIdentifier || !handlesIdentifier(*convertedIdentifier))
-            continue;
-
-        auto additionalDisplayItems = convertAndValidate(modifier.additionalDisplayItems, expectedCurrency);
-        if (additionalDisplayItems.hasException())
-            return additionalDisplayItems.releaseException();
-
-        lineItems.appendVector(additionalDisplayItems.releaseReturnValue());
-    }
-    request.setLineItems(lineItems);
-
</del><span class="cx">     request.setRequiredShippingContactFields(convert(m_paymentRequest->paymentOptions()));
</span><span class="cx">     if (m_paymentRequest->paymentOptions().requestShipping)
</span><span class="cx">         request.setShippingType(convert(m_paymentRequest->paymentOptions().shippingType));
</span><span class="lines">@@ -255,18 +242,67 @@
</span><span class="cx">     paymentCoordinator().canMakePaymentsWithActiveCard(m_applePayRequest->merchantIdentifier, document().domain(), WTFMove(completionHandler));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static ExceptionOr<ApplePaySessionPaymentRequest::TotalAndLineItems> convertAndValidate(const PaymentDetailsInit& details)
</del><ins>+ExceptionOr<ApplePaySessionPaymentRequest::TotalAndLineItems> ApplePayPaymentHandler::computeTotalAndLineItems()
</ins><span class="cx"> {
</span><ins>+    auto& details = m_paymentRequest->paymentDetails();
</ins><span class="cx">     String currency = details.total.amount.currency;
</span><del>-    auto total = convertAndValidate(details.total, currency);
-    if (total.hasException())
-        return total.releaseException();
</del><span class="cx"> 
</span><del>-    auto lineItems = convertAndValidate(details.displayItems, currency);
-    if (lineItems.hasException())
-        return lineItems.releaseException();
</del><ins>+    auto convertedTotal = convertAndValidate(details.total, currency);
+    if (convertedTotal.hasException())
+        return convertedTotal.releaseException();
+    auto total = convertedTotal.releaseReturnValue();
</ins><span class="cx"> 
</span><del>-    return ApplePaySessionPaymentRequest::TotalAndLineItems { total.releaseReturnValue(), lineItems.releaseReturnValue() };
</del><ins>+    auto convertedLineItems = convertAndValidate(details.displayItems, currency);
+    if (convertedLineItems.hasException())
+        return convertedLineItems.releaseException();
+    auto lineItems = convertedLineItems.releaseReturnValue();
+
+    if (!m_selectedPaymentMethodType)
+        return ApplePaySessionPaymentRequest::TotalAndLineItems { WTFMove(total), WTFMove(lineItems) };
+
+    auto& modifiers = details.modifiers;
+    auto& serializedModifierData = m_paymentRequest->serializedModifierData();
+    ASSERT(modifiers.size() == serializedModifierData.size());
+    for (size_t i = 0; i < modifiers.size(); ++i) {
+        auto convertedIdentifier = convertAndValidatePaymentMethodIdentifier(modifiers[i].supportedMethods);
+        if (!convertedIdentifier || !handlesIdentifier(*convertedIdentifier))
+            continue;
+
+        if (serializedModifierData[i].isEmpty())
+            continue;
+
+        auto& execState = *document().execState();
+        auto scope = DECLARE_THROW_SCOPE(execState.vm());
+        JSC::JSValue data;
+        {
+            auto lock = JSC::JSLockHolder { &execState };
+            data = JSONParse(&execState, serializedModifierData[i]);
+            if (scope.exception())
+                return Exception { ExistingExceptionError };
+        }
+
+        auto applePayModifier = convertDictionary<ApplePayModifier>(execState, WTFMove(data));
+        if (scope.exception())
+            return Exception { ExistingExceptionError };
+
+        if (applePayModifier.paymentMethodType != *m_selectedPaymentMethodType)
+            continue;
+
+        if (modifiers[i].total) {
+            auto totalOverride = convertAndValidate(*modifiers[i].total, currency);
+            if (totalOverride.hasException())
+                return totalOverride.releaseException();
+            total = totalOverride.releaseReturnValue();
+        }
+
+        auto additionalDisplayItems = convertAndValidate(modifiers[i].additionalDisplayItems, currency);
+        if (additionalDisplayItems.hasException())
+            return additionalDisplayItems.releaseException();
+        lineItems.appendVector(additionalDisplayItems.releaseReturnValue());
+        break;
+    }
+
+    return ApplePaySessionPaymentRequest::TotalAndLineItems { WTFMove(total), WTFMove(lineItems) };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ExceptionOr<void> ApplePayPaymentHandler::detailsUpdated(const AtomicString& eventType, const String& error)
</span><span class="lines">@@ -277,9 +313,6 @@
</span><span class="cx">     if (eventType == eventNames().shippingoptionchangeEvent)
</span><span class="cx">         return shippingOptionUpdated();
</span><span class="cx"> 
</span><del>-    if (eventType == eventNames().applepaypaymentmethodchangedEvent)
-        return paymentMethodUpdated();
-
</del><span class="cx">     ASSERT_NOT_REACHED();
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -295,7 +328,7 @@
</span><span class="cx">         update.errors.append(WTFMove(paymentError));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto newTotalAndLineItems = convertAndValidate(m_paymentRequest->paymentDetails());
</del><ins>+    auto newTotalAndLineItems = computeTotalAndLineItems();
</ins><span class="cx">     if (newTotalAndLineItems.hasException())
</span><span class="cx">         return newTotalAndLineItems.releaseException();
</span><span class="cx">     update.newTotalAndLineItems = newTotalAndLineItems.releaseReturnValue();
</span><span class="lines">@@ -308,7 +341,7 @@
</span><span class="cx"> {
</span><span class="cx">     ShippingMethodUpdate update;
</span><span class="cx"> 
</span><del>-    auto newTotalAndLineItems = convertAndValidate(m_paymentRequest->paymentDetails());
</del><ins>+    auto newTotalAndLineItems = computeTotalAndLineItems();
</ins><span class="cx">     if (newTotalAndLineItems.hasException())
</span><span class="cx">         return newTotalAndLineItems.releaseException();
</span><span class="cx">     update.newTotalAndLineItems = newTotalAndLineItems.releaseReturnValue();
</span><span class="lines">@@ -321,7 +354,7 @@
</span><span class="cx"> {
</span><span class="cx">     PaymentMethodUpdate update;
</span><span class="cx"> 
</span><del>-    auto newTotalAndLineItems = convertAndValidate(m_paymentRequest->paymentDetails());
</del><ins>+    auto newTotalAndLineItems = computeTotalAndLineItems();
</ins><span class="cx">     if (newTotalAndLineItems.hasException())
</span><span class="cx">         return newTotalAndLineItems.releaseException();
</span><span class="cx">     update.newTotalAndLineItems = newTotalAndLineItems.releaseReturnValue();
</span><span class="lines">@@ -385,8 +418,8 @@
</span><span class="cx"> 
</span><span class="cx"> void ApplePayPaymentHandler::didSelectPaymentMethod(const PaymentMethod& paymentMethod)
</span><span class="cx"> {
</span><del>-    auto event = ApplePayPaymentMethodUpdateEvent::create(eventNames().applepaypaymentmethodchangedEvent, paymentMethod.toApplePayPaymentMethod(), m_paymentRequest.get());
-    m_paymentRequest->dispatchEvent(event.get());
</del><ins>+    m_selectedPaymentMethodType = paymentMethod.toApplePayPaymentMethod().type;
+    paymentMethodUpdated();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ApplePayPaymentHandler::didCancelPaymentSession()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h    2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h       2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
</span><span class="cx"> 
</span><ins>+#include "ApplePayPaymentMethodType.h"
</ins><span class="cx"> #include "ApplePayRequest.h"
</span><span class="cx"> #include "ContextDestructionObserver.h"
</span><span class="cx"> #include "PaymentHandler.h"
</span><span class="lines">@@ -51,6 +52,8 @@
</span><span class="cx">     Document& document();
</span><span class="cx">     PaymentCoordinator& paymentCoordinator();
</span><span class="cx"> 
</span><ins>+    ExceptionOr<ApplePaySessionPaymentRequest::TotalAndLineItems> computeTotalAndLineItems();
+
</ins><span class="cx">     ExceptionOr<void> shippingAddressUpdated(const String& error);
</span><span class="cx">     ExceptionOr<void> shippingOptionUpdated();
</span><span class="cx">     ExceptionOr<void> paymentMethodUpdated();
</span><span class="lines">@@ -74,6 +77,7 @@
</span><span class="cx">     PaymentRequest::MethodIdentifier m_identifier;
</span><span class="cx">     Ref<PaymentRequest> m_paymentRequest;
</span><span class="cx">     std::optional<ApplePayRequest> m_applePayRequest;
</span><ins>+    std::optional<ApplePayPaymentMethodType> m_selectedPaymentMethodType;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp        2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp   2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -1,48 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ApplePayPaymentMethodUpdateEvent.h"
-
-#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
-
-#include "PaymentRequest.h"
-
-namespace WebCore {
-
-ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent(const AtomicString& type, const ApplePayPaymentMethod& paymentMethod, PaymentRequest& paymentRequest)
-    : PaymentRequestUpdateEvent { type, paymentRequest }
-    , m_paymentMethod { paymentMethod }
-{
-}
-
-EventInterface ApplePayPaymentMethodUpdateEvent::eventInterface() const
-{
-    return ApplePayPaymentMethodUpdateEventInterfaceType;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h  2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h     2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -1,55 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
-
-#include "ApplePayPaymentMethod.h"
-#include "PaymentRequestUpdateEvent.h"
-
-namespace WebCore {
-
-class ApplePayPaymentMethodUpdateEvent final : public PaymentRequestUpdateEvent {
-public:
-    template <typename... Args> static Ref<ApplePayPaymentMethodUpdateEvent> create(Args&&... args)
-    {
-        return adoptRef(*new ApplePayPaymentMethodUpdateEvent(std::forward<Args>(args)...));
-    }
-
-    const ApplePayPaymentMethod& paymentMethod() const { return m_paymentMethod; }
-
-private:
-    ApplePayPaymentMethodUpdateEvent(const AtomicString& type, const ApplePayPaymentMethod&, PaymentRequest&);
-
-    // Event
-    EventInterface eventInterface() const final;
-
-    const ApplePayPaymentMethod m_paymentMethod;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(APPLE_PAY) && ENABLE(PAYMENT_REQUEST)
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepaypaymentrequestApplePayPaymentMethodUpdateEventidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl        2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl   2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=APPLE_PAY&PAYMENT_REQUEST,
-    NoInterfaceObject,
-] interface ApplePayPaymentMethodUpdateEvent : PaymentRequestUpdateEvent {
-    [CachedAttribute] readonly attribute ApplePayPaymentMethod paymentMethod;
-};
</del></span></pre></div>
<a id="trunkSourceWebCoreModulespaymentrequestPaymentRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h     2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.h        2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx"> 
</span><span class="cx">     const PaymentOptions& paymentOptions() const { return m_options; }
</span><span class="cx">     const PaymentDetailsInit& paymentDetails() const { return m_details; }
</span><ins>+    const Vector<String>& serializedModifierData() const { return m_serializedModifierData; }
</ins><span class="cx"> 
</span><span class="cx">     void shippingAddressChanged(Ref<PaymentAddress>&&);
</span><span class="cx">     void shippingOptionChanged(const String& shippingOption);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespaymentrequestPaymentRequestidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl   2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/Modules/paymentrequest/PaymentRequest.idl      2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -45,5 +45,4 @@
</span><span class="cx">     attribute EventHandler onshippingoptionchange;
</span><span class="cx"> 
</span><span class="cx">     [Conditional=APPLE_PAY] attribute EventHandler onapplepayvalidatemerchant;
</span><del>-    [Conditional=APPLE_PAY] attribute EventHandler onapplepaypaymentmethodchanged;
</del><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj   2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj      2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -2730,10 +2730,6 @@
</span><span class="cx">          A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1BF6B811AA96C7D00AF4A8A /* MockContentFilter.h */; };
</span><span class="cx">          A1C1507A1E3F2B3E0032C98C /* PreviewConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = A1C150781E3F2B3E0032C98C /* PreviewConverter.h */; };
</span><span class="cx">          A1C2C5761FA2851600BA46FA /* PaymentSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1C2C5751FA2851600BA46FA /* PaymentSession.cpp */; };
</span><del>-               A1CBEF531F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CBEF501F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h */; };
-               A1CBEF541F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1CBEF511F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp */; };
-               A1CBEF611F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1CBEF5F1F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp */; };
-               A1CBEF621F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CBEF601F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.h */; };
</del><span class="cx">           A1CBEF641F9F11290028DE7C /* MockPaymentMethod.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CBEF631F9F11290028DE7C /* MockPaymentMethod.h */; };
</span><span class="cx">          A1CC56671F46147A00A4555B /* JSPaymentAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CC56651F46146800A4555B /* JSPaymentAddress.h */; };
</span><span class="cx">          A1CC56691F46148000A4555B /* JSPaymentComplete.h in Headers */ = {isa = PBXBuildFile; fileRef = A1CC564E1F46145200A4555B /* JSPaymentComplete.h */; };
</span><span class="lines">@@ -2766,6 +2762,12 @@
</span><span class="cx">          A1F600561F4765050077E83F /* JSPaymentRequestUpdateEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F600501F4764FE0077E83F /* JSPaymentRequestUpdateEventInit.h */; };
</span><span class="cx">          A1F600581F4765050077E83F /* JSPaymentRequestUpdateEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F600521F4765010077E83F /* JSPaymentRequestUpdateEvent.h */; };
</span><span class="cx">          A1F6005A1F4765050077E83F /* JSPaymentDetailsUpdate.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F600541F4765040077E83F /* JSPaymentDetailsUpdate.h */; };
</span><ins>+               A1F6CFFF1FE096210018078C /* ApplePayModifier.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6CFFC1FE096210018078C /* ApplePayModifier.h */; };
+               A1F6D0061FE096F60018078C /* ApplePayPaymentMethodType.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6D0031FE096F60018078C /* ApplePayPaymentMethodType.h */; };
+               A1F6D00F1FE099940018078C /* JSApplePayPaymentMethodType.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6D00E1FE099640018078C /* JSApplePayPaymentMethodType.h */; };
+               A1F6D0101FE099960018078C /* JSApplePayPaymentMethodType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1F6D00D1FE099640018078C /* JSApplePayPaymentMethodType.cpp */; };
+               A1F6D0111FE099B20018078C /* JSApplePayModifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1F6D00A1FE099210018078C /* JSApplePayModifier.cpp */; };
+               A1F6D0121FE099B40018078C /* JSApplePayModifier.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F6D00C1FE099220018078C /* JSApplePayModifier.h */; };
</ins><span class="cx">           A1F76B131F44C2450014C318 /* PaymentRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F76B101F44C2450014C318 /* PaymentRequest.h */; };
</span><span class="cx">          A1F76B191F44C3900014C318 /* PaymentMethodData.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F76B161F44C3900014C318 /* PaymentMethodData.h */; };
</span><span class="cx">          A1F76B1F1F44C3FE0014C318 /* PaymentDetailsBase.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F76B1C1F44C3FE0014C318 /* PaymentDetailsBase.h */; };
</span><span class="lines">@@ -10554,11 +10556,6 @@
</span><span class="cx">          A1C150781E3F2B3E0032C98C /* PreviewConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreviewConverter.h; sourceTree = "<group>"; };
</span><span class="cx">          A1C2C5751FA2851600BA46FA /* PaymentSession.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentSession.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A1C7FAA1133A5D3500D6732D /* JSXPathResultCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXPathResultCustom.cpp; sourceTree = "<group>"; };
</span><del>-               A1CBEF501F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePayPaymentMethodUpdateEvent.h; sourceTree = "<group>"; };
-               A1CBEF511F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ApplePayPaymentMethodUpdateEvent.cpp; sourceTree = "<group>"; };
-               A1CBEF521F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayPaymentMethodUpdateEvent.idl; sourceTree = "<group>"; };
-               A1CBEF5F1F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayPaymentMethodUpdateEvent.cpp; sourceTree = "<group>"; };
-               A1CBEF601F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayPaymentMethodUpdateEvent.h; sourceTree = "<group>"; };
</del><span class="cx">           A1CBEF631F9F11290028DE7C /* MockPaymentMethod.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MockPaymentMethod.h; sourceTree = "<group>"; };
</span><span class="cx">          A1CC11621E493D0100EFA69C /* FileSystemMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FileSystemMac.mm; sourceTree = "<group>"; };
</span><span class="cx">          A1CC564C1F46145000A4555B /* JSPaymentMethodData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentMethodData.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -10632,6 +10629,14 @@
</span><span class="cx">          A1F600521F4765010077E83F /* JSPaymentRequestUpdateEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentRequestUpdateEvent.h; sourceTree = "<group>"; };
</span><span class="cx">          A1F600531F4765020077E83F /* JSPaymentRequestUpdateEventInit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPaymentRequestUpdateEventInit.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A1F600541F4765040077E83F /* JSPaymentDetailsUpdate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPaymentDetailsUpdate.h; sourceTree = "<group>"; };
</span><ins>+               A1F6CFFC1FE096210018078C /* ApplePayModifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePayModifier.h; sourceTree = "<group>"; };
+               A1F6CFFE1FE096210018078C /* ApplePayModifier.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayModifier.idl; sourceTree = "<group>"; };
+               A1F6D0031FE096F60018078C /* ApplePayPaymentMethodType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ApplePayPaymentMethodType.h; sourceTree = "<group>"; };
+               A1F6D0051FE096F60018078C /* ApplePayPaymentMethodType.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = ApplePayPaymentMethodType.idl; sourceTree = "<group>"; };
+               A1F6D00A1FE099210018078C /* JSApplePayModifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayModifier.cpp; sourceTree = "<group>"; };
+               A1F6D00C1FE099220018078C /* JSApplePayModifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayModifier.h; sourceTree = "<group>"; };
+               A1F6D00D1FE099640018078C /* JSApplePayPaymentMethodType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSApplePayPaymentMethodType.cpp; sourceTree = "<group>"; };
+               A1F6D00E1FE099640018078C /* JSApplePayPaymentMethodType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSApplePayPaymentMethodType.h; sourceTree = "<group>"; };
</ins><span class="cx">           A1F76B101F44C2450014C318 /* PaymentRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentRequest.h; sourceTree = "<group>"; };
</span><span class="cx">          A1F76B111F44C2450014C318 /* PaymentRequest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentRequest.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A1F76B121F44C2450014C318 /* PaymentRequest.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentRequest.idl; sourceTree = "<group>"; };
</span><span class="lines">@@ -15353,6 +15358,8 @@
</span><span class="cx">                          1A8A64401D19FCFB00D0E00F /* ApplePayPaymentMethodSelectedEvent.cpp */,
</span><span class="cx">                          1A8A64421D19FCFB00D0E00F /* ApplePayPaymentMethodSelectedEvent.h */,
</span><span class="cx">                          1A8A64431D19FCFB00D0E00F /* ApplePayPaymentMethodSelectedEvent.idl */,
</span><ins>+                               A1F6D0031FE096F60018078C /* ApplePayPaymentMethodType.h */,
+                               A1F6D0051FE096F60018078C /* ApplePayPaymentMethodType.idl */,
</ins><span class="cx">                           1ADFDFDA1E71D8DF008F5D34 /* ApplePayPaymentMethodUpdate.h */,
</span><span class="cx">                          1ADFDFDB1E71D8DF008F5D34 /* ApplePayPaymentMethodUpdate.idl */,
</span><span class="cx">                          7C6522F21E00A51700677F22 /* ApplePayPaymentPass.h */,
</span><span class="lines">@@ -15509,6 +15516,8 @@
</span><span class="cx">                          A1DF5A8A1F7EC0000058A477 /* JSApplePayMerchantCapability.h */,
</span><span class="cx">                          A1F9296D1F8D9F5A00523AF3 /* JSApplePayMerchantValidationEvent.cpp */,
</span><span class="cx">                          A1F9296E1F8D9F5B00523AF3 /* JSApplePayMerchantValidationEvent.h */,
</span><ins>+                               A1F6D00A1FE099210018078C /* JSApplePayModifier.cpp */,
+                               A1F6D00C1FE099220018078C /* JSApplePayModifier.h */,
</ins><span class="cx">                           7C65231D1E018B5A00677F22 /* JSApplePayPayment.cpp */,
</span><span class="cx">                          7C65230A1E00DBB400677F22 /* JSApplePayPayment.h */,
</span><span class="cx">                          1ADFDFE31E71DCA0008F5D34 /* JSApplePayPaymentAuthorizationResult.cpp */,
</span><span class="lines">@@ -15521,10 +15530,10 @@
</span><span class="cx">                          7C65230E1E00DBB400677F22 /* JSApplePayPaymentMethod.h */,
</span><span class="cx">                          1AE96A7C1D1A0A8000B86768 /* JSApplePayPaymentMethodSelectedEvent.cpp */,
</span><span class="cx">                          1AE96A7D1D1A0A8000B86768 /* JSApplePayPaymentMethodSelectedEvent.h */,
</span><ins>+                               A1F6D00D1FE099640018078C /* JSApplePayPaymentMethodType.cpp */,
+                               A1F6D00E1FE099640018078C /* JSApplePayPaymentMethodType.h */,
</ins><span class="cx">                           1ADFDFE51E71DCA0008F5D34 /* JSApplePayPaymentMethodUpdate.cpp */,
</span><span class="cx">                          1ADFDFE61E71DCA0008F5D34 /* JSApplePayPaymentMethodUpdate.h */,
</span><del>-                               A1CBEF5F1F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp */,
-                               A1CBEF601F9F09020028DE7C /* JSApplePayPaymentMethodUpdateEvent.h */,
</del><span class="cx">                           7C65230F1E00DBB400677F22 /* JSApplePayPaymentPass.cpp */,
</span><span class="cx">                          7C6523101E00DBB400677F22 /* JSApplePayPaymentPass.h */,
</span><span class="cx">                          7C6579EB1E00856600E3A27A /* JSApplePayPaymentRequest.cpp */,
</span><span class="lines">@@ -20459,11 +20468,10 @@
</span><span class="cx">                          A1F929671F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.cpp */,
</span><span class="cx">                          A1F929661F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.h */,
</span><span class="cx">                          A1F929681F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.idl */,
</span><ins>+                               A1F6CFFC1FE096210018078C /* ApplePayModifier.h */,
+                               A1F6CFFE1FE096210018078C /* ApplePayModifier.idl */,
</ins><span class="cx">                           A1DF5AA11F7EE1130058A477 /* ApplePayPaymentHandler.cpp */,
</span><span class="cx">                          A1DF5AA01F7EE1130058A477 /* ApplePayPaymentHandler.h */,
</span><del>-                               A1CBEF511F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp */,
-                               A1CBEF501F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h */,
-                               A1CBEF521F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.idl */,
</del><span class="cx">                           A1DF5A7C1F7EBD0B0058A477 /* ApplePayRequest.h */,
</span><span class="cx">                          A1DF5A7E1F7EBD0B0058A477 /* ApplePayRequest.idl */,
</span><span class="cx">                  );
</span><span class="lines">@@ -26078,6 +26086,7 @@
</span><span class="cx">                          7C6579E31E00827000E3A27A /* ApplePayLineItem.h in Headers */,
</span><span class="cx">                          A1DF5A861F7EBDF20058A477 /* ApplePayMerchantCapability.h in Headers */,
</span><span class="cx">                          A1F929691F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.h in Headers */,
</span><ins>+                               A1F6CFFF1FE096210018078C /* ApplePayModifier.h in Headers */,
</ins><span class="cx">                           7C6523011E00D03400677F22 /* ApplePayPayment.h in Headers */,
</span><span class="cx">                          1A8A64521D19FCFB00D0E00F /* ApplePayPaymentAuthorizedEvent.h in Headers */,
</span><span class="cx">                          7C6522FB1E00C90900677F22 /* ApplePayPaymentContact.h in Headers */,
</span><span class="lines">@@ -26084,7 +26093,7 @@
</span><span class="cx">                          A1DF5AA21F7EE1130058A477 /* ApplePayPaymentHandler.h in Headers */,
</span><span class="cx">                          7C6522EF1E00A4C700677F22 /* ApplePayPaymentMethod.h in Headers */,
</span><span class="cx">                          1A8A64561D19FCFC00D0E00F /* ApplePayPaymentMethodSelectedEvent.h in Headers */,
</span><del>-                               A1CBEF531F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.h in Headers */,
</del><ins>+                                A1F6D0061FE096F60018078C /* ApplePayPaymentMethodType.h in Headers */,
</ins><span class="cx">                           7C6522F51E00A51700677F22 /* ApplePayPaymentPass.h in Headers */,
</span><span class="cx">                          7C6579E01E0079F900E3A27A /* ApplePayPaymentRequest.h in Headers */,
</span><span class="cx">                          A1DF5A7F1F7EBD0B0058A477 /* ApplePayRequest.h in Headers */,
</span><span class="lines">@@ -27357,12 +27366,13 @@
</span><span class="cx">                          7C6579F01E00856600E3A27A /* JSApplePayLineItem.h in Headers */,
</span><span class="cx">                          A1DF5A8E1F7EC0020058A477 /* JSApplePayMerchantCapability.h in Headers */,
</span><span class="cx">                          A1F929701F8D9F5B00523AF3 /* JSApplePayMerchantValidationEvent.h in Headers */,
</span><ins>+                               A1F6D0121FE099B40018078C /* JSApplePayModifier.h in Headers */,
</ins><span class="cx">                           7C6523141E00DBB400677F22 /* JSApplePayPayment.h in Headers */,
</span><span class="cx">                          1AE96A8B1D1A0DDD00B86768 /* JSApplePayPaymentAuthorizedEvent.h in Headers */,
</span><span class="cx">                          7C6523161E00DBB500677F22 /* JSApplePayPaymentContact.h in Headers */,
</span><span class="cx">                          7C6523181E00DBB500677F22 /* JSApplePayPaymentMethod.h in Headers */,
</span><span class="cx">                          1AE96A8D1D1A0DDD00B86768 /* JSApplePayPaymentMethodSelectedEvent.h in Headers */,
</span><del>-                               A1CBEF621F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.h in Headers */,
</del><ins>+                                A1F6D00F1FE099940018078C /* JSApplePayPaymentMethodType.h in Headers */,
</ins><span class="cx">                           7C65231A1E00DBB500677F22 /* JSApplePayPaymentPass.h in Headers */,
</span><span class="cx">                          7C6579F21E00856600E3A27A /* JSApplePayPaymentRequest.h in Headers */,
</span><span class="cx">                          A1DF5A8F1F7EC0020058A477 /* JSApplePayRequest.h in Headers */,
</span><span class="lines">@@ -30289,7 +30299,6 @@
</span><span class="cx">                  files = (
</span><span class="cx">                          A9787CB41F5F5C6600C551C6 /* AccessibilityMediaObject.cpp in Sources */,
</span><span class="cx">                          A1F9296A1F8D9CDB00523AF3 /* ApplePayMerchantValidationEvent.cpp in Sources */,
</span><del>-                               A1CBEF541F9EEE750028DE7C /* ApplePayPaymentMethodUpdateEvent.cpp in Sources */,
</del><span class="cx">                           CD0EEE0E14743F39003EAFA2 /* AudioDestinationIOS.cpp in Sources */,
</span><span class="cx">                          CD5596911475B678001D0BD0 /* AudioFileReaderIOS.cpp in Sources */,
</span><span class="cx">                          CDA79827170A279100D45C55 /* AudioSessionIOS.mm in Sources */,
</span><span class="lines">@@ -30354,7 +30363,8 @@
</span><span class="cx">                          CD063F821E23FA8900812BE3 /* InitDataRegistry.cpp in Sources */,
</span><span class="cx">                          6A72798C1F16C29C003F39B8 /* InspectorShaderProgram.cpp in Sources */,
</span><span class="cx">                          A1F9296F1F8D9F5B00523AF3 /* JSApplePayMerchantValidationEvent.cpp in Sources */,
</span><del>-                               A1CBEF611F9F09040028DE7C /* JSApplePayPaymentMethodUpdateEvent.cpp in Sources */,
</del><ins>+                                A1F6D0111FE099B20018078C /* JSApplePayModifier.cpp in Sources */,
+                               A1F6D0101FE099960018078C /* JSApplePayPaymentMethodType.cpp in Sources */,
</ins><span class="cx">                           538EC93E1F99BF5A004D22A8 /* JSQuickTimePluginReplacement.cpp in Sources */,
</span><span class="cx">                          935C477009AC4D7300A6AAB4 /* KeyEventMac.mm in Sources */,
</span><span class="cx">                          CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventNames.h (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventNames.h    2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/dom/EventNames.h       2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -53,7 +53,6 @@
</span><span class="cx">     macro(animationend) \
</span><span class="cx">     macro(animationiteration) \
</span><span class="cx">     macro(animationstart) \
</span><del>-    macro(applepaypaymentmethodchanged) \
</del><span class="cx">     macro(applepayvalidatemerchant) \
</span><span class="cx">     macro(audioend) \
</span><span class="cx">     macro(audioprocess) \
</span></span></pre></div>
<a id="trunkSourceWebCoredomEventNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/EventNames.in (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/EventNames.in   2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/dom/EventNames.in      2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx"> ApplePayMerchantValidationEvent conditional=APPLE_PAY
</span><span class="cx"> ApplePayPaymentAuthorizedEvent conditional=APPLE_PAY
</span><span class="cx"> ApplePayPaymentMethodSelectedEvent conditional=APPLE_PAY
</span><del>-ApplePayPaymentMethodUpdateEvent conditional=APPLE_PAY
</del><span class="cx"> ApplePayShippingContactSelectedEvent conditional=APPLE_PAY
</span><span class="cx"> ApplePayShippingMethodSelectedEvent conditional=APPLE_PAY
</span><span class="cx"> ApplePayValidateMerchantEvent conditional=APPLE_PAY
</span></span></pre></div>
<a id="trunkSourceWebCoretestingMockPaymentCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp  2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.cpp     2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -105,6 +105,41 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static ApplePayLineItem convert(const ApplePaySessionPaymentRequest::LineItem& lineItem)
+{
+    ApplePayLineItem result;
+    result.type = lineItem.type;
+    result.label = lineItem.label;
+    result.amount = lineItem.amount;
+    return result;
+}
+
+void MockPaymentCoordinator::updateTotalAndLineItems(const ApplePaySessionPaymentRequest::TotalAndLineItems& totalAndLineItems)
+{
+    m_total = convert(totalAndLineItems.total);
+    m_lineItems.clear();
+    for (auto& lineItem : totalAndLineItems.lineItems)
+        m_lineItems.append(convert(lineItem));
+}
+
+void MockPaymentCoordinator::completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&& shippingMethodUpdate)
+{
+    if (shippingMethodUpdate)
+        updateTotalAndLineItems(shippingMethodUpdate->newTotalAndLineItems);
+}
+
+void MockPaymentCoordinator::completeShippingContactSelection(std::optional<ShippingContactUpdate>&& shippingContactUpdate)
+{
+    if (shippingContactUpdate)
+        updateTotalAndLineItems(shippingContactUpdate->newTotalAndLineItems);
+}
+    
+void MockPaymentCoordinator::completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&& paymentMethodUpdate)
+{
+    if (paymentMethodUpdate)
+        updateTotalAndLineItems(paymentMethodUpdate->newTotalAndLineItems);
+}
+
</ins><span class="cx"> void MockPaymentCoordinator::changeShippingOption(String&& shippingOption)
</span><span class="cx"> {
</span><span class="cx">     dispatchIfShowing([mainFrame = makeRef(m_mainFrame), shippingOption = WTFMove(shippingOption)]() mutable {
</span></span></pre></div>
<a id="trunkSourceWebCoretestingMockPaymentCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.h (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockPaymentCoordinator.h    2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.h       2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx"> 
</span><ins>+#include "ApplePayLineItem.h"
</ins><span class="cx"> #include "MockPaymentAddress.h"
</span><span class="cx"> #include "PaymentCoordinatorClient.h"
</span><span class="cx"> 
</span><span class="lines">@@ -45,6 +46,9 @@
</span><span class="cx">     void acceptPayment();
</span><span class="cx">     void cancelPayment();
</span><span class="cx"> 
</span><ins>+    const ApplePayLineItem& total() const { return m_total; }
+    const Vector<ApplePayLineItem>& lineItems() const { return m_lineItems; }
+
</ins><span class="cx">     void ref() const { }
</span><span class="cx">     void deref() const { }
</span><span class="cx"> 
</span><span class="lines">@@ -55,16 +59,20 @@
</span><span class="cx">     void openPaymentSetup(const String&, const String&, WTF::Function<void(bool)>&&);
</span><span class="cx">     bool showPaymentUI(const URL&, const Vector<URL>&, const ApplePaySessionPaymentRequest&) final;
</span><span class="cx">     void completeMerchantValidation(const PaymentMerchantSession&) final;
</span><del>-    void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&) final { }
-    void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&) final { }
-    void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&) final { }
</del><ins>+    void completeShippingMethodSelection(std::optional<ShippingMethodUpdate>&&) final;
+    void completeShippingContactSelection(std::optional<ShippingContactUpdate>&&) final;
+    void completePaymentMethodSelection(std::optional<PaymentMethodUpdate>&&) final;
</ins><span class="cx">     void completePaymentSession(std::optional<PaymentAuthorizationResult>&&) final;
</span><span class="cx">     void abortPaymentSession() final;
</span><span class="cx">     void cancelPaymentSession() final;
</span><span class="cx">     void paymentCoordinatorDestroyed() final;
</span><span class="cx"> 
</span><ins>+    void updateTotalAndLineItems(const ApplePaySessionPaymentRequest::TotalAndLineItems&);
+
</ins><span class="cx">     MainFrame& m_mainFrame;
</span><span class="cx">     MockPaymentAddress m_shippingAddress;
</span><ins>+    ApplePayLineItem m_total;
+    Vector<ApplePayLineItem> m_lineItems;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoretestingMockPaymentCoordinatoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/MockPaymentCoordinator.idl (225848 => 225849)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/MockPaymentCoordinator.idl  2017-12-13 17:57:29 UTC (rev 225848)
+++ trunk/Source/WebCore/testing/MockPaymentCoordinator.idl     2017-12-13 18:02:28 UTC (rev 225849)
</span><span class="lines">@@ -32,4 +32,7 @@
</span><span class="cx">     void changePaymentMethod(ApplePayPaymentMethod paymentMethod);
</span><span class="cx">     void acceptPayment();
</span><span class="cx">     void cancelPayment();
</span><ins>+
+    readonly attribute ApplePayLineItem total;
+    readonly attribute sequence<ApplePayLineItem> lineItems;
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>