<!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>[207173] 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/207173">207173</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2016-10-11 15:45:22 -0700 (Tue, 11 Oct 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement prefers-reduced-motion media query
https://bugs.webkit.org/show_bug.cgi?id=163250
&lt;rdar://problem/28704129&gt;

Reviewed by Simon Fraser.

Source/WebCore:

Implement the prefers-reduced-motion media query, as
described in https://github.com/w3c/csswg-drafts/issues/442.

Tests: fast/media/mq-prefers-reduced-motion-forced-value.html
       fast/media/mq-prefers-reduced-motion.html

* Configurations/WebCoreTestSupport.xcconfig: Link against AppKit and UIKit.

* css/CSSValueKeywords.in: New keyword for &quot;reduce&quot;.

* css/MediaFeatureNames.h: Add prefers-reduced-motion.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
* css/MediaQueryExp.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):

* platform/Theme.h: New API to detect the system accessibility settings.
(WebCore::Theme::userPrefersReducedMotion):
* platform/ios/ThemeIOS.h:
* platform/ios/ThemeIOS.mm:
(WebCore::ThemeIOS::userPrefersReducedMotion):
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::userPrefersReducedMotion):

* testing/Internals.cpp: Expose the same API to internals, so that
a test can examine the value too.
(WebCore::Internals::userPrefersReducedMotion):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion):

* page/Settings.h: New setting to override the system value...
* page/Settings.in:

* testing/InternalSettings.cpp: ... plumbed through internals.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::forcedPrefersReducedMotionValue):
(WebCore::InternalSettings::setForcedPrefersReducedMotionValue):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::userPrefersReducedMotion):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion):

LayoutTests:

One test checks the system value. The other test overrides
the system values to make sure as much as possible is working.

