<!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>[206687] branches/safari-602.2.14.0-branch/Source/WebCore</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/206687">206687</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2016-09-30 15:46:47 -0700 (Fri, 30 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/205980">r205980</a>. rdar://problem/28567557</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6022140branchSourceWebCoreChangeLog">branches/safari-602.2.14.0-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6022140branchSourceWebCoreWebCorexcodeprojprojectpbxproj">branches/safari-602.2.14.0-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorecssCSSComputedStyleDeclarationcpp">branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorecssCSSParsercpp">branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorecssCSSPrimitiveValueMappingsh">branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorecssCSSPropertyNamesin">branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorecssCSSValueKeywordsin">branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#branchessafari6022140branchSourceWebCoreplatformThemeTypesh">branches/safari-602.2.14.0-branch/Source/WebCore/platform/ThemeTypes.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCoreplatformspicocoaPassKitSPIh">branches/safari-602.2.14.0-branch/Source/WebCore/platform/spi/cocoa/PassKitSPI.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingRenderThemecpp">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.cpp</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingRenderThemeh">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingRenderThemeIOSh">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeIOS.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingRenderThemeMach">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeMac.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingstyleRenderStyleh">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingstyleRenderStyleConstantsh">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingstyleStyleRareNonInheritedDatah">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingRenderThemeCocoah">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.h</a></li>
<li><a href="#branchessafari6022140branchSourceWebCorerenderingRenderThemeCocoamm">branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6022140branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/ChangeLog (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/ChangeLog        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/ChangeLog        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -1,3 +1,102 @@
</span><ins>+2016-09-30  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r205980. rdar://problem/28567557
+
+    2016-09-14  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+            Add CSS -webkit-appearance property for Apple Pay buttons
+            https://bugs.webkit.org/show_bug.cgi?id=161986
+
+            Reviewed by Dean Jackson.
+
+            Add a new -webkit-appearance property, &quot;-apple-pay-button&quot;.
+            Also, add two properties, &quot;-apple-pay-button-type&quot; and &quot;-apple-pay-button-style&quot;.
+
+            * WebCore.xcodeproj/project.pbxproj:
+            Add RenderThemeCocoa.h and RenderThemeCocoa.mm.
+
+            * css/CSSComputedStyleDeclaration.cpp:
+            (WebCore::ComputedStyleExtractor::propertyValue):
+            Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.
+
+            * css/CSSPrimitiveValueMappings.h:
+            (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+            (WebCore::CSSPrimitiveValue::operator ApplePayButtonStyle):
+            (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
+            Add ApplePayButtonStyle and ApplePayButtonType conversion routines.
+
+            * css/CSSPropertyNames.in:
+            Add -apple-pay-button-style and -apple-pay-button-type.
+
+            * css/CSSValueKeywords.in:
+            Add CSS values.
+
+            * css/parser/CSSParser.cpp:
+            (WebCore::isValidKeywordPropertyAndValue):
+            Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.
+
+            * css/parser/CSSParserFastPaths.cpp:
+            (WebCore::CSSParserFastPaths::isKeywordPropertyID):
+            Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.
+
+            (WebCore::isAppleLegacyCSSPropertyKeyword):
+            New function that returns whether the CSS property should be rewritten to -webkit-.
+            We want to rewrite -apple- but not -apple-pay-.
+
+            (WebCore::cssPropertyID):
+            Use the newly added isAppleLegacyCSSPropertyKeyword.
+
+            (WebCore::isAppleLegacyCSSValueKeyword):
+            Check for &quot;-apple-pay-&quot; in addition to &quot;-apple-system-&quot;.
+
+            * platform/ThemeTypes.h:
+            Add ApplePayButtonPart.
+
+            * platform/spi/cocoa/PassKitSPI.h:
+            Add PKDrawApplePayButton declaration.
+
+            * rendering/RenderTheme.cpp:
+            (WebCore::RenderTheme::adjustStyle):
+            Handle ApplePayButtonPart.
+
+            (WebCore::RenderTheme::paint):
+            Handle ApplePayButtonPart.
+
+            * rendering/RenderTheme.h:
+            (WebCore::RenderTheme::adjustApplePayButtonStyle):
+            (WebCore::RenderTheme::paintApplePayButton):
+            Add new functions.
+
+            * rendering/RenderThemeCocoa.h: Added.
+            * rendering/RenderThemeCocoa.mm: Added.
+            (WebCore::RenderThemeCocoa::adjustApplePayButtonStyle):
+            Adjust the minimum width and minimum height accordingly.
+
+            (WebCore::toPKPaymentButtonStyle):
+            (WebCore::toPKPaymentButtonType):
+            Helper functions that convert our WebCore types to PK types.
+
+            (WebCore::RenderThemeCocoa::paintApplePayButton):
+            Call PKDrawApplePayButton.
+
+            * rendering/RenderThemeIOS.h:
+            * rendering/RenderThemeMac.h:
+            Inherit from RenderThemeCocoa.
+
+            * rendering/style/RenderStyle.h:
+            (WebCore::RenderStyle::applePayButtonStyle):
+            (WebCore::RenderStyle::applePayButtonType):
+            (WebCore::RenderStyle::setApplePayButtonStyle):
+            (WebCore::RenderStyle::setApplePayButtonType):
+            (WebCore::RenderStyle::initialApplePayButtonStyle):
+            (WebCore::RenderStyle::initialApplePayButtonType):
+            * rendering/style/RenderStyleConstants.h:
+            * rendering/style/StyleRareInheritedData.cpp:
+            (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+            (WebCore::StyleRareInheritedData::operator==):
+            * rendering/style/StyleRareInheritedData.h:
+            Add new style members for the button style and button type properties.
+
</ins><span class="cx"> 2016-09-29  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r206556. rdar://problem/28524440
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -697,6 +697,8 @@
</span><span class="cx">                 1A22464E0CC98DDB00C05240 /* SQLiteTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2246480CC98DDB00C05240 /* SQLiteTransaction.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A24844D1D1A272A00F56BA7 /* PaymentHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A24844C1D1A270100F56BA7 /* PaymentHeaders.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A250E0D1CDD632000D0BE63 /* LinkIconType.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A250E0C1CDD632000D0BE63 /* LinkIconType.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                1A299FE71D7F5FA600A60093 /* RenderThemeCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A299FE51D7F5FA600A60093 /* RenderThemeCocoa.mm */; };
+                1A299FE81D7F5FA600A60093 /* RenderThemeCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A299FE61D7F5FA600A60093 /* RenderThemeCocoa.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 1A2A68230B5BEDE70002A480 /* ProgressTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2A68210B5BEDE70002A480 /* ProgressTracker.cpp */; };
</span><span class="cx">                 1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1A2AAC580DC2A3B100A20D9A /* ApplicationCacheStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */; };
</span><span class="lines">@@ -8208,6 +8210,8 @@
</span><span class="cx">                 1A2246480CC98DDB00C05240 /* SQLiteTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLiteTransaction.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A24844C1D1A270100F56BA7 /* PaymentHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaymentHeaders.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A250E0C1CDD632000D0BE63 /* LinkIconType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkIconType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1A299FE51D7F5FA600A60093 /* RenderThemeCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderThemeCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1A299FE61D7F5FA600A60093 /* RenderThemeCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderThemeCocoa.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1A2A68210B5BEDE70002A480 /* ProgressTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ProgressTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A2A68220B5BEDE70002A480 /* ProgressTracker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1A2AAC560DC2A3B100A20D9A /* ApplicationCacheStorage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheStorage.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -24404,6 +24408,8 @@
</span><span class="cx">                                 E4C91A15180999F100A17F6D /* RenderTextLineBoxes.h */,
</span><span class="cx">                                 BCEA484A097D93020094C9E4 /* RenderTheme.cpp */,
</span><span class="cx">                                 BCEA484B097D93020094C9E4 /* RenderTheme.h */,
</span><ins>+                                1A299FE61D7F5FA600A60093 /* RenderThemeCocoa.h */,
+                                1A299FE51D7F5FA600A60093 /* RenderThemeCocoa.mm */,
</ins><span class="cx">                                 FED13D500CEA949700D89466 /* RenderThemeIOS.h */,
</span><span class="cx">                                 C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */,
</span><span class="cx">                                 BCEA4848097D93020094C9E4 /* RenderThemeMac.h */,
</span><span class="lines">@@ -26939,6 +26945,7 @@
</span><span class="cx">                                 BC926F810C0552470082776B /* JSHTMLFrameSetElement.h in Headers */,
</span><span class="cx">                                 A80E7B150A19D606007FB8C5 /* JSHTMLHeadElement.h in Headers */,
</span><span class="cx">                                 1AE2AA2F0A1CDAB400B42B25 /* JSHTMLHeadingElement.h in Headers */,
</span><ins>+                                1A299FE81D7F5FA600A60093 /* RenderThemeCocoa.h in Headers */,
</ins><span class="cx">                                 1AE2AA310A1CDAB400B42B25 /* JSHTMLHRElement.h in Headers */,
</span><span class="cx">                                 1A85B1900A1B18A200D8C87C /* JSHTMLHtmlElement.h in Headers */,
</span><span class="cx">                                 BC4918C90BFEA050009D6316 /* JSHTMLIFrameElement.h in Headers */,
</span><span class="lines">@@ -29430,6 +29437,7 @@
</span><span class="cx">                                 F45C231D1995B73B00A6E2E3 /* AxisScrollSnapOffsets.cpp in Sources */,
</span><span class="cx">                                 37F57ACF1A5072DD00876F98 /* AXObjectCache.cpp in Sources */,
</span><span class="cx">                                 AAA728F916D1D8BC00D3BBC6 /* AXObjectCacheIOS.mm in Sources */,
</span><ins>+                                1A299FE71D7F5FA600A60093 /* RenderThemeCocoa.mm in Sources */,
</ins><span class="cx">                                 29A8124B0FBB9CA900510293 /* AXObjectCacheMac.mm in Sources */,
</span><span class="cx">                                 BCA8C81F11E3D36900812FB7 /* BackForwardController.cpp in Sources */,
</span><span class="cx">                                 BCA8CA5F11E4E6D100812FB7 /* BackForwardList.cpp in Sources */,
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -3765,6 +3765,13 @@
</span><span class="cx">             return cssValuePool.createValue(style-&gt;trailingWord());
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(APPLE_PAY)
+        case CSSPropertyApplePayButtonStyle:
+            return cssValuePool.createValue(style-&gt;applePayButtonStyle());
+        case CSSPropertyApplePayButtonType:
+            return cssValuePool.createValue(style-&gt;applePayButtonType());
+#endif
+
</ins><span class="cx">         /* Individual properties not part of the spec */
</span><span class="cx">         case CSSPropertyBackgroundRepeatX:
</span><span class="cx">         case CSSPropertyBackgroundRepeatY:
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSParser.cpp (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSParser.cpp        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSParser.cpp        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -984,6 +984,16 @@
</span><span class="cx">             return true;
</span><span class="cx">         break;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(APPLE_PAY)
+    case CSSPropertyApplePayButtonStyle: // white | white-outline | black
+        if (valueID == CSSValueWhite || valueID == CSSValueWhiteOutline || valueID == CSSValueBlack)
+            return true;
+        break;
+    case CSSPropertyApplePayButtonType: // plain | buy | set-up | in-store
+        if (valueID == CSSValuePlain || valueID == CSSValueBuy || valueID == CSSValueSetUp || valueID == CSSValueInStore)
+            return true;
+        break;
+#endif
</ins><span class="cx">     case CSSPropertyFontVariantPosition: // normal | sub | super
</span><span class="cx">         if (valueID == CSSValueNormal || valueID == CSSValueSub || valueID == CSSValueSuper)
</span><span class="cx">             return true;
</span><span class="lines">@@ -13552,6 +13562,17 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(LEGACY_CSS_VENDOR_PREFIXES)
+static bool isAppleLegacyCSSPropertyKeyword(const char* propertyKeyword, unsigned length)
+{
+    static const char applePrefix[] = &quot;-apple-&quot;;
+    static const char applePayPrefix[] = &quot;-apple-pay-&quot;;
+
+    return hasPrefix(propertyKeyword, length, applePrefix)
+        &amp;&amp; !hasPrefix(propertyKeyword, length, applePayPrefix);
+}
+#endif
+
</ins><span class="cx"> template &lt;typename CharacterType&gt;
</span><span class="cx"> static CSSPropertyID cssPropertyID(const CharacterType* propertyName, unsigned length)
</span><span class="cx"> {
</span><span class="lines">@@ -13571,7 +13592,7 @@
</span><span class="cx">         // If the prefix is -apple- or -khtml-, change it to -webkit-.
</span><span class="cx">         // This makes the string one character longer.
</span><span class="cx">         if (RuntimeEnabledFeatures::sharedFeatures().legacyCSSVendorPrefixesEnabled()
</span><del>-            &amp;&amp; (hasPrefix(buffer, length, &quot;-apple-&quot;) || hasPrefix(buffer, length, &quot;-khtml-&quot;))) {
</del><ins>+            &amp;&amp; (isAppleLegacyCSSPropertyKeyword(buffer, length) || hasPrefix(buffer, length, &quot;-khtml-&quot;))) {
</ins><span class="cx">             memmove(buffer + 7, buffer + 6, length + 1 - 6);
</span><span class="cx">             memcpy(buffer, &quot;-webkit&quot;, 7);
</span><span class="cx">             ++length;
</span><span class="lines">@@ -13622,14 +13643,16 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static bool isAppleLegacyCssValueKeyword(const char* valueKeyword, unsigned length)
</del><ins>+static bool isAppleLegacyCSSValueKeyword(const char* valueKeyword, unsigned length)
</ins><span class="cx"> {
</span><span class="cx">     static const char applePrefix[] = &quot;-apple-&quot;;
</span><del>-    static const char appleSystemPrefix[] = &quot;-apple-system&quot;;
</del><ins>+    static const char appleSystemPrefix[] = &quot;-apple-system-&quot;;
+    static const char applePayPrefix[] = &quot;-apple-pay-&quot;;
</ins><span class="cx">     static const char* appleWirelessPlaybackTargetActive = getValueName(CSSValueAppleWirelessPlaybackTargetActive);
</span><span class="cx"> 
</span><span class="cx">     return hasPrefix(valueKeyword, length, applePrefix)
</span><span class="cx">         &amp;&amp; !hasPrefix(valueKeyword, length, appleSystemPrefix)
</span><ins>+        &amp;&amp; !hasPrefix(valueKeyword, length, applePayPrefix)
</ins><span class="cx">         &amp;&amp; !WTF::equal(reinterpret_cast&lt;const LChar*&gt;(valueKeyword), reinterpret_cast&lt;const LChar*&gt;(appleWirelessPlaybackTargetActive), length);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -13651,7 +13674,7 @@
</span><span class="cx">         // This makes the string one character longer.
</span><span class="cx">         // On iOS we don't want to change values starting with -apple-system to -webkit-system.
</span><span class="cx">         // FIXME: Remove this mangling without breaking the web.
</span><del>-        if (isAppleLegacyCssValueKeyword(buffer, length) || hasPrefix(buffer, length, &quot;-khtml-&quot;)) {
</del><ins>+        if (isAppleLegacyCSSValueKeyword(buffer, length) || hasPrefix(buffer, length, &quot;-khtml-&quot;)) {
</ins><span class="cx">             memmove(buffer + 7, buffer + 6, length + 1 - 6);
</span><span class="cx">             memcpy(buffer, &quot;-webkit&quot;, 7);
</span><span class="cx">             ++length;
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPrimitiveValueMappings.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPrimitiveValueMappings.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -616,6 +616,11 @@
</span><span class="cx">         m_value.valueID = CSSValueImageControlsButton;
</span><span class="cx">         break;
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(APPLE_PAY)
+    case ApplePayButtonPart:
+        m_value.valueID = CSSValueApplePayButton;
+        break;
+#endif
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -5473,6 +5478,87 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(APPLE_PAY)
+template&lt;&gt; inline CSSPrimitiveValue::CSSPrimitiveValue(ApplePayButtonStyle e)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_VALUE_ID;
+    switch (e) {
+    case ApplePayButtonStyle::White:
+        m_value.valueID = CSSValueWhite;
+        break;
+    case ApplePayButtonStyle::WhiteOutline:
+        m_value.valueID = CSSValueWhiteOutline;
+        break;
+    case ApplePayButtonStyle::Black:
+        m_value.valueID = CSSValueBlack;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+}
+
+template&lt;&gt; inline CSSPrimitiveValue::operator ApplePayButtonStyle() const
+{
+    ASSERT(isValueID());
+    switch (m_value.valueID) {
+    case CSSValueWhite:
+        return ApplePayButtonStyle::White;
+    case CSSValueWhiteOutline:
+        return ApplePayButtonStyle::WhiteOutline;
+    case CSSValueBlack:
+        return ApplePayButtonStyle::Black;
+    default:
+        break;
+    }
+    ASSERT_NOT_REACHED();
+    return ApplePayButtonStyle::Black;
+}
+
+template&lt;&gt; inline CSSPrimitiveValue::CSSPrimitiveValue(ApplePayButtonType e)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_VALUE_ID;
+    switch (e) {
+    case ApplePayButtonType::Plain:
+        m_value.valueID = CSSValuePlain;
+        break;
+    case ApplePayButtonType::Buy:
+        m_value.valueID = CSSValueBuy;
+        break;
+    case ApplePayButtonType::SetUp:
+        m_value.valueID = CSSValueSetUp;
+        break;
+    case ApplePayButtonType::InStore:
+        m_value.valueID = CSSValueInStore;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+}
+
+template&lt;&gt; inline CSSPrimitiveValue::operator ApplePayButtonType() const
+{
+    ASSERT(isValueID());
+    switch (m_value.valueID) {
+    case CSSValuePlain:
+        return ApplePayButtonType::Plain;
+    case CSSValueBuy:
+        return ApplePayButtonType::Buy;
+    case CSSValueSetUp:
+        return ApplePayButtonType::SetUp;
+    case CSSValueInStore:
+        return ApplePayButtonType::InStore;
+    default:
+        break;
+    }
+    ASSERT_NOT_REACHED();
+    return ApplePayButtonType::Plain;
+}
+#endif
+
</ins><span class="cx"> template&lt;&gt; inline CSSPrimitiveValue::CSSPrimitiveValue(FontVariantPosition position)
</span><span class="cx">     : CSSValue(PrimitiveClass)
</span><span class="cx"> {
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPropertyNames.in (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPropertyNames.in        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSPropertyNames.in        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -681,3 +681,8 @@
</span><span class="cx"> #if defined(ENABLE_CSS_TRAILING_WORD) &amp;&amp; ENABLE_CSS_TRAILING_WORD
</span><span class="cx"> -apple-trailing-word [Inherited, NameForMethods=TrailingWord]
</span><span class="cx"> #endif
</span><ins>+
+#if defined(ENABLE_APPLE_PAY) &amp;&amp; ENABLE_APPLE_PAY
+-apple-pay-button-style
+-apple-pay-button-type
+#endif
</ins></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSValueKeywords.in (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSValueKeywords.in        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/css/CSSValueKeywords.in        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -806,6 +806,9 @@
</span><span class="cx"> #if defined(ENABLE_SERVICE_CONTROLS) &amp;&amp; ENABLE_SERVICE_CONTROLS
</span><span class="cx"> image-controls-button
</span><span class="cx"> #endif
</span><ins>+#if defined(ENABLE_APPLE_PAY) &amp;&amp; ENABLE_APPLE_PAY
+-apple-pay-button
+#endif
</ins><span class="cx"> textarea
</span><span class="cx"> #if defined(ENABLE_ATTACHMENT_ELEMENT) &amp;&amp; ENABLE_ATTACHMENT_ELEMENT
</span><span class="cx"> attachment
</span><span class="lines">@@ -1179,6 +1182,17 @@
</span><span class="cx"> -webkit-partially-balanced
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if defined(ENABLE_APPLE_PAY) &amp;&amp; ENABLE_APPLE_PAY
+// -apple-pay-button-style
+white-outline
+
+// -apple-pay-button-type
+plain
+buy
+set-up
+in-store
+#endif
+
</ins><span class="cx"> // font-synthesis
</span><span class="cx"> weight
</span><span class="cx"> style
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCoreplatformThemeTypesh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/platform/ThemeTypes.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/platform/ThemeTypes.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/platform/ThemeTypes.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef ThemeTypes_h
-#define ThemeTypes_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -49,6 +48,9 @@
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><span class="cx">     ImageControlsButtonPart,
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(APPLE_PAY)
+    ApplePayButtonPart,
+#endif
</ins><span class="cx">     TextAreaPart,
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     AttachmentPart,
</span><span class="lines">@@ -73,4 +75,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-#endif
</del></span></pre></div>
<a id="branchessafari6022140branchSourceWebCoreplatformspicocoaPassKitSPIh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/platform/spi/cocoa/PassKitSPI.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/platform/spi/cocoa/PassKitSPI.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/platform/spi/cocoa/PassKitSPI.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -222,3 +222,6 @@
</span><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> NS_ASSUME_NONNULL_END
</span><ins>+
+extern &quot;C&quot;
+void PKDrawApplePayButton(_Nonnull CGContextRef, CGRect drawRect, CGFloat scale, PKPaymentButtonType, PKPaymentButtonStyle, NSString * _Nullable languageCode);
</ins></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingRenderThemecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.cpp (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.cpp        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.cpp        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -253,6 +253,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     case CapsLockIndicatorPart:
</span><span class="cx">         return adjustCapsLockIndicatorStyle(styleResolver, style, element);
</span><ins>+#if ENABLE(APPLE_PAY)
+    case ApplePayButtonPart:
+        return adjustApplePayButtonStyle(styleResolver, style, element);
+#endif
</ins><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     case AttachmentPart:
</span><span class="cx">         return adjustAttachmentStyle(styleResolver, style, element);
</span><span class="lines">@@ -401,6 +405,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     case CapsLockIndicatorPart:
</span><span class="cx">         return paintCapsLockIndicator(box, paintInfo, integralSnappedRect);
</span><ins>+#if ENABLE(APPLE_PAY)
+    case ApplePayButtonPart:
+        return paintApplePayButton(box, paintInfo, integralSnappedRect);
+#endif
</ins><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     case AttachmentPart:
</span><span class="cx">         return paintAttachment(box, paintInfo, integralSnappedRect);
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingRenderThemeh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderTheme.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -325,6 +325,11 @@
</span><span class="cx">     virtual void adjustCapsLockIndicatorStyle(StyleResolver&amp;, RenderStyle&amp;, const Element*) const;
</span><span class="cx">     virtual bool paintCapsLockIndicator(const RenderObject&amp;, const PaintInfo&amp;, const IntRect&amp;);
</span><span class="cx"> 
</span><ins>+#if ENABLE(APPLE_PAY)
+    virtual void adjustApplePayButtonStyle(StyleResolver&amp;, RenderStyle&amp;, const Element*) const { }
+    virtual bool paintApplePayButton(const RenderObject&amp;, const PaintInfo&amp;, const IntRect&amp;) { return true; }
+#endif
+
</ins><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     virtual void adjustAttachmentStyle(StyleResolver&amp;, RenderStyle&amp;, const Element*) const;
</span><span class="cx">     virtual bool paintAttachment(const RenderObject&amp;, const PaintInfo&amp;, const IntRect&amp;);
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingRenderThemeCocoah"></a>
<div class="addfile"><h4>Added: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.h (0 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.h                                (rev 0)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/*
+ * Copyright (C) 2016 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
+
+#include &quot;RenderTheme.h&quot;
+
+namespace WebCore {
+
+class RenderThemeCocoa : public RenderTheme {
+private:
+#if ENABLE(APPLE_PAY)
+    void adjustApplePayButtonStyle(StyleResolver&amp;, RenderStyle&amp;, const Element*) const override;
+    bool paintApplePayButton(const RenderObject&amp;, const PaintInfo&amp;, const IntRect&amp;) override;
+#endif
+};
+
+}
</ins></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingRenderThemeCocoamm"></a>
<div class="addfile"><h4>Added: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.mm (0 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.mm                                (rev 0)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeCocoa.mm        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -0,0 +1,103 @@
</span><ins>+/*
+ * Copyright (C) 2016 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 &quot;config.h&quot;
+#include &quot;RenderThemeCocoa.h&quot;
+
+#if ENABLE(APPLE_PAY)
+
+#include &quot;PassKitSPI.h&quot;
+#include &quot;RenderElement.h&quot;
+#include &quot;RenderStyle.h&quot;
+#include &quot;SoftLinking.h&quot;
+#include &quot;TranslateTransformOperation.h&quot;
+
+#if PLATFORM(MAC)
+SOFT_LINK_PRIVATE_FRAMEWORK(PassKit);
+#else
+SOFT_LINK_FRAMEWORK(PassKit);
+#endif
+
+SOFT_LINK_MAY_FAIL(PassKit, PKDrawApplePayButton, void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode));
+
+namespace WebCore {
+
+static const auto applePayButtonMinimumWidth = 140;
+static const auto applePayButtonPlainMinimumWidth = 100;
+static const auto applePayButtonMinimumHeight = 30;
+
+void RenderThemeCocoa::adjustApplePayButtonStyle(StyleResolver&amp;, RenderStyle&amp; style, const Element*) const
+{
+    if (style.applePayButtonType() == ApplePayButtonType::Plain)
+        style.setMinWidth(Length(applePayButtonPlainMinimumWidth, Fixed));
+    else
+        style.setMinWidth(Length(applePayButtonMinimumWidth, Fixed));
+    style.setMinHeight(Length(applePayButtonMinimumHeight, Fixed));
+}
+
+static PKPaymentButtonStyle toPKPaymentButtonStyle(ApplePayButtonStyle style)
+{
+    switch (style) {
+    case ApplePayButtonStyle::White:
+        return PKPaymentButtonStyleWhite;
+    case ApplePayButtonStyle::WhiteOutline:
+        return PKPaymentButtonStyleWhiteOutline;
+    case ApplePayButtonStyle::Black:
+        return PKPaymentButtonStyleBlack;
+    }
+}
+
+static PKPaymentButtonType toPKPaymentButtonType(ApplePayButtonType type)
+{
+    switch (type) {
+    case ApplePayButtonType::Plain:
+        return PKPaymentButtonTypePlain;
+    case ApplePayButtonType::Buy:
+        return PKPaymentButtonTypeBuy;
+    case ApplePayButtonType::SetUp:
+        return PKPaymentButtonTypeSetUp;
+    case ApplePayButtonType::InStore:
+        return PKPaymentButtonTypeInStore;
+    }
+}
+
+bool RenderThemeCocoa::paintApplePayButton(const RenderObject&amp; renderer, const PaintInfo&amp; paintInfo, const IntRect&amp; paintRect)
+{
+    if (!canLoadPKDrawApplePayButton())
+        return false;
+
+    GraphicsContextStateSaver stateSaver(paintInfo.context());
+
+    paintInfo.context().setShouldSmoothFonts(true);
+    paintInfo.context().scale(FloatSize(1, -1));
+
+    PKDrawApplePayButton(paintInfo.context().platformContext(), CGRectMake(paintRect.x(), -paintRect.maxY(), paintRect.width(), paintRect.height()), 1.0, toPKPaymentButtonType(renderer.style().applePayButtonType()), toPKPaymentButtonStyle(renderer.style().applePayButtonStyle()), renderer.style().locale());
+
+    return false;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingRenderThemeIOSh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeIOS.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeIOS.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeIOS.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -23,12 +23,11 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef RenderThemeIOS_h
-#define RenderThemeIOS_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-#include &quot;RenderTheme.h&quot;
</del><ins>+#include &quot;RenderThemeCocoa.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx">     
</span><span class="lines">@@ -36,7 +35,7 @@
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> struct AttachmentLayout;
</span><span class="cx"> 
</span><del>-class RenderThemeIOS final : public RenderTheme {
</del><ins>+class RenderThemeIOS final : public RenderThemeCocoa {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;RenderTheme&gt; create();
</span><span class="cx"> 
</span><span class="lines">@@ -135,4 +134,3 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(IOS)
</span><del>-#endif // RenderThemeIOS_h
</del></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingRenderThemeMach"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeMac.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeMac.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/RenderThemeMac.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -19,12 +19,12 @@
</span><span class="cx">  * Boston, MA 02110-1301, USA.
</span><span class="cx">  *
</span><span class="cx">  */
</span><del>-#if !PLATFORM(IOS)
</del><span class="cx"> 
</span><del>-#ifndef RenderThemeMac_h
-#define RenderThemeMac_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#import &quot;RenderTheme.h&quot;
</del><ins>+#if PLATFORM(MAC)
+
+#import &quot;RenderThemeCocoa.h&quot;
</ins><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/HashMap.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> class RenderStyle;
</span><span class="cx"> struct AttachmentLayout;
</span><span class="cx"> 
</span><del>-class RenderThemeMac final : public RenderTheme {
</del><ins>+class RenderThemeMac final : public RenderThemeCocoa {
</ins><span class="cx"> public:
</span><span class="cx">     static Ref&lt;RenderTheme&gt; create();
</span><span class="cx"> 
</span><span class="lines">@@ -250,6 +250,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // RenderThemeMac_h
-
-#endif // !PLATFORM(IOS)
</del><ins>+#endif // PLATFORM(MAC)
</ins></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyle.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyle.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyle.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -1219,7 +1219,12 @@
</span><span class="cx"> #if ENABLE(CSS_TRAILING_WORD)
</span><span class="cx">     TrailingWord trailingWord() const { return static_cast&lt;TrailingWord&gt;(rareInheritedData-&gt;trailingWord); }
</span><span class="cx"> #endif
</span><del>-    
</del><ins>+
+#if ENABLE(APPLE_PAY)
+    ApplePayButtonStyle applePayButtonStyle() const { return static_cast&lt;ApplePayButtonStyle&gt;(rareNonInheritedData-&gt;m_applePayButtonStyle); }
+    ApplePayButtonType applePayButtonType() const { return static_cast&lt;ApplePayButtonType&gt;(rareNonInheritedData-&gt;m_applePayButtonType); }
+#endif
+
</ins><span class="cx">     void checkVariablesInCustomProperties();
</span><span class="cx"> 
</span><span class="cx"> // attribute setter methods
</span><span class="lines">@@ -1736,6 +1741,11 @@
</span><span class="cx">     void setTrailingWord(TrailingWord v) { SET_VAR(rareInheritedData, trailingWord, static_cast&lt;unsigned&gt;(v)); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(APPLE_PAY)
+    void setApplePayButtonStyle(ApplePayButtonStyle v) { SET_VAR(rareNonInheritedData, m_applePayButtonStyle, static_cast&lt;unsigned&gt;(v)); }
+    void setApplePayButtonType(ApplePayButtonType v) { SET_VAR(rareNonInheritedData, m_applePayButtonType, static_cast&lt;unsigned&gt;(v)); }
+#endif
+
</ins><span class="cx">     const SVGRenderStyle&amp; svgStyle() const { return *m_svgStyle; }
</span><span class="cx">     SVGRenderStyle&amp; accessSVGStyle() { return *m_svgStyle.access(); }
</span><span class="cx"> 
</span><span class="lines">@@ -2085,6 +2095,11 @@
</span><span class="cx">     static TrailingWord initialTrailingWord() { return TrailingWord::Auto; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(APPLE_PAY)
+    static ApplePayButtonStyle initialApplePayButtonStyle() { return ApplePayButtonStyle::Black; }
+    static ApplePayButtonType initialApplePayButtonType() { return ApplePayButtonType::Plain; }
+#endif
+
</ins><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">     // The initial value is 'none' for grid tracks.
</span><span class="cx">     static Vector&lt;GridTrackSize&gt; initialGridColumns() { return Vector&lt;GridTrackSize&gt;(); }
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyleConstants.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/RenderStyleConstants.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -696,6 +696,21 @@
</span><span class="cx"> };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(APPLE_PAY)
+enum class ApplePayButtonStyle {
+    White,
+    WhiteOutline,
+    Black,
+};
+
+enum class ApplePayButtonType {
+    Plain,
+    Buy,
+    SetUp,
+    InStore,
+};
+#endif
+
</ins><span class="cx"> TextStream&amp; operator&lt;&lt;(TextStream&amp;, EFillSizeType);
</span><span class="cx"> TextStream&amp; operator&lt;&lt;(TextStream&amp;, EFillAttachment);
</span><span class="cx"> TextStream&amp; operator&lt;&lt;(TextStream&amp;, EFillBox);
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -104,6 +104,10 @@
</span><span class="cx">     , m_effectiveBlendMode(RenderStyle::initialBlendMode())
</span><span class="cx">     , m_isolation(RenderStyle::initialIsolation())
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(APPLE_PAY)
+    , m_applePayButtonStyle(static_cast&lt;unsigned&gt;(RenderStyle::initialApplePayButtonStyle()))
+    , m_applePayButtonType(static_cast&lt;unsigned&gt;(RenderStyle::initialApplePayButtonType()))
+#endif
</ins><span class="cx">     , m_objectFit(RenderStyle::initialObjectFit())
</span><span class="cx">     , m_breakBefore(RenderStyle::initialBreakBetween())
</span><span class="cx">     , m_breakAfter(RenderStyle::initialBreakBetween())
</span><span class="lines">@@ -200,6 +204,10 @@
</span><span class="cx">     , m_effectiveBlendMode(o.m_effectiveBlendMode)
</span><span class="cx">     , m_isolation(o.m_isolation)
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(APPLE_PAY)
+    , m_applePayButtonStyle(o.m_applePayButtonStyle)
+    , m_applePayButtonType(o.m_applePayButtonType)
+#endif
</ins><span class="cx">     , m_objectFit(o.m_objectFit)
</span><span class="cx">     , m_breakBefore(o.m_breakBefore)
</span><span class="cx">     , m_breakAfter(o.m_breakAfter)
</span><span class="lines">@@ -306,6 +314,10 @@
</span><span class="cx">         &amp;&amp; m_effectiveBlendMode == o.m_effectiveBlendMode
</span><span class="cx">         &amp;&amp; m_isolation == o.m_isolation
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(APPLE_PAY)
+        &amp;&amp; m_applePayButtonStyle == o.m_applePayButtonStyle
+        &amp;&amp; m_applePayButtonType == o.m_applePayButtonType
+#endif
</ins><span class="cx">         &amp;&amp; m_aspectRatioType == o.m_aspectRatioType
</span><span class="cx">         &amp;&amp; m_objectFit == o.m_objectFit
</span><span class="cx">         &amp;&amp; m_breakAfter == o.m_breakAfter
</span></span></pre></div>
<a id="branchessafari6022140branchSourceWebCorerenderingstyleStyleRareNonInheritedDatah"></a>
<div class="modfile"><h4>Modified: branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (206686 => 206687)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h        2016-09-30 22:45:17 UTC (rev 206686)
+++ branches/safari-602.2.14.0-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h        2016-09-30 22:46:47 UTC (rev 206687)
</span><span class="lines">@@ -22,8 +22,7 @@
</span><span class="cx">  *
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef StyleRareNonInheritedData_h
-#define StyleRareNonInheritedData_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;BasicShapes.h&quot;
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="lines">@@ -220,6 +219,11 @@
</span><span class="cx">     unsigned m_isolation : 1; // Isolation
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(APPLE_PAY)
+    unsigned m_applePayButtonStyle : 2;
+    unsigned m_applePayButtonType : 3;
+#endif
+
</ins><span class="cx">     unsigned m_objectFit : 3; // ObjectFit
</span><span class="cx">     
</span><span class="cx">     unsigned m_breakBefore : 4; // BreakBetween
</span><span class="lines">@@ -237,5 +241,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // StyleRareNonInheritedData_h
</del></span></pre>
</div>
</div>

</body>
</html>