Roll out r223447.
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 19:04:22 +0000 (19:04 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Oct 2017 19:04:22 +0000 (19:04 +0000)
Broke the Sierra build.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223566 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/http/tests/ssl/applepay/ApplePayError-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePaySession-expected.txt
LayoutTests/http/tests/ssl/applepay/ApplePaySession.html
Source/WebCore/Modules/applepay/ApplePayError.idl
Source/WebCore/Modules/applepay/ApplePayPaymentContact.h
Source/WebCore/Modules/applepay/ApplePayPaymentContact.idl
Source/WebCore/Modules/applepay/ApplePaySessionPaymentRequest.h
Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm

index 6b40b07..5f1b3ed 100644 (file)
@@ -27,10 +27,10 @@ SETUP:
 PASS new ApplePayError('addressUnserviceable') did not throw exception.
 
 SETUP: 
-PASS new ApplePayError('unknown', []) threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", "subLocality", "locality", "postalCode", "subAdministrativeArea", "administrativeArea", "country", "countryCode".
+PASS new ApplePayError('unknown', []) threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", "locality", "postalCode", "administrativeArea", "country", "countryCode".
 
 SETUP: 
-PASS new ApplePayError('unknown', '') threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", "subLocality", "locality", "postalCode", "subAdministrativeArea", "administrativeArea", "country", "countryCode".
+PASS new ApplePayError('unknown', '') threw exception TypeError: Argument 2 ('contactField') to the ApplePayError constructor must be one of: "phoneNumber", "emailAddress", "name", "phoneticName", "postalAddress", "addressLines", "locality", "postalCode", "administrativeArea", "country", "countryCode".
 
 SETUP: 
 PASS new ApplePayError('unknown', 'phoneNumber') did not throw exception.
index 805fe00..551d4c1 100644 (file)
@@ -260,9 +260,6 @@ PASS new ApplePaySession(2, request) did not throw exception.
 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;
@@ -324,9 +321,6 @@ PASS new ApplePaySession(2, request) did not throw exception.
 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;
index 97df234..d822a99 100644 (file)
@@ -148,7 +148,6 @@ function go() {
     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("");
@@ -175,7 +174,6 @@ function go() {
     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("");
index f288150..402a017 100644 (file)
     "phoneticName",
     "postalAddress",
     "addressLines",
-    "subLocality",
     "locality",
     "postalCode",
-    "subAdministrativeArea",
     "administrativeArea",
     "country",
     "countryCode"
index eb6e28f..90238b4 100644 (file)
@@ -41,10 +41,8 @@ struct ApplePayPaymentContact {
     String phoneticGivenName;
     String phoneticFamilyName;
     std::optional<Vector<String>> addressLines;
-    String subLocality;
     String locality;
     String postalCode;
-    String subAdministrativeArea;
     String administrativeArea;
     String country;
     String countryCode;
index 9d5e62f..cf079cd 100644 (file)
     [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;
index 7171f5e..95d14b0 100644 (file)
@@ -167,10 +167,8 @@ struct PaymentError {
         PhoneticName,
         PostalAddress,
         AddressLines,
-        SubLocality,
         Locality,
         PostalCode,
-        SubAdministrativeArea,
         AdministrativeArea,
         Country,
         CountryCode,
index c59a4d7..478dc08 100644 (file)
@@ -46,56 +46,8 @@ SOFT_LINK_FRAMEWORK(PassKit)
 
 SOFT_LINK_CLASS(PassKit, PKContact)
 
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
-@interface CNPostalAddress ()
-@property (readonly, copy, NS_NONATOMIC_IOSONLY) NSString *subLocality;
-@property (readonly, copy, NS_NONATOMIC_IOSONLY) NSString *subAdministrativeArea;
-@end
-
-@interface CNMutablePostalAddress ()
-@property (copy, NS_NONATOMIC_IOSONLY) NSString *subLocality;
-@property (copy, NS_NONATOMIC_IOSONLY) NSString *subAdministrativeArea;
-@end
-#endif
-
 namespace WebCore {
 
-static NSString *subLocality(CNPostalAddress *address)
-{
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
-    if (![address respondsToSelector:@selector(subLocality)])
-        return nil;
-#endif
-    return address.subLocality;
-}
-
-static void setSubLocality(CNMutablePostalAddress *address, NSString *subLocality)
-{
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
-    if (![address respondsToSelector:@selector(setSubLocality:)])
-        return;
-#endif
-    address.subLocality = subLocality;
-}
-
-static NSString *subAdministrativeArea(CNPostalAddress *address)
-{
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
-    if (![address respondsToSelector:@selector(subAdministrativeArea)])
-        return nil;
-#endif
-    return address.subAdministrativeArea;
-}
-
-static void setSubAdministrativeArea(CNMutablePostalAddress *address, NSString *subAdministrativeArea)
-{
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
-    if (![address respondsToSelector:@selector(setSubAdministrativeArea:)])
-        return;
-#endif
-    address.subAdministrativeArea = subAdministrativeArea;
-}
-
 static RetainPtr<PKContact> convert(unsigned version, const ApplePayPaymentContact& contact)
 {
     auto result = adoptNS([allocPKContactInstance() init]);
@@ -148,14 +100,10 @@ static RetainPtr<PKContact> convert(unsigned version, const ApplePayPaymentConta
         // FIXME: StringBuilder should hava a toNSString() function to avoid the extra String allocation.
         [address setStreet:builder.toString()];
 
-        if (!contact.subLocality.isEmpty())
-            setSubLocality(address.get(), contact.subLocality);
         if (!contact.locality.isEmpty())
             [address setCity:contact.locality];
         if (!contact.postalCode.isEmpty())
             [address setPostalCode:contact.postalCode];
-        if (!contact.subAdministrativeArea.isEmpty())
-            setSubAdministrativeArea(address.get(), contact.subAdministrativeArea);
         if (!contact.administrativeArea.isEmpty())
             [address setState:contact.administrativeArea];
         if (!contact.country.isEmpty())
@@ -192,10 +140,8 @@ static ApplePayPaymentContact convert(PKContact *contact)
         String(postalAddress.street).split("\n", addressLines);
         result.addressLines = WTFMove(addressLines);
     }
-    result.subLocality = subLocality(postalAddress);
     result.locality = postalAddress.city;
     result.postalCode = postalAddress.postalCode;
-    result.subAdministrativeArea = subAdministrativeArea(postalAddress);
     result.administrativeArea = postalAddress.state;
     result.country = postalAddress.country;
     result.countryCode = postalAddress.ISOCountryCode;
index d3c8cbe..26b17e1 100644 (file)
@@ -63,9 +63,7 @@ SOFT_LINK_CONSTANT(PassKit, PKPaymentNetworkVisa, NSString *);
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
 SOFT_LINK_FRAMEWORK(Contacts)
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStreetKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubLocalityKey, NSString *);
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCityKey, NSString *);
-SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubAdministrativeAreaKey, NSString *);
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStateKey, NSString *);
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressPostalCodeKey, NSString *);
 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCountryKey, NSString *);
@@ -658,11 +656,6 @@ static RetainPtr<NSError> toNSError(const WebCore::PaymentError& error)
             postalAddressKey = getCNPostalAddressStreetKey();
             break;
 
-        case WebCore::PaymentError::ContactField::SubLocality:
-            pkContactField = getPKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressSubLocalityKey();
-            break;
-
         case WebCore::PaymentError::ContactField::Locality:
             pkContactField = getPKContactFieldPostalAddress();
             postalAddressKey = getCNPostalAddressCityKey();
@@ -673,11 +666,6 @@ static RetainPtr<NSError> toNSError(const WebCore::PaymentError& error)
             postalAddressKey = getCNPostalAddressPostalCodeKey();
             break;
 
-        case WebCore::PaymentError::ContactField::SubAdministrativeArea:
-            pkContactField = getPKContactFieldPostalAddress();
-            postalAddressKey = getCNPostalAddressSubAdministrativeAreaKey();
-            break;
-
         case WebCore::PaymentError::ContactField::AdministrativeArea:
             pkContactField = getPKContactFieldPostalAddress();
             postalAddressKey = getCNPostalAddressStateKey();