<!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>[201145] branches/safari-602.1.32-branch</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/201145">201145</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2016-05-19 01:40:43 -0700 (Thu, 19 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/201065">r201065</a>. rdar://problem/26333137</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari602132branchLayoutTestsChangeLog">branches/safari-602.1.32-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari602132branchLayoutTestsfastmediamqcolorgamutexpectedhtml">branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut-expected.html</a></li>
<li><a href="#branchessafari602132branchLayoutTestsfastmediamqcolorgamuthtml">branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut.html</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreChangeLog">branches/safari-602.1.32-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari602132branchSourceWebCorecssMediaQueryEvaluatorcpp">branches/safari-602.1.32-branch/Source/WebCore/css/MediaQueryEvaluator.cpp</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreplatformPlatformScreenh">branches/safari-602.1.32-branch/Source/WebCore/platform/PlatformScreen.h</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreplatformeflPlatformScreenEflcpp">branches/safari-602.1.32-branch/Source/WebCore/platform/efl/PlatformScreenEfl.cpp</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreplatformgtkPlatformScreenGtkcpp">branches/safari-602.1.32-branch/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreplatformiosPlatformScreenIOSmm">branches/safari-602.1.32-branch/Source/WebCore/platform/ios/PlatformScreenIOS.mm</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreplatformmacPlatformScreenMacmm">branches/safari-602.1.32-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreplatformspicgCoreGraphicsSPIh">branches/safari-602.1.32-branch/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h</a></li>
<li><a href="#branchessafari602132branchSourceWebCoreplatformwinPlatformScreenWincpp">branches/safari-602.1.32-branch/Source/WebCore/platform/win/PlatformScreenWin.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari602132branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/LayoutTests/ChangeLog (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/LayoutTests/ChangeLog        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/LayoutTests/ChangeLog        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-05-19  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r201065. rdar://problem/26333137
+
+    2016-05-17  Dean Jackson  &lt;dino@apple.com&gt;
+
+            Add media query support for wide gamut displays on Mac
+            https://bugs.webkit.org/show_bug.cgi?id=157824
+            &lt;rdar://problem/26333137&gt;
+
+            Reviewed by Simon Fraser.
+
+            Remove the check for sRGB, since it is confusingly false
+            on browsers that don't implement this query, and is likely
+            to be dropped from the specification.
+
+            Also, make the text readable.
+
+            * fast/media/mq-color-gamut-expected.html:
+            * fast/media/mq-color-gamut.html:
+
</ins><span class="cx"> 2016-05-17  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r200976. rdar://problem/26231897
</span></span></pre></div>
<a id="branchessafari602132branchLayoutTestsfastmediamqcolorgamutexpectedhtml"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut-expected.html (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut-expected.html        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut-expected.html        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -2,15 +2,13 @@
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;title&gt;CSS4 media query test: color-gamut.&lt;/title&gt;
</span><span class="cx"> &lt;style type=&quot;text/css&quot;&gt;
</span><del>-#a { background-color: green; }
-#b { background-color: blue; }
-#c { background-color: green; }
</del><ins>+#a { background-color: green; color: white; }
+#b { background-color: green; color: white; }
</ins><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">   &lt;p id=&quot;a&quot;&gt;This paragraph should have a green background.&lt;/p&gt;
</span><del>-  &lt;p id=&quot;b&quot;&gt;This paragraph should have a blue background on a device with a display that supports something close to sRGB, which is nearly all displays. Otherwise the background should be green.&lt;/p&gt;
-  &lt;p id=&quot;c&quot;&gt;This paragraph should have a blue background on a device with a display that supports something close to P3. Otherwise the background should be green.&lt;/p&gt;
</del><ins>+  &lt;p id=&quot;b&quot;&gt;This paragraph should have a blue background on a device with a display that supports something close to P3. Otherwise the background should be green.&lt;/p&gt;
</ins><span class="cx">   &lt;p&gt;Note that the expected results of this test assume a display that is not significantly wider than sRGB.&lt;/p&gt;
</span><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="branchessafari602132branchLayoutTestsfastmediamqcolorgamuthtml"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut.html (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut.html        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/LayoutTests/fast/media/mq-color-gamut.html        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -2,23 +2,17 @@
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;title&gt;CSS4 media query test: color-gamut.&lt;/title&gt;
</span><span class="cx"> &lt;style type=&quot;text/css&quot;&gt;
</span><del>-#a { background-color: green; }
-#b { background-color: green; }
-#c { background-color: green; }
</del><ins>+#a { background-color: green; color: white; }
+#b { background-color: green; color: white; }
</ins><span class="cx"> 
</span><del>-@media (color-gamut: srgb) {
</del><ins>+@media (color-gamut: p3) {
</ins><span class="cx"> #b { background-color: blue; }
</span><span class="cx"> }
</span><del>-
-@media (color-gamut: p3) {
-#c { background-color: blue; }
-}
</del><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">   &lt;p id=&quot;a&quot;&gt;This paragraph should have a green background.&lt;/p&gt;
</span><del>-  &lt;p id=&quot;b&quot;&gt;This paragraph should have a blue background on a device with a display that supports something close to sRGB, which is nearly all displays. Otherwise the background should be green.&lt;/p&gt;
-  &lt;p id=&quot;c&quot;&gt;This paragraph should have a blue background on a device with a display that supports something close to P3. Otherwise the background should be green.&lt;/p&gt;
</del><ins>+  &lt;p id=&quot;b&quot;&gt;This paragraph should have a blue background on a device with a display that supports something close to P3. Otherwise the background should be green.&lt;/p&gt;
</ins><span class="cx">   &lt;p&gt;Note that the expected results of this test assume a display that is not significantly wider than sRGB.&lt;/p&gt;
</span><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/ChangeLog (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/ChangeLog        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/ChangeLog        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -1,5 +1,39 @@
</span><span class="cx"> 2016-05-19  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r201065. rdar://problem/26333137
+
+    2016-05-17  Dean Jackson  &lt;dino@apple.com&gt;
+
+            Add media query support for wide gamut displays on Mac
+            https://bugs.webkit.org/show_bug.cgi?id=157824
+            &lt;rdar://problem/26333137&gt;
+
+            Reviewed by Simon Fraser.
+
+            Implement the Mac version of the color-gamut media query
+            by filling out the screenSupportsExtendedColor function.
+
+            On Yosemite, we always return false. On El Capitan, we
+            can check the ColorProfile via ColorSync to see if the
+            screen is wide gamut.
+
+            There is already a test in fast/media/mq-color-gamut.html
+
+            * css/MediaQueryEvaluator.cpp:
+            (WebCore::color_gamutMediaFeatureEval): Pass the mainFrame's view
+            to screenSupportsExtendedColor, so that it can fetch the NSScreen.
+            * platform/PlatformScreen.h: screenSupportsExtendedColor now takes
+            an optional Widget parameter.
+            * platform/ios/PlatformScreenIOS.mm:
+            (WebCore::screenSupportsExtendedColor): Add empty parameter.
+            * platform/mac/PlatformScreenMac.mm:
+            (WebCore::screenSupportsExtendedColor): Get the NSWindow, then the
+            NSScreen, then the ColorSpace, then the ColorSyncProfile, and
+            check if it is a wide gamut profile.
+            * platform/spi/cg/CoreGraphicsSPI.h: Add the SPI declarations.
+
+2016-05-19  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
</ins><span class="cx">         Merge r201043. rdar://problem/25835802
</span><span class="cx"> 
</span><span class="cx">     2016-05-16  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/css/MediaQueryEvaluator.cpp (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/css/MediaQueryEvaluator.cpp        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/css/MediaQueryEvaluator.cpp        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx">     return numberValue(value, number) &amp;&amp; compareValue(0, static_cast&lt;int&gt;(number), op);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool color_gamutMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame*, MediaFeaturePrefix)
</del><ins>+static bool color_gamutMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><span class="cx">     if (!value)
</span><span class="cx">         return true;
</span><span class="lines">@@ -257,7 +257,7 @@
</span><span class="cx">     case CSSValueP3:
</span><span class="cx">         // FIXME: For the moment we'll just assume an &quot;extended
</span><span class="cx">         // color&quot; display is at least as good as P3.
</span><del>-        return screenSupportsExtendedColor();
</del><ins>+        return screenSupportsExtendedColor(frame-&gt;page()-&gt;mainFrame().view());
</ins><span class="cx">     case CSSValueRec2020:
</span><span class="cx">         // FIXME: At some point we should start detecting displays that
</span><span class="cx">         // support more colors.
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreplatformPlatformScreenh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/platform/PlatformScreen.h (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/platform/PlatformScreen.h        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/platform/PlatformScreen.h        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     FloatRect screenRect(Widget*);
</span><span class="cx">     FloatRect screenAvailableRect(Widget*);
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT bool screenSupportsExtendedColor();
</del><ins>+    WEBCORE_EXPORT bool screenSupportsExtendedColor(Widget* widget = nullptr);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">     NSScreen *screenForWindow(NSWindow *);
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreplatformeflPlatformScreenEflcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/platform/efl/PlatformScreenEfl.cpp (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/platform/efl/PlatformScreenEfl.cpp        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/platform/efl/PlatformScreenEfl.cpp        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">     return screenRect(widget);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool screenSupportsExtendedColor()
</del><ins>+bool screenSupportsExtendedColor(Widget*)
</ins><span class="cx"> {
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreplatformgtkPlatformScreenGtkcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool screenSupportsExtendedColor()
</del><ins>+bool screenSupportsExtendedColor(Widget*)
</ins><span class="cx"> {
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreplatformiosPlatformScreenIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/platform/ios/PlatformScreenIOS.mm (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/platform/ios/PlatformScreenIOS.mm        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/platform/ios/PlatformScreenIOS.mm        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">     return UIAccessibilityIsInvertColorsEnabled();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool screenSupportsExtendedColor()
</del><ins>+bool screenSupportsExtendedColor(Widget*)
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 90300
</span><span class="cx">     return MGGetBoolAnswer(kMGQHasExtendedColorDisplay);
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreplatformmacPlatformScreenMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -26,10 +26,13 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;PlatformScreen.h&quot;
</span><span class="cx"> 
</span><ins>+#import &quot;CoreGraphicsSPI.h&quot;
</ins><span class="cx"> #import &quot;FloatRect.h&quot;
</span><span class="cx"> #import &quot;FrameView.h&quot;
</span><span class="cx"> #import &quot;HostWindow.h&quot;
</span><span class="cx"> 
</span><ins>+#import &lt;ColorSync/ColorSync.h&gt;
+
</ins><span class="cx"> extern &quot;C&quot; {
</span><span class="cx"> bool CGDisplayUsesInvertedPolarity(void);
</span><span class="cx"> bool CGDisplayUsesForceToGray(void);
</span><span class="lines">@@ -135,9 +138,30 @@
</span><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool screenSupportsExtendedColor()
</del><ins>+bool screenSupportsExtendedColor(Widget* widget)
</ins><span class="cx"> {
</span><del>-    return false; // FIXME: Update this to detect extended color screens.
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101100
+    UNUSED_PARAM(widget);
+    return false;
+#else
+    if (!widget)
+        return false;
+
+    NSWindow *window = [widget-&gt;platformWidget() window];
+    NSScreen *screen = screenForWidget(widget, window);
+    CGColorSpaceRef colorSpace = screen.colorSpace.CGColorSpace;
+
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    return CGColorSpaceIsWideGamutRGB(colorSpace);
+#else
+    bool isWideGamut = false;
+    RetainPtr&lt;CFDataRef&gt; iccData = adoptCF(CGColorSpaceCopyICCProfile(colorSpace));
+    RetainPtr&lt;ColorSyncProfileRef&gt; profile = adoptCF(ColorSyncProfileCreate(iccData.get(), NULL));
+    if (profile)
+        isWideGamut = ColorSyncProfileIsWideGamut(profile.get());
+    return isWideGamut;
+#endif
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FloatRect toUserSpace(const NSRect&amp; rect, NSWindow *destination)
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreplatformspicgCoreGraphicsSPIh"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -33,8 +33,13 @@
</span><span class="cx"> #include &quot;IOSurfaceSPI.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
+#include &lt;ColorSync/ColorSync.h&gt;
+#endif
+
</ins><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> 
</span><ins>+#include &lt;ColorSync/ColorSyncPriv.h&gt;
</ins><span class="cx"> #include &lt;CoreGraphics/CGFontCache.h&gt;
</span><span class="cx"> #include &lt;CoreGraphics/CoreGraphicsPrivate.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -195,6 +200,8 @@
</span><span class="cx"> CGError CGSSetConnectionProperty(CGSConnectionID, CGSConnectionID ownerCid, CFStringRef key, CFTypeRef value);
</span><span class="cx"> CGError CGSCopyConnectionProperty(CGSConnectionID, CGSConnectionID ownerCid, CFStringRef key, CFTypeRef *value);
</span><span class="cx"> CGError CGSGetScreenRectForWindow(CGSConnectionID, CGSWindowID, CGRect *);
</span><ins>+
+bool ColorSyncProfileIsWideGamut(ColorSyncProfileRef);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> WTF_EXTERN_C_END
</span></span></pre></div>
<a id="branchessafari602132branchSourceWebCoreplatformwinPlatformScreenWincpp"></a>
<div class="modfile"><h4>Modified: branches/safari-602.1.32-branch/Source/WebCore/platform/win/PlatformScreenWin.cpp (201144 => 201145)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-602.1.32-branch/Source/WebCore/platform/win/PlatformScreenWin.cpp        2016-05-19 08:40:36 UTC (rev 201144)
+++ branches/safari-602.1.32-branch/Source/WebCore/platform/win/PlatformScreenWin.cpp        2016-05-19 08:40:43 UTC (rev 201145)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">     return monitorInfo.rcWork;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool screenSupportsExtendedColor()
</del><ins>+bool screenSupportsExtendedColor(Widget*)
</ins><span class="cx"> {
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>