Add new 'other' Apple Pay button style
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Nov 2016 19:16:31 +0000 (19:16 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Nov 2016 19:16:31 +0000 (19:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164384
rdar://problem/28302528

Reviewed by Dean Jackson.

* DerivedSources.make:
* WebCorePrefix.h:
Add extension points.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
Add ApplePayButtonType::Other.

(WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
Add CSSValueOther.

* css/CSSValueKeywords.in:
Add other.

* css/parser/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
Add CSSValueOther.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Add CSSValueOther.

* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
Handle ApplePayButtonType::Other.

* rendering/style/RenderStyleConstants.h:
Add ApplePayButtonType::Other.

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

Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/WebCorePrefix.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/parser/CSSParser.cpp
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/rendering/RenderThemeCocoa.mm
Source/WebCore/rendering/style/RenderStyleConstants.h

index 6c62976..74f1f48 100644 (file)
@@ -1,3 +1,40 @@
+2016-11-03  Anders Carlsson  <andersca@apple.com>
+
+        Add new 'other' Apple Pay button style
+        https://bugs.webkit.org/show_bug.cgi?id=164384
+        rdar://problem/28302528
+
+        Reviewed by Dean Jackson.
+
+        * DerivedSources.make:
+        * WebCorePrefix.h:
+        Add extension points.
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        Add ApplePayButtonType::Other.
+
+        (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
+        Add CSSValueOther.
+
+        * css/CSSValueKeywords.in:
+        Add other.
+
+        * css/parser/CSSParser.cpp:
+        (WebCore::isValidKeywordPropertyAndValue):
+        Add CSSValueOther.
+
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        Add CSSValueOther.
+
+        * rendering/RenderThemeCocoa.mm:
+        (WebCore::toPKPaymentButtonType):
+        Handle ApplePayButtonType::Other.
+
+        * rendering/style/RenderStyleConstants.h:
+        Add ApplePayButtonType::Other.
+
 2016-11-04  Antti Koivisto  <antti@apple.com>
 
         slotted() pseudo does not work with ID selector
index cfc2276..29030ac 100644 (file)
@@ -815,6 +815,8 @@ ADDITIONAL_EVENT_TARGET_FACTORY =
 
 -include WebCoreDerivedSourcesAdditions.make
 
+-include ApplePayWebCoreDerivedSourcesAdditions.make
+
 JS_BINDING_IDLS += $(ADDITIONAL_BINDING_IDLS)
 
 all : $(ADDITIONAL_BINDING_IDLS:%.idl=JS%.h)
@@ -919,6 +921,7 @@ endif
 WEBCORE_CSS_PROPERTY_NAMES := $(WebCore)/css/CSSPropertyNames.in
 WEBCORE_CSS_VALUE_KEYWORDS := $(WebCore)/css/CSSValueKeywords.in
 WEBCORE_CSS_VALUE_KEYWORDS := $(WEBCORE_CSS_VALUE_KEYWORDS) $(WebCore)/css/SVGCSSValueKeywords.in
+WEBCORE_CSS_VALUE_KEYWORDS_DEFINES := $(FEATURE_DEFINES) $(ADDITIONAL_CSS_VALUE_KEYWORDS_DEFINES)
 
 CSSPropertyNames.h CSSPropertyNames.cpp StyleBuilder.cpp StylePropertyShorthandFunctions.h StylePropertyShorthandFunctions.cpp : makeprop.intermediate
 .INTERMEDIATE : makeprop.intermediate
@@ -930,7 +933,7 @@ CSSValueKeywords.h CSSValueKeywords.cpp : makevalues.intermediate
 .INTERMEDIATE : makevalues.intermediate
 makevalues.intermediate : $(WEBCORE_CSS_VALUE_KEYWORDS) css/makevalues.pl bindings/scripts/preprocessor.pm $(PLATFORM_FEATURE_DEFINES)
        $(PERL) -pe '' $(WEBCORE_CSS_VALUE_KEYWORDS) > CSSValueKeywords.in
-       $(PERL) "$(WebCore)/css/makevalues.pl" --defines "$(FEATURE_DEFINES)"
+       $(PERL) "$(WebCore)/css/makevalues.pl" --defines "$(WEBCORE_CSS_VALUE_KEYWORDS_DEFINES)"
 
 # --------
 
index a427e04..d5493de 100644 (file)
 #define delete ("if you use new/delete make sure to include config.h at the top of the file"()) 
 #endif
 
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/ApplePayWebCorePrefixAdditions.h>
+#endif
+
 /* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
  * to allow C++ code that expects exceptions to build. These definitions
  * interfere with Objective-C++ uses of Objective-C exception handlers, which
index 0d358d6..e9bd81c 100644 (file)
@@ -5488,6 +5488,10 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ApplePayButtonType e)
     case ApplePayButtonType::SetUp:
         m_value.valueID = CSSValueSetUp;
         break;
+    case ApplePayButtonType::Other:
+        m_value.valueID = CSSValueOther;
+        break;
+
     default:
         ASSERT_NOT_REACHED();
         break;
@@ -5504,6 +5508,8 @@ template<> inline CSSPrimitiveValue::operator ApplePayButtonType() const
         return ApplePayButtonType::Buy;
     case CSSValueSetUp:
         return ApplePayButtonType::SetUp;
+    case CSSValueOther:
+        return ApplePayButtonType::Other;
     default:
         break;
     }
index 6ef9c8d..aca3cfc 100644 (file)
@@ -1288,6 +1288,7 @@ white-outline
 plain
 buy
 set-up
+other
 #endif
 
 // font-synthesis
index cd3c73d..d7fdbfb 100644 (file)
@@ -1038,8 +1038,8 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
         if (valueID == CSSValueWhite || valueID == CSSValueWhiteOutline || valueID == CSSValueBlack)
             return true;
         break;
-    case CSSPropertyApplePayButtonType: // plain | buy | set-up
-        if (valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp)
+    case CSSPropertyApplePayButtonType: // plain | buy | set-up | other
+        if (valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp || valueID == CSSValueOther)
             return true;
         break;
 #endif
index ff02800..18dd6ce 100644 (file)
@@ -777,8 +777,8 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
 #if ENABLE(APPLE_PAY)
     case CSSPropertyApplePayButtonStyle: // white | white-outline | black
         return valueID == CSSValueWhite || valueID == CSSValueWhiteOutline || valueID == CSSValueBlack;
-    case CSSPropertyApplePayButtonType: // plain | buy | set-up
-        return valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp;
+    case CSSPropertyApplePayButtonType: // plain | buy | set-up | other
+        return valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp || valueID == CSSValueOther;
 #endif
     case CSSPropertyWebkitNbspMode: // normal | space
         return valueID == CSSValueNormal || valueID == CSSValueSpace;
index fb46242..ae6ec5a 100644 (file)
@@ -78,6 +78,9 @@ static PKPaymentButtonType toPKPaymentButtonType(ApplePayButtonType type)
         return PKPaymentButtonTypeBuy;
     case ApplePayButtonType::SetUp:
         return PKPaymentButtonTypeSetUp;
+    case ApplePayButtonType::Other:
+        // FIXME: Use a named constant here.
+        return (PKPaymentButtonType)4;
     }
 }
 
index cf63cf8..dc82cdf 100644 (file)
@@ -707,6 +707,7 @@ enum class ApplePayButtonType {
     Plain,
     Buy,
     SetUp,
+    Other,
 };
 #endif