* fast/media/mq-prefers-reduced-motion-expected.html: Added.
* fast/media/mq-prefers-reduced-motion-forced-value-expected.html: Added.
* fast/media/mq-prefers-reduced-motion-forced-value.html: Added.
* fast/media/mq-prefers-reduced-motion.html: Added.</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="#trunkSourceWebCoreConfigurationsWebCoreTestSupportxcconfig">trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssMediaFeatureNamesh">trunk/Source/WebCore/css/MediaFeatureNames.h</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryEvaluatorcpp">trunk/Source/WebCore/css/MediaQueryEvaluator.cpp</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryExpcpp">trunk/Source/WebCore/css/MediaQueryExp.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsh">trunk/Source/WebCore/page/Settings.h</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
<li><a href="#trunkSourceWebCoreplatformThemeh">trunk/Source/WebCore/platform/Theme.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosThemeIOSh">trunk/Source/WebCore/platform/ios/ThemeIOS.h</a></li>
<li><a href="#trunkSourceWebCoreplatformiosThemeIOSmm">trunk/Source/WebCore/platform/ios/ThemeIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacThemeMach">trunk/Source/WebCore/platform/mac/ThemeMac.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacThemeMacmm">trunk/Source/WebCore/platform/mac/ThemeMac.mm</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingscpp">trunk/Source/WebCore/testing/InternalSettings.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsh">trunk/Source/WebCore/testing/InternalSettings.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsidl">trunk/Source/WebCore/testing/InternalSettings.idl</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsmm">trunk/Source/WebCore/testing/Internals.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmediamqprefersreducedmotionexpectedhtml">trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqprefersreducedmotionforcedvalueexpectedhtml">trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqprefersreducedmotionforcedvaluehtml">trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqprefersreducedmotionhtml">trunk/LayoutTests/fast/media/mq-prefers-reduced-motion.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/LayoutTests/ChangeLog        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-10-11  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Implement prefers-reduced-motion media query
+        https://bugs.webkit.org/show_bug.cgi?id=163250
+        &lt;rdar://problem/28704129&gt;
+
+        Reviewed by Simon Fraser.
+
+        One test checks the system value. The other test overrides
+        the system values to make sure as much as possible is working.
+
+        * fast/media/mq-prefers-reduced-motion-expected.html: Added.
+        * fast/media/mq-prefers-reduced-motion-forced-value-expected.html: Added.
+        * fast/media/mq-prefers-reduced-motion-forced-value.html: Added.
+        * fast/media/mq-prefers-reduced-motion.html: Added.
+
</ins><span class="cx"> 2016-10-11  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Skip tests added with r207155 that rely on touch events.
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediamqprefersreducedmotionexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-expected.html (0 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-expected.html        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;CSS4 media query test: prefers-reduced-motion.&lt;/title&gt;
+&lt;style type=&quot;text/css&quot;&gt;
+#a { color: black; }
+#b { color: black; }
+#c { color: black; }
+#d { color: black; }
+&lt;/style&gt;
+&lt;script&gt;
+window.addEventListener(&quot;load&quot;, function () {
+
+    if (!window.internals) {
+        [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;].forEach(id =&gt; { document.getElementById(id).textContent = &quot;This expected result requires DRT/WKTR.&quot;; });
+        return;
+    }
+
+    if (window.internals.userPrefersReducedMotion())
+        [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;].forEach(id =&gt; { document.getElementById(id).style.color = &quot;green&quot;; });
+    else
+        document.getElementById(&quot;d&quot;).style.color = &quot;green&quot;;
+
+}, false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;p id=&quot;a&quot;&gt;This text should be green if the user requested reduced motion. Black otherwise.&lt;/p&gt;
+  &lt;p id=&quot;b&quot;&gt;This text should be green if the user requested reduced motion. Black otherwise.&lt;/p&gt;
+  &lt;p id=&quot;c&quot;&gt;This text should be green if the user requested reduced motion. Black otherwise.&lt;/p&gt;
+  &lt;p id=&quot;d&quot;&gt;This text should be green if the user has not requested reduced motion. Black otherwise.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Revision
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsfastmediamqprefersreducedmotionforcedvalueexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value-expected.html (0 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value-expected.html        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;CSS4 media query test: prefers-reduced-motion.&lt;/title&gt;
+&lt;style type=&quot;text/css&quot;&gt;
+p { color: green; }
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;p id=&quot;a&quot;&gt;This text should be green.&lt;/p&gt;
+  &lt;p id=&quot;b&quot;&gt;This text should be green.&lt;/p&gt;
+  &lt;p id=&quot;c&quot;&gt;This text should be green.&lt;/p&gt;
+  &lt;p id=&quot;d&quot;&gt;This text should be green.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Revision
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsfastmediamqprefersreducedmotionforcedvaluehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html (0 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html                                (rev 0)
+++ trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;CSS4 media query test: prefers-reduced-motion.&lt;/title&gt;
+&lt;style type=&quot;text/css&quot;&gt;
+p { color: black; }
+&lt;/style&gt;
+&lt;script&gt;
+window.addEventListener(&quot;load&quot;, function () {
+    if (!window.internals)
+        return;
+
+    window.internals.settings.forcedPrefersReducedMotionValue = &quot;on&quot;;
+    if (window.matchMedia(&quot;(prefers-reduced-motion)&quot;).matches)
+        document.getElementById(&quot;a&quot;).style.color = &quot;green&quot;;
+    if (window.matchMedia(&quot;(prefers-reduced-motion: reduce)&quot;).matches)
+        document.getElementById(&quot;b&quot;).style.color = &quot;green&quot;;
+
+    window.internals.settings.forcedPrefersReducedMotionValue = &quot;off&quot;;
+    if (!window.matchMedia(&quot;(prefers-reduced-motion)&quot;).matches)
+        document.getElementById(&quot;c&quot;).style.color = &quot;green&quot;;
+    if (window.matchMedia(&quot;(prefers-reduced-motion: default)&quot;).matches)
+        document.getElementById(&quot;d&quot;).style.color = &quot;green&quot;;
+}, false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;p id=&quot;a&quot;&gt;This text should be green.&lt;/p&gt;
+  &lt;p id=&quot;b&quot;&gt;This text should be green.&lt;/p&gt;
+  &lt;p id=&quot;c&quot;&gt;This text should be green.&lt;/p&gt;
+  &lt;p id=&quot;d&quot;&gt;This text should be green.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion-forced-value.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Revision
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsfastmediamqprefersreducedmotionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion.html (0 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-prefers-reduced-motion.html                                (rev 0)
+++ trunk/LayoutTests/fast/media/mq-prefers-reduced-motion.html        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;CSS4 media query test: prefers-reduced-motion.&lt;/title&gt;
+&lt;style type=&quot;text/css&quot;&gt;
+#a { color: black; }
+#b { color: black; }
+#c { color: black; }
+#d { color: black; }
+
+@media (prefers-reduced-motion) {
+#a { color: green; }
+}
+
+@media (prefers-reduced-motion: reduce) {
+#b { color: green; }
+}
+
+@media (prefers-reduced-motion: default) {
+#d { color: green; }
+}
+&lt;/style&gt;
+&lt;script&gt;
+window.addEventListener(&quot;load&quot;, function () {
+    if (window.matchMedia(&quot;(prefers-reduced-motion)&quot;).matches)
+        document.getElementById(&quot;c&quot;).style.color = &quot;green&quot;;
+}, false);
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+  &lt;p id=&quot;a&quot;&gt;This text should be green if the user requested reduced motion. Black otherwise.&lt;/p&gt;
+  &lt;p id=&quot;b&quot;&gt;This text should be green if the user requested reduced motion. Black otherwise.&lt;/p&gt;
+  &lt;p id=&quot;c&quot;&gt;This text should be green if the user requested reduced motion. Black otherwise.&lt;/p&gt;
+  &lt;p id=&quot;d&quot;&gt;This text should be green if the user has not requested reduced motion. Black otherwise.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/media/mq-prefers-reduced-motion.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+native
</ins><span class="cx">\ No newline at end of property
</span><a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<ins>+Date Revision
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/ChangeLog        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -1,3 +1,63 @@
</span><ins>+2016-10-11  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Implement prefers-reduced-motion media query
+        https://bugs.webkit.org/show_bug.cgi?id=163250
+        &lt;rdar://problem/28704129&gt;
+
+        Reviewed by Simon Fraser.
+
+        Implement the prefers-reduced-motion media query, as
+        described in https://github.com/w3c/csswg-drafts/issues/442.
+
+        Tests: fast/media/mq-prefers-reduced-motion-forced-value.html
+               fast/media/mq-prefers-reduced-motion.html
+
+        * Configurations/WebCoreTestSupport.xcconfig: Link against AppKit and UIKit.
+
+        * css/CSSValueKeywords.in: New keyword for &quot;reduce&quot;.
+
+        * css/MediaFeatureNames.h: Add prefers-reduced-motion.
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::prefersReducedMotionEvaluate):
+        * css/MediaQueryExp.cpp:
+        (WebCore::featureWithValidIdent):
+        (WebCore::isFeatureValidWithoutValue):
+
+        * platform/Theme.h: New API to detect the system accessibility settings.
+        (WebCore::Theme::userPrefersReducedMotion):
+        * platform/ios/ThemeIOS.h:
+        * platform/ios/ThemeIOS.mm:
+        (WebCore::ThemeIOS::userPrefersReducedMotion):
+        * platform/mac/ThemeMac.h:
+        * platform/mac/ThemeMac.mm:
+        (WebCore::ThemeMac::userPrefersReducedMotion):
+
+        * testing/Internals.cpp: Expose the same API to internals, so that
+        a test can examine the value too.
+        (WebCore::Internals::userPrefersReducedMotion):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+        * testing/Internals.mm:
+        (WebCore::Internals::userPrefersReducedMotion):
+
+        * page/Settings.h: New setting to override the system value...
+        * page/Settings.in:
+
+        * testing/InternalSettings.cpp: ... plumbed through internals.
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::Backup::restoreTo):
+        (WebCore::InternalSettings::forcedPrefersReducedMotionValue):
+        (WebCore::InternalSettings::setForcedPrefersReducedMotionValue):
+        * testing/InternalSettings.h:
+        * testing/InternalSettings.idl:
+        * testing/Internals.cpp:
+        (WebCore::Internals::userPrefersReducedMotion):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+        * testing/Internals.mm:
+        (WebCore::Internals::userPrefersReducedMotion):
+
+
</ins><span class="cx"> 2016-10-10  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Annotate DOM API with CEReactions
</span></span></pre></div>
<a id="trunkSourceWebCoreConfigurationsWebCoreTestSupportxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/Configurations/WebCoreTestSupport.xcconfig        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> EXPORTED_SYMBOLS_FILE = ;
</span><span class="cx"> GCC_SYMBOLS_PRIVATE_EXTERN = YES;
</span><span class="cx"> OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS);
</span><del>-OTHER_LDFLAGS[sdk=iphoneos*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy;
-OTHER_LDFLAGS[sdk=iphonesimulator*] = $(ASAN_OTHER_LDFLAGS) -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy;
</del><ins>+OTHER_LDFLAGS[sdk=macos*] = $(ASAN_OTHER_LDFLAGS) -framework AppKit;
+OTHER_LDFLAGS[sdk=iphoneos*] = $(ASAN_OTHER_LDFLAGS) -framework UIKit -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy;
+OTHER_LDFLAGS[sdk=iphonesimulator*] = $(ASAN_OTHER_LDFLAGS) -framework UIKit -lAccessibility -F$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/PhonyWebKitLegacy;
</ins><span class="cx"> SECT_ORDER_FLAGS = ;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -1304,6 +1304,9 @@
</span><span class="cx"> p3
</span><span class="cx"> rec2020
</span><span class="cx"> 
</span><ins>+// prefers-reduced-motion
+reduce
+
</ins><span class="cx"> #if defined(ENABLE_CSS_GRID_LAYOUT) &amp;&amp; ENABLE_CSS_GRID_LAYOUT
</span><span class="cx"> // auto-repeat
</span><span class="cx"> auto-fill
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaFeatureNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaFeatureNames.h (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaFeatureNames.h        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/css/MediaFeatureNames.h        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -69,6 +69,7 @@
</span><span class="cx">     macro(monochrome, &quot;monochrome&quot;) \
</span><span class="cx">     macro(orientation, &quot;orientation&quot;) \
</span><span class="cx">     macro(pointer, &quot;pointer&quot;) \
</span><ins>+    macro(prefersReducedMotion, &quot;prefers-reduced-motion&quot;) \
</ins><span class="cx">     macro(resolution, &quot;resolution&quot;) \
</span><span class="cx">     macro(transform2d, &quot;-webkit-transform-2d&quot;) \
</span><span class="cx">     macro(transform3d, &quot;-webkit-transform-3d&quot;) \
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryEvaluator.cpp (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include &quot;Screen.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><ins>+#include &quot;Theme.h&quot;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(3D_TRANSFORMS)
</span><span class="lines">@@ -655,6 +656,25 @@
</span><span class="cx">     return pointerEvaluate(value, cssToLengthConversionData, frame, prefix);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool prefersReducedMotionEvaluate(CSSValue* value, const CSSToLengthConversionData&amp;, Frame&amp; frame, MediaFeaturePrefix)
+{
+#if USE(NEW_THEME)
+    bool userPrefersReducedMotion = platformTheme()-&gt;userPrefersReducedMotion();
+#else
+    bool userPrefersReducedMotion = false;
+#endif
+
+    if (frame.settings().forcedPrefersReducedMotionValue() == Settings::ForcedPrefersReducedMotionValue::On)
+        userPrefersReducedMotion = true;
+    else if (frame.settings().forcedPrefersReducedMotionValue() == Settings::ForcedPrefersReducedMotionValue::Off)
+        userPrefersReducedMotion = false;
+
+    if (!value)
+        return userPrefersReducedMotion;
+
+    return downcast&lt;CSSPrimitiveValue&gt;(*value).getValueID() == (userPrefersReducedMotion ? CSSValueReduce : CSSValueDefault);
+}
+
</ins><span class="cx"> // Use this function instead of calling add directly to avoid inlining.
</span><span class="cx"> static void add(MediaQueryFunctionMap&amp; map, AtomicStringImpl* key, MediaQueryFunction value)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryExpcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryExp.cpp (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryExp.cpp        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/css/MediaQueryExp.cpp        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -50,9 +50,10 @@
</span><span class="cx">     || mediaFeature == MediaFeatureNames::anyPointer
</span><span class="cx">     || mediaFeature == MediaFeatureNames::hover
</span><span class="cx">     || mediaFeature == MediaFeatureNames::invertedColors
</span><del>-    || mediaFeature == MediaFeatureNames::pointer;
</del><ins>+    || mediaFeature == MediaFeatureNames::pointer
+    || mediaFeature == MediaFeatureNames::prefersReducedMotion;
</ins><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> static inline bool featureWithValidDensity(const String&amp; mediaFeature, const CSSParserToken&amp; token)
</span><span class="cx"> {
</span><span class="cx">     if ((token.unitType() != CSSPrimitiveValue::UnitTypes::CSS_DPPX &amp;&amp; token.unitType() != CSSPrimitiveValue::UnitTypes::CSS_DPI &amp;&amp; token.unitType() != CSSPrimitiveValue::UnitTypes::CSS_DPCM) || token.numericValue() &lt;= 0)
</span><span class="lines">@@ -228,6 +229,7 @@
</span><span class="cx">         || mediaFeature == MediaFeatureNames::viewMode
</span><span class="cx"> #endif
</span><span class="cx">         || mediaFeature == MediaFeatureNames::pointer
</span><ins>+        || mediaFeature == MediaFeatureNames::prefersReducedMotion
</ins><span class="cx">         || mediaFeature == MediaFeatureNames::devicePixelRatio
</span><span class="cx">         || mediaFeature == MediaFeatureNames::resolution
</span><span class="cx">         || mediaFeature == MediaFeatureNames::videoPlayableInline;
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.h (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.h        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/page/Settings.h        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -98,6 +98,9 @@
</span><span class="cx"> 
</span><span class="cx">     void pageDestroyed() { m_page = nullptr; }
</span><span class="cx"> 
</span><ins>+    enum class ForcedPrefersReducedMotionValue { System, On, Off };
+    static const Settings::ForcedPrefersReducedMotionValue defaultForcedPrefersReducedMotionValue = ForcedPrefersReducedMotionValue::System;
+
</ins><span class="cx">     WEBCORE_EXPORT void setStandardFontFamily(const AtomicString&amp;, UScriptCode = USCRIPT_COMMON);
</span><span class="cx">     WEBCORE_EXPORT const AtomicString&amp; standardFontFamily(UScriptCode = USCRIPT_COMMON) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/page/Settings.in        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -283,3 +283,5 @@
</span><span class="cx"> 
</span><span class="cx"> quickTimePluginReplacementEnabled initial=defaultQuickTimePluginReplacementEnabled
</span><span class="cx"> youTubeFlashPluginReplacementEnabled initial=defaultYouTubeFlashPluginReplacementEnabled
</span><ins>+
+forcedPrefersReducedMotionValue type=ForcedPrefersReducedMotionValue, initial=defaultForcedPrefersReducedMotionValue
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformThemeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Theme.h (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Theme.h        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/platform/Theme.h        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -110,6 +110,8 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void drawNamedImage(const String&amp;, GraphicsContext&amp;, const FloatRect&amp;) const;
</span><span class="cx"> 
</span><ins>+    virtual bool userPrefersReducedMotion() const { return false; }
+
</ins><span class="cx">     // This method is called once, from RenderTheme::adjustDefaultStyleSheet(), to let each platform adjust
</span><span class="cx">     // the default CSS rules in html.css.
</span><span class="cx">     static String defaultStyleSheet();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosThemeIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/ThemeIOS.h (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ThemeIOS.h        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/platform/ios/ThemeIOS.h        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -34,6 +34,8 @@
</span><span class="cx"> public:
</span><span class="cx">     ThemeIOS() { }
</span><span class="cx">     virtual ~ThemeIOS() { }
</span><ins>+
+    bool userPrefersReducedMotion() const override;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/ThemeIOS.mm (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/ThemeIOS.mm        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/platform/ios/ThemeIOS.mm        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -28,9 +28,13 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;GraphicsContext.h&quot;
</span><span class="cx"> #import &quot;ScrollView.h&quot;
</span><ins>+#import &quot;SoftLinking.h&quot;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><ins>+SOFT_LINK_FRAMEWORK(UIKit)
+SOFT_LINK(UIKit, UIAccessibilityIsReduceMotionEnabled, BOOL, (void), ())
+
</ins><span class="cx"> using namespace std;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -43,4 +47,9 @@
</span><span class="cx">     return &amp;themeIOS.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ThemeIOS::userPrefersReducedMotion() const
+{
+    return UIAccessibilityIsReduceMotionEnabled();
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacThemeMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ThemeMac.h (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ThemeMac.h        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/platform/mac/ThemeMac.h        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx">     void paint(ControlPart, ControlStates&amp;, GraphicsContext&amp;, const FloatRect&amp;, float zoomFactor, ScrollView*, float deviceScaleFactor, float pageScaleFactor) override;
</span><span class="cx">     void inflateControlPaintRect(ControlPart, const ControlStates&amp;, FloatRect&amp;, float zoomFactor) const override;
</span><span class="cx"> 
</span><ins>+    bool userPrefersReducedMotion() const override;
+
</ins><span class="cx">     // FIXME: Once RenderThemeMac is converted over to use Theme then this can be internal to ThemeMac.
</span><span class="cx">     static NSView* ensuredView(ScrollView*, const ControlStates&amp;, bool useUnparentedView = false);
</span><span class="cx">     static void setFocusRingClipRect(const FloatRect&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/ThemeMac.mm (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/ThemeMac.mm        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/platform/mac/ThemeMac.mm        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -870,4 +870,13 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ThemeMac::userPrefersReducedMotion() const
+{
+#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    return [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion];
+#else
+    return false;
+#endif
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.cpp        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -115,6 +115,7 @@
</span><span class="cx">     , m_userInterfaceDirectionPolicy(settings.userInterfaceDirectionPolicy())
</span><span class="cx">     , m_systemLayoutDirection(settings.systemLayoutDirection())
</span><span class="cx">     , m_pdfImageCachingPolicy(settings.pdfImageCachingPolicy())
</span><ins>+    , m_forcedPrefersReducedMotionValue(settings.forcedPrefersReducedMotionValue())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -194,6 +195,7 @@
</span><span class="cx">     settings.setUserInterfaceDirectionPolicy(m_userInterfaceDirectionPolicy);
</span><span class="cx">     settings.setSystemLayoutDirection(m_systemLayoutDirection);
</span><span class="cx">     settings.setPdfImageCachingPolicy(m_pdfImageCachingPolicy);
</span><ins>+    settings.setForcedPrefersReducedMotionValue(m_forcedPrefersReducedMotionValue);
</ins><span class="cx">     Settings::setAllowsAnySSLCertificate(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -679,6 +681,33 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+InternalSettings::ForcedPrefersReducedMotionValue InternalSettings::forcedPrefersReducedMotionValue() const
+{
+    switch (settings()-&gt;forcedPrefersReducedMotionValue()) {
+    case Settings::ForcedPrefersReducedMotionValue::System:
+        return InternalSettings::ForcedPrefersReducedMotionValue::System;
+    case Settings::ForcedPrefersReducedMotionValue::On:
+        return InternalSettings::ForcedPrefersReducedMotionValue::On;
+    case Settings::ForcedPrefersReducedMotionValue::Off:
+        return InternalSettings::ForcedPrefersReducedMotionValue::Off;
+    }
+}
+
+void InternalSettings::setForcedPrefersReducedMotionValue(InternalSettings::ForcedPrefersReducedMotionValue value)
+{
+    switch (value) {
+    case InternalSettings::ForcedPrefersReducedMotionValue::System:
+        settings()-&gt;setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::System);
+        break;
+    case InternalSettings::ForcedPrefersReducedMotionValue::On:
+        settings()-&gt;setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::On);
+        break;
+    case InternalSettings::ForcedPrefersReducedMotionValue::Off:
+        settings()-&gt;setForcedPrefersReducedMotionValue(Settings::ForcedPrefersReducedMotionValue::Off);
+        break;
+    }
+}
+
</ins><span class="cx"> // If you add to this list, make sure that you update the Backup class for test reproducability!
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.h (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.h        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/testing/InternalSettings.h        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -115,6 +115,7 @@
</span><span class="cx">         UserInterfaceDirectionPolicy m_userInterfaceDirectionPolicy;
</span><span class="cx">         TextDirection m_systemLayoutDirection;
</span><span class="cx">         PDFImageCachingPolicy m_pdfImageCachingPolicy;
</span><ins>+        Settings::ForcedPrefersReducedMotionValue m_forcedPrefersReducedMotionValue;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static Ref&lt;InternalSettings&gt; create(Page* page)
</span><span class="lines">@@ -174,6 +175,10 @@
</span><span class="cx">     bool variationFontsEnabled(ExceptionCode&amp;);
</span><span class="cx">     void setVariationFontsEnabled(bool, ExceptionCode&amp;);
</span><span class="cx"> 
</span><ins>+    enum class ForcedPrefersReducedMotionValue { System, On, Off };
+    ForcedPrefersReducedMotionValue forcedPrefersReducedMotionValue() const;
+    void setForcedPrefersReducedMotionValue(ForcedPrefersReducedMotionValue);
+
</ins><span class="cx">     static void setAllowsAnySSLCertificate(bool);
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.idl (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.idl        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/testing/InternalSettings.idl        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx">  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><ins>+enum ForcedPrefersReducedMotionValue { &quot;system&quot;, &quot;on&quot;, &quot;off&quot; };
+
</ins><span class="cx"> [
</span><span class="cx">     NoInterfaceObject,
</span><span class="cx">     JSGenerateToJSObject,
</span><span class="lines">@@ -89,6 +91,8 @@
</span><span class="cx">     [MayThrowLegacyException] boolean variationFontsEnabled();
</span><span class="cx">     [MayThrowLegacyException] void setVariationFontsEnabled(boolean enabled);
</span><span class="cx"> 
</span><ins>+    attribute ForcedPrefersReducedMotionValue forcedPrefersReducedMotionValue;
+
</ins><span class="cx">     void setInputEventsEnabled(boolean enabled);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -3378,4 +3378,11 @@
</span><span class="cx">     page-&gt;setUserInterfaceLayoutDirection(userInterfaceLayoutDirection == UserInterfaceLayoutDirection::LTR ? WebCore::UserInterfaceLayoutDirection::LTR : WebCore::UserInterfaceLayoutDirection::RTL);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if !PLATFORM(COCOA)
+bool Internals::userPrefersReducedMotion() const
+{
+    return false;
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/testing/Internals.h        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -495,6 +495,8 @@
</span><span class="cx">     enum class UserInterfaceLayoutDirection { LTR, RTL };
</span><span class="cx">     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection);
</span><span class="cx"> 
</span><ins>+    bool userPrefersReducedMotion() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit Internals(Document&amp;);
</span><span class="cx">     Document* contextDocument() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -466,4 +466,6 @@
</span><span class="cx">     GCObservation observeGC(any observed);
</span><span class="cx"> 
</span><span class="cx">     void setUserInterfaceLayoutDirection(UserInterfaceLayoutDirection userInterfaceLayoutDirection);
</span><ins>+
+    boolean userPrefersReducedMotion();
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.mm (207172 => 207173)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.mm        2016-10-11 22:37:06 UTC (rev 207172)
+++ trunk/Source/WebCore/testing/Internals.mm        2016-10-11 22:45:22 UTC (rev 207173)
</span><span class="lines">@@ -32,6 +32,10 @@
</span><span class="cx"> #include &quot;EditorClient.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#import &lt;UIKit/UIKit.h&gt;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> String Internals::userVisibleString(const DOMURL&amp; url)
</span><span class="lines">@@ -39,4 +43,17 @@
</span><span class="cx">     return contextDocument()-&gt;frame()-&gt;editor().client()-&gt;userVisibleString(url.href());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(COCOA)
+bool Internals::userPrefersReducedMotion() const
+{
+#if PLATFORM(IOS)
+    return UIAccessibilityIsReduceMotionEnabled();
+#elif PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101200
+    return [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldReduceMotion];
+#else
+    return false;
+#endif
</ins><span class="cx"> }
</span><ins>+#endif
+
+}
</ins></span></pre>
</div>
</div>

</body>
</html>