<!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>[183610] 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/183610">183610</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2015-04-29 20:15:23 -0700 (Wed, 29 Apr 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Create a named CSS property for system colors
https://bugs.webkit.org/show_bug.cgi?id=144423
<rdar://problem/20491011>
Reviewed by Tim Horton.
Source/WebCore:
Test: fast/css/apple-system-colors.html
Expose the following values to CSS color properties:
-apple-system-blue
-apple-system-brown
-apple-system-gray
-apple-system-green
-apple-system-orange
-apple-system-pink
-apple-system-purple
-apple-system-red
-apple-system-yellow
On platforms other than OS X Yosemite and iOS, the
actual color values are undefined and become transparent
black. (In fact, not all are defined on iOS either.)
* WebCore.xcodeproj/project.pbxproj: Two new SPI header files.
* css/CSSParser.cpp:
(WebCore::CSSParser::validSystemColorValue): New helper function that
checks if a CSSValueID is between the two system color values. This
was being tested everywhere, which meant adding a new system color was
at risk of being ignored. It's a static method so it can be used
from the SVG CSS parser too.
(WebCore::validPrimitiveValueColor): Use the new helper.
(WebCore::CSSParser::parseValue): Ditto.
(WebCore::CSSParser::parseBackgroundColor): Ditto.
(WebCore::CSSParser::parseShadow): Ditto.
(WebCore::parseDeprecatedGradientColorStop): Ditto.
(WebCore::parseGradientColorOrKeyword): Ditto.
* css/CSSParser.h: New static helper function.
* css/CSSValueKeywords.in: Add the new CSS value keywords.
* css/SVGCSSParser.cpp:
(WebCore::validSystemControlColorValue): SVG has a restricted
set of system colors, so use the helper from CSSParser but with
an extra condition.
(WebCore::CSSParser::parseSVGValue): Use the helper.
* platform/spi/ios/UIColorSPI.h: Added.
* platform/spi/cocoa/NSColorSPI.h: Added.
* rendering/RenderThemeIOS.h: New systemColor override. Also add a cache for system colors.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemColor): Ask UIColor to provide the color values for the new CSS values.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor): Ditto.
LayoutTests:
Expose the following values to CSS color properties:
-apple-system-blue
-apple-system-brown
-apple-system-gray
-apple-system-green
-apple-system-orange
-apple-system-pink
-apple-system-purple
-apple-system-red
-apple-system-yellow
The new test shows the computed value for each of these colors. It
includes generic results (no special value) and platform results for
Mac (other than Mavericks) and iOS.
* fast/css/apple-system-colors-expected.txt: Generic results.
* fast/css/apple-system-colors.html: Added - the new test.
* platform/mac/fast/css/apple-system-colors-expected.txt: Added OS X results.
* platform/ios-simulator/fast/css/apple-system-colors-expected.txt: Added iOS results.
* platform/mac-mavericks/fast/css/apple-system-colors-expected.txt: Generic results for Mavericks.</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="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssSVGCSSParsercpp">trunk/Source/WebCore/css/SVGCSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSh">trunk/Source/WebCore/rendering/RenderThemeIOS.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssapplesystemcolorsexpectedtxt">trunk/LayoutTests/fast/css/apple-system-colors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssapplesystemcolorshtml">trunk/LayoutTests/fast/css/apple-system-colors.html</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastcssapplesystemcolorsexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/css/apple-system-colors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastcssapplesystemcolorsexpectedtxt">trunk/LayoutTests/platform/mac/fast/css/apple-system-colors-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmavericksfastcssapplesystemcolorsexpectedtxt">trunk/LayoutTests/platform/mac-mavericks/fast/css/apple-system-colors-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreplatformspicocoaNSColorSPIh">trunk/Source/WebCore/platform/spi/cocoa/NSColorSPI.h</a></li>
<li><a href="#trunkSourceWebCoreplatformspiiosUIColorSPIh">trunk/Source/WebCore/platform/spi/ios/UIColorSPI.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/LayoutTests/ChangeLog        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-04-29 Dean Jackson <dino@apple.com>
+
+ Create a named CSS property for system colors
+ https://bugs.webkit.org/show_bug.cgi?id=144423
+ <rdar://problem/20491011>
+
+ Reviewed by Tim Horton.
+
+ Expose the following values to CSS color properties:
+ -apple-system-blue
+ -apple-system-brown
+ -apple-system-gray
+ -apple-system-green
+ -apple-system-orange
+ -apple-system-pink
+ -apple-system-purple
+ -apple-system-red
+ -apple-system-yellow
+
+ The new test shows the computed value for each of these colors. It
+ includes generic results (no special value) and platform results for
+ Mac (other than Mavericks) and iOS.
+
+ * fast/css/apple-system-colors-expected.txt: Generic results.
+ * fast/css/apple-system-colors.html: Added - the new test.
+ * platform/mac/fast/css/apple-system-colors-expected.txt: Added OS X results.
+ * platform/ios-simulator/fast/css/apple-system-colors-expected.txt: Added iOS results.
+ * platform/mac-mavericks/fast/css/apple-system-colors-expected.txt: Generic results for Mavericks.
+
</ins><span class="cx"> 2015-04-29 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r183600.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssapplesystemcolorsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/apple-system-colors-expected.txt (0 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/apple-system-colors-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/css/apple-system-colors-expected.txt        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+-apple-system-blue : rgba(0, 0, 0, 0)
+-apple-system-brown : rgba(0, 0, 0, 0)
+-apple-system-gray : rgba(0, 0, 0, 0)
+-apple-system-green : rgba(0, 0, 0, 0)
+-apple-system-orange : rgba(0, 0, 0, 0)
+-apple-system-pink : rgba(0, 0, 0, 0)
+-apple-system-purple : rgba(0, 0, 0, 0)
+-apple-system-red : rgba(0, 0, 0, 0)
+-apple-system-yellow : rgba(0, 0, 0, 0)
+current-color with inherited -apple-system-blue : rgba(0, 0, 0, 0)
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css/apple-system-colors-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcssapplesystemcolorshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/apple-system-colors.html (0 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/apple-system-colors.html         (rev 0)
+++ trunk/LayoutTests/fast/css/apple-system-colors.html        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<script>
+
+if (window.testRunner)
+ window.testRunner.dumpAsText();
+
+window.addEventListener("load", run, false);
+
+function run() {
+ var divs = document.querySelectorAll("div");
+ for (var i = 0; i < divs.length; i++) {
+ var div = divs[i];
+ var span = div.querySelector("span");
+ div.innerHTML += " : " + window.getComputedStyle(span).backgroundColor;
+ }
+}
+</script>
+<style>
+.swatch {
+ display: inline-block;
+ width: 40px;
+ height: 40px;
+}
+</style>
+<div><span class="swatch" style="background-color: -apple-system-blue"></span>-apple-system-blue</div>
+<div><span class="swatch" style="background-color: -apple-system-brown"></span>-apple-system-brown</div>
+<div><span class="swatch" style="background-color: -apple-system-gray"></span>-apple-system-gray</div>
+<div><span class="swatch" style="background-color: -apple-system-green"></span>-apple-system-green</div>
+<div><span class="swatch" style="background-color: -apple-system-orange"></span>-apple-system-orange</div>
+<div><span class="swatch" style="background-color: -apple-system-pink"></span>-apple-system-pink</div>
+<div><span class="swatch" style="background-color: -apple-system-purple"></span>-apple-system-purple</div>
+<div><span class="swatch" style="background-color: -apple-system-red"></span>-apple-system-red</div>
+<div><span class="swatch" style="background-color: -apple-system-yellow"></span>-apple-system-yellow</div>
+<div style="color: -apple-system-blue"><span class="swatch" style="background-color: currentcolor;"></span>current-color with inherited -apple-system-blue</div>
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/LayoutTests/fast/css/apple-system-colors.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsplatformiossimulatorfastcssapplesystemcolorsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/css/apple-system-colors-expected.txt (0 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/css/apple-system-colors-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/css/apple-system-colors-expected.txt        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+-apple-system-blue : rgb(0, 122, 255)
+-apple-system-brown : rgba(0, 0, 0, 0)
+-apple-system-gray : rgb(142, 142, 147)
+-apple-system-green : rgb(76, 217, 100)
+-apple-system-orange : rgb(255, 149, 0)
+-apple-system-pink : rgb(255, 45, 85)
+-apple-system-purple : rgba(0, 0, 0, 0)
+-apple-system-red : rgb(255, 59, 48)
+-apple-system-yellow : rgb(255, 204, 0)
+current-color with inherited -apple-system-blue : rgb(0, 122, 255)
</ins><span class="cx">Property changes on: trunk/LayoutTests/platform/ios-simulator/fast/css/apple-system-colors-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsplatformmacfastcssapplesystemcolorsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/fast/css/apple-system-colors-expected.txt (0 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/css/apple-system-colors-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/css/apple-system-colors-expected.txt        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+-apple-system-blue : rgb(27, 173, 248)
+-apple-system-brown : rgb(162, 132, 94)
+-apple-system-gray : rgb(142, 142, 145)
+-apple-system-green : rgb(99, 218, 56)
+-apple-system-orange : rgb(255, 149, 0)
+-apple-system-pink : rgb(255, 41, 104)
+-apple-system-purple : rgb(204, 115, 225)
+-apple-system-red : rgb(255, 59, 48)
+-apple-system-yellow : rgb(255, 204, 0)
+current-color with inherited -apple-system-blue : rgb(27, 173, 248)
</ins><span class="cx">Property changes on: trunk/LayoutTests/platform/mac/fast/css/apple-system-colors-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsplatformmacmavericksfastcssapplesystemcolorsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-mavericks/fast/css/apple-system-colors-expected.txt (0 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-mavericks/fast/css/apple-system-colors-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac-mavericks/fast/css/apple-system-colors-expected.txt        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+-apple-system-blue : rgba(0, 0, 0, 0)
+-apple-system-brown : rgba(0, 0, 0, 0)
+-apple-system-gray : rgba(0, 0, 0, 0)
+-apple-system-green : rgba(0, 0, 0, 0)
+-apple-system-orange : rgba(0, 0, 0, 0)
+-apple-system-pink : rgba(0, 0, 0, 0)
+-apple-system-purple : rgba(0, 0, 0, 0)
+-apple-system-red : rgba(0, 0, 0, 0)
+-apple-system-yellow : rgba(0, 0, 0, 0)
+current-color with inherited -apple-system-blue : rgba(0, 0, 0, 0)
</ins><span class="cx">Property changes on: trunk/LayoutTests/platform/mac-mavericks/fast/css/apple-system-colors-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/ChangeLog        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -1,3 +1,61 @@
</span><ins>+2015-04-29 Dean Jackson <dino@apple.com>
+
+ Create a named CSS property for system colors
+ https://bugs.webkit.org/show_bug.cgi?id=144423
+ <rdar://problem/20491011>
+
+ Reviewed by Tim Horton.
+
+ Test: fast/css/apple-system-colors.html
+
+ Expose the following values to CSS color properties:
+ -apple-system-blue
+ -apple-system-brown
+ -apple-system-gray
+ -apple-system-green
+ -apple-system-orange
+ -apple-system-pink
+ -apple-system-purple
+ -apple-system-red
+ -apple-system-yellow
+
+ On platforms other than OS X Yosemite and iOS, the
+ actual color values are undefined and become transparent
+ black. (In fact, not all are defined on iOS either.)
+
+ * WebCore.xcodeproj/project.pbxproj: Two new SPI header files.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::validSystemColorValue): New helper function that
+ checks if a CSSValueID is between the two system color values. This
+ was being tested everywhere, which meant adding a new system color was
+ at risk of being ignored. It's a static method so it can be used
+ from the SVG CSS parser too.
+ (WebCore::validPrimitiveValueColor): Use the new helper.
+ (WebCore::CSSParser::parseValue): Ditto.
+ (WebCore::CSSParser::parseBackgroundColor): Ditto.
+ (WebCore::CSSParser::parseShadow): Ditto.
+ (WebCore::parseDeprecatedGradientColorStop): Ditto.
+ (WebCore::parseGradientColorOrKeyword): Ditto.
+ * css/CSSParser.h: New static helper function.
+
+ * css/CSSValueKeywords.in: Add the new CSS value keywords.
+
+ * css/SVGCSSParser.cpp:
+ (WebCore::validSystemControlColorValue): SVG has a restricted
+ set of system colors, so use the helper from CSSParser but with
+ an extra condition.
+ (WebCore::CSSParser::parseSVGValue): Use the helper.
+
+ * platform/spi/ios/UIColorSPI.h: Added.
+ * platform/spi/cocoa/NSColorSPI.h: Added.
+
+ * rendering/RenderThemeIOS.h: New systemColor override. Also add a cache for system colors.
+ * rendering/RenderThemeIOS.mm:
+ (WebCore::RenderThemeIOS::systemColor): Ask UIColor to provide the color values for the new CSS values.
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::systemColor): Ditto.
+
</ins><span class="cx"> 2015-04-29 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r183600.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -1307,6 +1307,8 @@
</span><span class="cx">                 31C0FF4E0E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */; };
</span><span class="cx">                 31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31D591B116697A6C00E6BF02 /* PlugInClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                31DF63571AF187DD0078FD91 /* NSColorSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DF63561AF187DD0078FD91 /* NSColorSPI.h */; };
+                31DF63591AF194F00078FD91 /* UIColorSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DF63581AF194F00078FD91 /* UIColorSPI.h */; };
</ins><span class="cx">                 31EAF97E121435A400E7C1BF /* DeviceMotionClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */; };
</span><span class="cx">                 31EAF97F121435A400E7C1BF /* DeviceMotionClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31EAF97D121435A400E7C1BF /* DeviceMotionClientIOS.mm */; };
</span><span class="cx">                 31EC1E2814FF60EE00C94662 /* JSNotificationPermissionCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31EC1E2614FF60EE00C94662 /* JSNotificationPermissionCallback.cpp */; };
</span><span class="lines">@@ -8447,6 +8449,8 @@
</span><span class="cx">                 31C0FF480E4CEFDD007D6FE5 /* DOMWebKitTransitionEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWebKitTransitionEventInternal.h; sourceTree = "<group>"; };
</span><span class="cx">                 31D591B116697A6C00E6BF02 /* PlugInClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlugInClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 31DCD29C1AB4FBDE0072E817 /* AnimationTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationTrigger.h; path = animation/AnimationTrigger.h; sourceTree = "<group>"; };
</span><ins>+                31DF63561AF187DD0078FD91 /* NSColorSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSColorSPI.h; sourceTree = "<group>"; };
+                31DF63581AF194F00078FD91 /* UIColorSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UIColorSPI.h; path = ios/UIColorSPI.h; sourceTree = "<group>"; };
</ins><span class="cx">                 31E8D8BA160BC94B004CE8F5 /* RenderSnapshottedPlugIn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSnapshottedPlugIn.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 31E8D8BB160BC94C004CE8F5 /* RenderSnapshottedPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSnapshottedPlugIn.h; sourceTree = "<group>"; };
</span><span class="cx">                 31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeviceMotionClientIOS.h; path = ios/DeviceMotionClientIOS.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -16534,6 +16538,7 @@
</span><span class="cx">                                 CE12524E1A1A78D200864480 /* MachVMSPI.h */,
</span><span class="cx">                                 A19D93441A9FEC7200B46C24 /* NEFilterSourceSPI.h */,
</span><span class="cx">                                 CE1252501A1BEBD800864480 /* NSCalendarDateSPI.h */,
</span><ins>+                                31DF63561AF187DD0078FD91 /* NSColorSPI.h */,
</ins><span class="cx">                                 2DDB97F319F9AECA002025D8 /* NSExtensionSPI.h */,
</span><span class="cx">                                 CE12523A1A16711000864480 /* NSFileManagerSPI.h */,
</span><span class="cx">                                 CE1252461A16C2C200864480 /* NSPointerFunctionsSPI.h */,
</span><span class="lines">@@ -18808,6 +18813,7 @@
</span><span class="cx">                                 CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */,
</span><span class="cx">                                 6FAD4A561A9D0FAE009F7D3C /* OpenGLESSPI.h */,
</span><span class="cx">                                 CE1252381A166FA000864480 /* QuickLookSPI.h */,
</span><ins>+                                31DF63581AF194F00078FD91 /* UIColorSPI.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = ios;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -24155,6 +24161,7 @@
</span><span class="cx">                                 CECCFC3B141973D5002A0AC1 /* DecodeEscapeSequences.h in Headers */,
</span><span class="cx">                                 4A0FFAA21AAF5EA20062803B /* RealtimeMediaSourceCenter.h in Headers */,
</span><span class="cx">                                 4162A451101145AE00DFF3ED /* DedicatedWorkerGlobalScope.h in Headers */,
</span><ins>+                                31DF63571AF187DD0078FD91 /* NSColorSPI.h in Headers */,
</ins><span class="cx">                                 41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */,
</span><span class="cx">                                 FD06DFA6134A4DEF006F5D7D /* DefaultAudioDestinationNode.h in Headers */,
</span><span class="cx">                                 FD31602C12B0267600C1A359 /* DelayDSPKernel.h in Headers */,
</span><span class="lines">@@ -26585,6 +26592,7 @@
</span><span class="cx">                                 088A0E05126EF1DB00978F7A /* SVGAnimatedProperty.h in Headers */,
</span><span class="cx">                                 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */,
</span><span class="cx">                                 088A0E07126EF1DB00978F7A /* SVGAnimatedPropertyMacros.h in Headers */,
</span><ins>+                                31DF63591AF194F00078FD91 /* UIColorSPI.h in Headers */,
</ins><span class="cx">                                 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */,
</span><span class="cx">                                 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */,
</span><span class="cx">                                 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -514,10 +514,15 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool CSSParser::isValidSystemColorValue(CSSValueID valueID)
+{
+ return valueID >= CSSValueAqua && valueID <= CSSValueAppleSystemYellow;
+}
+
</ins><span class="cx"> static bool validPrimitiveValueColor(CSSValueID valueID, bool strict = false)
</span><span class="cx"> {
</span><span class="cx"> return (valueID == CSSValueWebkitText || valueID == CSSValueCurrentcolor || valueID == CSSValueMenu
</span><del>- || (valueID >= CSSValueAlpha && valueID <= CSSValueWindowtext)
</del><ins>+ || CSSParser::isValidSystemColorValue(valueID) || valueID == CSSValueAlpha
</ins><span class="cx"> || (valueID >= CSSValueWebkitFocusRingColor && valueID < CSSValueWebkitText && !strict));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2038,8 +2043,8 @@
</span><span class="cx"> // since we use this in our UA sheets.
</span><span class="cx"> else if (id == CSSValueCurrentcolor)
</span><span class="cx"> validPrimitive = true;
</span><del>- else if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu ||
- (id >= CSSValueWebkitFocusRingColor && id < CSSValueWebkitText && inQuirksMode())) {
</del><ins>+ else if (isValidSystemColorValue(id) || id == CSSValueMenu
+ || (id >= CSSValueWebkitFocusRingColor && id < CSSValueWebkitText && inQuirksMode())) {
</ins><span class="cx"> validPrimitive = true;
</span><span class="cx"> } else {
</span><span class="cx"> parsedValue = parseColor();
</span><span class="lines">@@ -2879,7 +2884,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx"> case CSSPropertyWebkitTapHighlightColor:
</span><del>- if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu
</del><ins>+ if (isValidSystemColorValue(id) || id == CSSValueMenu
</ins><span class="cx"> || (id >= CSSValueWebkitFocusRingColor && id < CSSValueWebkitText && inQuirksMode())) {
</span><span class="cx"> validPrimitive = true;
</span><span class="cx"> } else {
</span><span class="lines">@@ -4130,8 +4135,8 @@
</span><span class="cx"> PassRefPtr<CSSValue> CSSParser::parseBackgroundColor()
</span><span class="cx"> {
</span><span class="cx"> CSSValueID id = m_valueList->current()->id;
</span><del>- if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu || id == CSSValueCurrentcolor ||
- (id >= CSSValueGrey && id < CSSValueWebkitText && inQuirksMode()))
</del><ins>+ if (id == CSSValueWebkitText || isValidSystemColorValue(id) || id == CSSValueMenu || id == CSSValueCurrentcolor
+ || (id >= CSSValueGrey && id < CSSValueWebkitText && inQuirksMode()))
</ins><span class="cx"> return cssValuePool().createIdentifierValue(id);
</span><span class="cx"> return parseColor();
</span><span class="cx"> }
</span><span class="lines">@@ -7624,7 +7629,7 @@
</span><span class="cx"> } else {
</span><span class="cx"> // The only other type of value that's ok is a color value.
</span><span class="cx"> RefPtr<CSSPrimitiveValue> parsedColor;
</span><del>- bool isColor = ((value->id >= CSSValueAqua && value->id <= CSSValueWindowtext) || value->id == CSSValueMenu
</del><ins>+ bool isColor = (isValidSystemColorValue(value->id) || value->id == CSSValueMenu
</ins><span class="cx"> || (value->id >= CSSValueWebkitFocusRingColor && value->id <= CSSValueWebkitText && inQuirksMode())
</span><span class="cx"> || value->id == CSSValueCurrentcolor);
</span><span class="cx"> if (isColor) {
</span><span class="lines">@@ -8385,7 +8390,7 @@
</span><span class="cx"> stop.m_position = cssValuePool().createValue(1, CSSPrimitiveValue::CSS_NUMBER);
</span><span class="cx">
</span><span class="cx"> CSSValueID id = args->current()->id;
</span><del>- if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu)
</del><ins>+ if (id == CSSValueWebkitText || CSSParser::isValidSystemColorValue(id) || id == CSSValueMenu)
</ins><span class="cx"> stop.m_color = cssValuePool().createIdentifierValue(id);
</span><span class="cx"> else
</span><span class="cx"> stop.m_color = parser.parseColor(args->current());
</span><span class="lines">@@ -8412,7 +8417,7 @@
</span><span class="cx">
</span><span class="cx"> stopArg = args->next();
</span><span class="cx"> CSSValueID id = stopArg->id;
</span><del>- if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu)
</del><ins>+ if (id == CSSValueWebkitText || CSSParser::isValidSystemColorValue(id) || id == CSSValueMenu)
</ins><span class="cx"> stop.m_color = cssValuePool().createIdentifierValue(id);
</span><span class="cx"> else
</span><span class="cx"> stop.m_color = parser.parseColor(stopArg);
</span><span class="lines">@@ -8583,7 +8588,7 @@
</span><span class="cx"> static PassRefPtr<CSSPrimitiveValue> parseGradientColorOrKeyword(CSSParser& parser, CSSParserValue& value)
</span><span class="cx"> {
</span><span class="cx"> CSSValueID id = value.id;
</span><del>- if (id == CSSValueWebkitText || (id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu || id == CSSValueCurrentcolor)
</del><ins>+ if (id == CSSValueWebkitText || CSSParser::isValidSystemColorValue(id) || id == CSSValueMenu || id == CSSValueCurrentcolor)
</ins><span class="cx"> return cssValuePool().createIdentifierValue(id);
</span><span class="cx">
</span><span class="cx"> return parser.parseColor(&value);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/css/CSSParser.h        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -121,6 +121,7 @@
</span><span class="cx"> static ParseResult parseValue(MutableStyleProperties*, CSSPropertyID, const String&, bool important, CSSParserMode, StyleSheetContents*);
</span><span class="cx">
</span><span class="cx"> static bool parseColor(RGBA32& color, const String&, bool strict = false);
</span><ins>+ static bool isValidSystemColorValue(CSSValueID);
</ins><span class="cx"> static bool parseSystemColor(RGBA32& color, const String&, Document*);
</span><span class="cx"> static PassRefPtr<CSSValueList> parseFontFaceValue(const AtomicString&);
</span><span class="cx"> PassRefPtr<CSSPrimitiveValue> parseValidPrimitive(CSSValueID ident, ValueWithCalculation&);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -186,6 +186,15 @@
</span><span class="cx"> window
</span><span class="cx"> windowframe
</span><span class="cx"> windowtext
</span><ins>+-apple-system-blue
+-apple-system-brown
+-apple-system-gray
+-apple-system-green
+-apple-system-orange
+-apple-system-pink
+-apple-system-purple
+-apple-system-red
+-apple-system-yellow
</ins><span class="cx"> -webkit-focus-ring-color
</span><span class="cx"> currentcolor
</span><span class="cx"> //
</span></span></pre></div>
<a id="trunkSourceWebCorecssSVGCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SVGCSSParser.cpp (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SVGCSSParser.cpp        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/css/SVGCSSParser.cpp        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -33,6 +33,11 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+static bool isValidSystemControlColorValue(CSSValueID id)
+{
+ return id >= CSSValueActiveborder && CSSParser::isValidSystemColorValue(id);
+}
+
</ins><span class="cx"> bool CSSParser::parseSVGValue(CSSPropertyID propId, bool important)
</span><span class="cx"> {
</span><span class="cx"> if (!m_valueList->current())
</span><span class="lines">@@ -187,7 +192,7 @@
</span><span class="cx"> parsedValue = SVGPaint::createNone();
</span><span class="cx"> else if (id == CSSValueCurrentcolor)
</span><span class="cx"> parsedValue = SVGPaint::createCurrentColor();
</span><del>- else if ((id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu)
</del><ins>+ else if (isValidSystemControlColorValue(id) || id == CSSValueMenu)
</ins><span class="cx"> parsedValue = SVGPaint::createColor(RenderTheme::defaultTheme()->systemColor(id));
</span><span class="cx"> else if (valueWithCalculation.value().unit == CSSPrimitiveValue::CSS_URI) {
</span><span class="cx"> RGBA32 c = Color::transparent;
</span><span class="lines">@@ -210,8 +215,8 @@
</span><span class="cx"> case CSSPropertyStopColor: // TODO : icccolor
</span><span class="cx"> case CSSPropertyFloodColor:
</span><span class="cx"> case CSSPropertyLightingColor:
</span><del>- if ((id >= CSSValueAqua && id <= CSSValueWindowtext) ||
- (id >= CSSValueAliceblue && id <= CSSValueYellowgreen))
</del><ins>+ if (CSSParser::isValidSystemColorValue(id)
+ || (id >= CSSValueAliceblue && id <= CSSValueYellowgreen))
</ins><span class="cx"> parsedValue = SVGColor::createFromString(valueWithCalculation.value().string);
</span><span class="cx"> else if (id == CSSValueCurrentcolor)
</span><span class="cx"> parsedValue = SVGColor::createCurrentColor();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaNSColorSPIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/spi/cocoa/NSColorSPI.h (0 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/NSColorSPI.h         (rev 0)
+++ trunk/Source/WebCore/platform/spi/cocoa/NSColorSPI.h        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#import <AppKit/NSColor.h>
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+
+#if PLATFORM(MAC) && USE(APPLE_INTERNAL_SDK)
+
+#import <AppKit/NSColor_Private.h>
+
+#else
+
+@interface NSColor (Details)
++ (NSColor *)systemRedColor;
++ (NSColor *)systemGreenColor;
++ (NSColor *)systemBlueColor;
++ (NSColor *)systemOrangeColor;
++ (NSColor *)systemYellowColor;
++ (NSColor *)systemBrownColor;
++ (NSColor *)systemPinkColor;
++ (NSColor *)systemPurpleColor;
++ (NSColor *)systemGrayColor;
+@end
+
+#endif
+
+#endif
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/spi/cocoa/NSColorSPI.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreplatformspiiosUIColorSPIh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/spi/ios/UIColorSPI.h (0 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/ios/UIColorSPI.h         (rev 0)
+++ trunk/Source/WebCore/platform/spi/ios/UIColorSPI.h        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2015 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.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <UIKit/UIInterface_Private.h>
+
+#else
+
+#import <UIKit/UIColor.h>
+
+@interface UIColor (Details)
+
++ (UIColor *)systemBlueColor;
++ (UIColor *)systemGrayColor;
++ (UIColor *)systemGreenColor;
++ (UIColor *)systemOrangeColor;
++ (UIColor *)systemPinkColor;
++ (UIColor *)systemRedColor;
++ (UIColor *)systemYellowColor;
+
+@end
+
+#endif
</ins><span class="cx">Property changes on: trunk/Source/WebCore/platform/spi/ios/UIColorSPI.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.h (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.h        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.h        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -111,6 +111,8 @@
</span><span class="cx"> virtual String mediaControlsScript() override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ virtual Color systemColor(CSSValueID) const override;
+
</ins><span class="cx"> private:
</span><span class="cx"> RenderThemeIOS();
</span><span class="cx"> virtual ~RenderThemeIOS() { }
</span><span class="lines">@@ -120,6 +122,8 @@
</span><span class="cx">
</span><span class="cx"> String m_mediaControlsScript;
</span><span class="cx"> String m_mediaControlsStyleSheet;
</span><ins>+
+ mutable HashMap<int, RGBA32> m_systemColorCache;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx"> #import "RenderThemeIOS.h"
</span><span class="cx"> #import "RenderView.h"
</span><span class="cx"> #import "SoftLinking.h"
</span><ins>+#import "UIColorSPI.h"
</ins><span class="cx"> #import "UserAgentScripts.h"
</span><span class="cx"> #import "UserAgentStyleSheets.h"
</span><span class="cx"> #import "WebCoreThreadRun.h"
</span><span class="lines">@@ -65,16 +66,19 @@
</span><span class="cx"> #import <wtf/RefPtr.h>
</span><span class="cx"> #import <wtf/StdLibExtras.h>
</span><span class="cx">
</span><del>-@interface UIApplication
-+ (UIApplication *)sharedApplication;
-@property(nonatomic,copy) NSString *preferredContentSizeCategory;
-@end
-
</del><span class="cx"> SOFT_LINK_FRAMEWORK(UIKit)
</span><span class="cx"> SOFT_LINK_CLASS(UIKit, UIApplication)
</span><ins>+SOFT_LINK_CLASS(UIKit, UIColor)
</ins><span class="cx"> SOFT_LINK_CONSTANT(UIKit, UIContentSizeCategoryDidChangeNotification, CFStringRef)
</span><span class="cx"> #define UIContentSizeCategoryDidChangeNotification getUIContentSizeCategoryDidChangeNotification()
</span><span class="cx">
</span><ins>+#if !USE(APPLE_INTERNAL_SDK)
+@interface UIApplication
++ (UIApplication *)sharedApplication;
+@property (nonatomic, copy) NSString *preferredContentSizeCategory;
+@end
+#endif
+
</ins><span class="cx"> @interface WebCoreRenderThemeBundle : NSObject
</span><span class="cx"> @end
</span><span class="cx">
</span><span class="lines">@@ -1307,6 +1311,50 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(VIDEO)
</span><span class="cx">
</span><ins>+Color RenderThemeIOS::systemColor(CSSValueID cssValueId) const
+{
+ {
+ auto it = m_systemColorCache.find(cssValueId);
+ if (it != m_systemColorCache.end())
+ return it->value;
+ }
+
+ Color color;
+ switch (cssValueId) {
+ case CSSValueAppleSystemBlue:
+ color = [getUIColorClass() systemBlueColor].CGColor;
+ break;
+ case CSSValueAppleSystemGray:
+ color = [getUIColorClass() systemGrayColor].CGColor;
+ break;
+ case CSSValueAppleSystemGreen:
+ color = [getUIColorClass() systemGreenColor].CGColor;
+ break;
+ case CSSValueAppleSystemOrange:
+ color = [getUIColorClass() systemOrangeColor].CGColor;
+ break;
+ case CSSValueAppleSystemPink:
+ color = [getUIColorClass() systemPinkColor].CGColor;
+ break;
+ case CSSValueAppleSystemRed:
+ color = [getUIColorClass() systemRedColor].CGColor;
+ break;
+ case CSSValueAppleSystemYellow:
+ color = [getUIColorClass() systemYellowColor].CGColor;
+ break;
+ default:
+ break;
+ }
+
+ if (!color.isValid())
+ color = RenderTheme::systemColor(cssValueId);
+
+ if (color.isValid())
+ m_systemColorCache.set(cssValueId, color.rgb());
+
+ return color;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+}
+
</ins><span class="cx"> #endif //PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (183609 => 183610)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-04-30 03:08:17 UTC (rev 183609)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2015-04-30 03:15:23 UTC (rev 183610)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> #import "LocalCurrentGraphicsContext.h"
</span><span class="cx"> #import "LocalizedStrings.h"
</span><span class="cx"> #import "MediaControlElements.h"
</span><ins>+#import "NSColorSPI.h"
</ins><span class="cx"> #import "NSSharingServicePickerSPI.h"
</span><span class="cx"> #import "Page.h"
</span><span class="cx"> #import "PaintInfo.h"
</span><span class="lines">@@ -457,7 +458,7 @@
</span><span class="cx"> Color RenderThemeMac::systemColor(CSSValueID cssValueId) const
</span><span class="cx"> {
</span><span class="cx"> {
</span><del>- HashMap<int, RGBA32>::iterator it = m_systemColorCache.find(cssValueId);
</del><ins>+ auto it = m_systemColorCache.find(cssValueId);
</ins><span class="cx"> if (it != m_systemColorCache.end())
</span><span class="cx"> return it->value;
</span><span class="cx"> }
</span><span class="lines">@@ -567,6 +568,35 @@
</span><span class="cx"> case CSSValueWindowtext:
</span><span class="cx"> color = convertNSColorToColor([NSColor windowFrameTextColor]);
</span><span class="cx"> break;
</span><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+ case CSSValueAppleSystemBlue:
+ color = convertNSColorToColor([NSColor systemBlueColor]);
+ break;
+ case CSSValueAppleSystemBrown:
+ color = convertNSColorToColor([NSColor systemBrownColor]);
+ break;
+ case CSSValueAppleSystemGray:
+ color = convertNSColorToColor([NSColor systemGrayColor]);
+ break;
+ case CSSValueAppleSystemGreen:
+ color = convertNSColorToColor([NSColor systemGreenColor]);
+ break;
+ case CSSValueAppleSystemOrange:
+ color = convertNSColorToColor([NSColor systemOrangeColor]);
+ break;
+ case CSSValueAppleSystemPink:
+ color = convertNSColorToColor([NSColor systemPinkColor]);
+ break;
+ case CSSValueAppleSystemPurple:
+ color = convertNSColorToColor([NSColor systemPurpleColor]);
+ break;
+ case CSSValueAppleSystemRed:
+ color = convertNSColorToColor([NSColor systemRedColor]);
+ break;
+ case CSSValueAppleSystemYellow:
+ color = convertNSColorToColor([NSColor systemYellowColor]);
+ break;
+#endif
</ins><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>