Diff
Modified: trunk/LayoutTests/ChangeLog (223214 => 223215)
--- trunk/LayoutTests/ChangeLog 2017-10-12 00:00:57 UTC (rev 223214)
+++ trunk/LayoutTests/ChangeLog 2017-10-12 00:14:34 UTC (rev 223215)
@@ -1,3 +1,14 @@
+2017-10-11 Andy Estes <[email protected]>
+
+ [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact
+ https://bugs.webkit.org/show_bug.cgi?id=178191
+ <rdar://problem/34906367>
+
+ Reviewed by Tim Horton.
+
+ * http/tests/ssl/applepay/ApplePaySession-expected.txt:
+ * http/tests/ssl/applepay/ApplePaySession.html:
+
2017-10-11 Youenn Fablet <[email protected]>
Add API to clean CacheStorage data
Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt (223214 => 223215)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt 2017-10-12 00:00:57 UTC (rev 223214)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt 2017-10-12 00:14:34 UTC (rev 223215)
@@ -260,6 +260,9 @@
SETUP: request = validRequest(); request.billingContact = { };
PASS new ApplePaySession(2, request) did not throw exception.
+SETUP: request = validRequest(); request.billingContact = { subLocality: '', subAdministrativeArea: '' };
+PASS new ApplePaySession(2, request) did not throw exception.
+
Testing PaymentRequest.requiredShippingContactFields
SETUP: request = validRequest(); request.requiredShippingContactFields = undefined;
@@ -321,6 +324,9 @@
SETUP: request = validRequest(); request.shippingContact = { };
PASS new ApplePaySession(2, request) did not throw exception.
+SETUP: request = validRequest(); request.shippingContact = { subLocality: '', subAdministrativeArea: '' };
+PASS new ApplePaySession(2, request) did not throw exception.
+
Testing PaymentRequest.shippingType
SETUP: request = validRequest(); request.shippingType = undefined;
Modified: trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html (223214 => 223215)
--- trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html 2017-10-12 00:00:57 UTC (rev 223214)
+++ trunk/LayoutTests/http/tests/ssl/applepay/ApplePaySession.html 2017-10-12 00:14:34 UTC (rev 223215)
@@ -148,6 +148,7 @@
logAndShouldNotThrow("request = validRequest(); request.billingContact = null;", "new ApplePaySession(2, request)")
logAndShouldNotThrow("request = validRequest(); request.billingContact = undefined;", "new ApplePaySession(2, request)")
logAndShouldNotThrow("request = validRequest(); request.billingContact = { };", "new ApplePaySession(2, request)")
+ logAndShouldNotThrow("request = validRequest(); request.billingContact = { subLocality: '', subAdministrativeArea: '' };", "new ApplePaySession(2, request)")
debug("Testing PaymentRequest.requiredShippingContactFields")
debug("");
@@ -174,6 +175,7 @@
logAndShouldNotThrow("request = validRequest(); request.shippingContact = null;", "new ApplePaySession(2, request)")
logAndShouldNotThrow("request = validRequest(); request.shippingContact = undefined;", "new ApplePaySession(2, request)")
logAndShouldNotThrow("request = validRequest(); request.shippingContact = { };", "new ApplePaySession(2, request)")
+ logAndShouldNotThrow("request = validRequest(); request.shippingContact = { subLocality: '', subAdministrativeArea: '' };", "new ApplePaySession(2, request)")
debug("Testing PaymentRequest.shippingType")
debug("");
Modified: trunk/Source/WebCore/ChangeLog (223214 => 223215)
--- trunk/Source/WebCore/ChangeLog 2017-10-12 00:00:57 UTC (rev 223214)
+++ trunk/Source/WebCore/ChangeLog 2017-10-12 00:14:34 UTC (rev 223215)
@@ -1,3 +1,18 @@
+2017-10-11 Andy Estes <[email protected]>
+
+ [Apple Pay] Add subLocality and subAdministrativeArea to ApplePayPaymentContact
+ https://bugs.webkit.org/show_bug.cgi?id=178191
+ <rdar://problem/34906367>
+
+ Reviewed by Tim Horton.
+
+ Added test cases to http/tests/ssl/applepay/ApplePaySession.html.
+
+ * Modules/applepay/ApplePayPaymentContact.h:
+ * Modules/applepay/ApplePayPaymentContact.idl:
+ * Modules/applepay/cocoa/PaymentContactCocoa.mm:
+ (WebCore::convert):
+
2017-10-11 Youenn Fablet <[email protected]>
Add API to clean CacheStorage data
Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h (223214 => 223215)
--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h 2017-10-12 00:00:57 UTC (rev 223214)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.h 2017-10-12 00:14:34 UTC (rev 223215)
@@ -41,8 +41,10 @@
String phoneticGivenName;
String phoneticFamilyName;
std::optional<Vector<String>> addressLines;
+ String subLocality;
String locality;
String postalCode;
+ String subAdministrativeArea;
String administrativeArea;
String country;
String countryCode;
Modified: trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.idl (223214 => 223215)
--- trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.idl 2017-10-12 00:00:57 UTC (rev 223214)
+++ trunk/Source/WebCore/Modules/applepay/ApplePayPaymentContact.idl 2017-10-12 00:14:34 UTC (rev 223215)
@@ -34,8 +34,10 @@
[Conditional=APPLE_PAY_SESSION_V3] DOMString phoneticGivenName;
[Conditional=APPLE_PAY_SESSION_V3] DOMString phoneticFamilyName;
sequence<DOMString> addressLines;
+ DOMString subLocality;
DOMString locality;
DOMString postalCode;
+ DOMString subAdministrativeArea;
DOMString administrativeArea;
DOMString country;
DOMString countryCode;
Modified: trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm (223214 => 223215)
--- trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm 2017-10-12 00:00:57 UTC (rev 223214)
+++ trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm 2017-10-12 00:14:34 UTC (rev 223215)
@@ -100,10 +100,14 @@
// FIXME: StringBuilder should hava a toNSString() function to avoid the extra String allocation.
[address setStreet:builder.toString()];
+ if (!contact.subLocality.isEmpty())
+ [address setSubLocality:contact.subLocality];
if (!contact.locality.isEmpty())
[address setCity:contact.locality];
if (!contact.postalCode.isEmpty())
[address setPostalCode:contact.postalCode];
+ if (!contact.subAdministrativeArea.isEmpty())
+ [address setSubAdministrativeArea:contact.subAdministrativeArea];
if (!contact.administrativeArea.isEmpty())
[address setState:contact.administrativeArea];
if (!contact.country.isEmpty())
@@ -140,8 +144,10 @@
String(postalAddress.street).split("\n", addressLines);
result.addressLines = WTFMove(addressLines);
}
+ result.subLocality = postalAddress.subLocality;
result.locality = postalAddress.city;
result.postalCode = postalAddress.postalCode;
+ result.subAdministrativeArea = postalAddress.subAdministrativeArea;
result.administrativeArea = postalAddress.state;
result.country = postalAddress.country;
result.countryCode = postalAddress.ISOCountryCode;