<!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>[179055] 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/179055">179055</a></dd>
<dt>Author</dt> <dd>benjamin@webkit.org</dd>
<dt>Date</dt> <dd>2015-01-23 20:15:56 -0800 (Fri, 23 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add pointer/hover media queries
https://bugs.webkit.org/show_bug.cgi?id=134822
Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-01-23
Reviewed by Antti Koivisto.
Source/WebCore:
Media Queries Level 4 introduces two types of Interaction Media Features:
"pointer" and "hover". Those media features are useful for adapting the design
to the type of input:
http://dev.w3.org/csswg/mediaqueries-4/#mf-interaction
This implementation is trivial: just #ifdef the return value depending on
the support for touch events.
In the future we should move that to a client interface but let's start easy
for now.
Tests: fast/media/mq-any-hover-cssom.html
fast/media/mq-any-hover-invalid.html
fast/media/mq-any-hover-matchMedia.html
fast/media/mq-any-hover-styling.html
fast/media/mq-any-pointer-cssom.html
fast/media/mq-any-pointer-invalid.html
fast/media/mq-any-pointer-matchMedia.html
fast/media/mq-any-pointer-styling.html
fast/media/mq-hover-cssom.html
fast/media/mq-hover-invalid.html
fast/media/mq-hover-matchMedia.html
fast/media/mq-hover-styling.html
fast/media/mq-pointer-cssom.html
fast/media/mq-pointer-invalid.html
fast/media/mq-pointer-matchMedia.html
fast/media/mq-pointer-styling.html
* css/CSSValueKeywords.in:
* css/MediaFeatureNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::hoverMediaFeatureEval):
(WebCore::any_hoverMediaFeatureEval):
(WebCore::pointerMediaFeatureEval):
(WebCore::any_pointerMediaFeatureEval):
(WebCore::leastCapablePrimaryPointerDeviceType): Deleted.
* css/MediaQueryExp.cpp:
(WebCore::featureWithCSSValueID):
(WebCore::featureWithZeroOrOne):
(WebCore::featureWithoutValue):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
(WebCore::EventHandler::fakeMouseMoveEventTimerFired):
* page/Settings.in:
LayoutTests:
* fast/media/mq-any-hover-cssom-expected.txt: Added.
* fast/media/mq-any-hover-cssom.html: Added.
* fast/media/mq-any-hover-invalid-expected.txt: Added.
* fast/media/mq-any-hover-invalid.html: Added.
* fast/media/mq-any-hover-matchMedia-expected.txt: Added.
* fast/media/mq-any-hover-matchMedia.html: Added.
* fast/media/mq-any-hover-styling-expected.txt: Added.
* fast/media/mq-any-hover-styling.html: Added.
* fast/media/mq-any-pointer-cssom-expected.txt: Added.
* fast/media/mq-any-pointer-cssom.html: Added.
* fast/media/mq-any-pointer-invalid-expected.txt: Added.
* fast/media/mq-any-pointer-invalid.html: Added.
* fast/media/mq-any-pointer-matchMedia-expected.txt: Added.
* fast/media/mq-any-pointer-matchMedia.html: Added.
* fast/media/mq-any-pointer-styling-expected.txt: Added.
* fast/media/mq-any-pointer-styling.html: Added.
* fast/media/mq-hover-cssom-expected.txt: Added.
* fast/media/mq-hover-cssom.html: Added.
* fast/media/mq-hover-invalid-expected.txt: Added.
* fast/media/mq-hover-invalid.html: Added.
* fast/media/mq-hover-matchMedia-expected.txt: Added.
* fast/media/mq-hover-matchMedia.html: Added.
* fast/media/mq-hover-styling-expected.txt: Added.
* fast/media/mq-hover-styling.html: Added.
* fast/media/mq-pointer-cssom-expected.txt: Added.
* fast/media/mq-pointer-cssom.html: Added.
* fast/media/mq-pointer-expected.txt:
* fast/media/mq-pointer-invalid-expected.txt: Added.
* fast/media/mq-pointer-invalid.html: Added.
* fast/media/mq-pointer-matchMedia-expected.txt: Added.
* fast/media/mq-pointer-matchMedia.html: Added.
* fast/media/mq-pointer-styling-expected.txt: Added.
* fast/media/mq-pointer-styling.html: Added.
* fast/media/mq-pointer.html:
* platform/ios-simulator/fast/media/mq-any-hover-matchMedia-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-any-hover-styling-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-any-pointer-matchMedia-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-any-pointer-styling-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-hover-matchMedia-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-hover-styling-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-pointer-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-pointer-matchMedia-expected.txt: Added.
* platform/ios-simulator/fast/media/mq-pointer-styling-expected.txt: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointerexpectedtxt">trunk/LayoutTests/fast/media/mq-pointer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointerhtml">trunk/LayoutTests/fast/media/mq-pointer.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingsin">trunk/Source/WebCore/page/Settings.in</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmediamqanyhovercssomexpectedtxt">trunk/LayoutTests/fast/media/mq-any-hover-cssom-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanyhovercssomhtml">trunk/LayoutTests/fast/media/mq-any-hover-cssom.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanyhoverinvalidexpectedtxt">trunk/LayoutTests/fast/media/mq-any-hover-invalid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanyhoverinvalidhtml">trunk/LayoutTests/fast/media/mq-any-hover-invalid.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanyhovermatchMediaexpectedtxt">trunk/LayoutTests/fast/media/mq-any-hover-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanyhovermatchMediahtml">trunk/LayoutTests/fast/media/mq-any-hover-matchMedia.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanyhoverstylingexpectedtxt">trunk/LayoutTests/fast/media/mq-any-hover-styling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanyhoverstylinghtml">trunk/LayoutTests/fast/media/mq-any-hover-styling.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointercssomexpectedtxt">trunk/LayoutTests/fast/media/mq-any-pointer-cssom-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointercssomhtml">trunk/LayoutTests/fast/media/mq-any-pointer-cssom.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointerinvalidexpectedtxt">trunk/LayoutTests/fast/media/mq-any-pointer-invalid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointerinvalidhtml">trunk/LayoutTests/fast/media/mq-any-pointer-invalid.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointermatchMediaexpectedtxt">trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointermatchMediahtml">trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointerstylingexpectedtxt">trunk/LayoutTests/fast/media/mq-any-pointer-styling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqanypointerstylinghtml">trunk/LayoutTests/fast/media/mq-any-pointer-styling.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhovercssomexpectedtxt">trunk/LayoutTests/fast/media/mq-hover-cssom-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhovercssomhtml">trunk/LayoutTests/fast/media/mq-hover-cssom.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhoverinvalidexpectedtxt">trunk/LayoutTests/fast/media/mq-hover-invalid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhoverinvalidhtml">trunk/LayoutTests/fast/media/mq-hover-invalid.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhovermatchMediaexpectedtxt">trunk/LayoutTests/fast/media/mq-hover-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhovermatchMediahtml">trunk/LayoutTests/fast/media/mq-hover-matchMedia.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhoverstylingexpectedtxt">trunk/LayoutTests/fast/media/mq-hover-styling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqhoverstylinghtml">trunk/LayoutTests/fast/media/mq-hover-styling.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointercssomexpectedtxt">trunk/LayoutTests/fast/media/mq-pointer-cssom-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointercssomhtml">trunk/LayoutTests/fast/media/mq-pointer-cssom.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointerinvalidexpectedtxt">trunk/LayoutTests/fast/media/mq-pointer-invalid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointerinvalidhtml">trunk/LayoutTests/fast/media/mq-pointer-invalid.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointermatchMediaexpectedtxt">trunk/LayoutTests/fast/media/mq-pointer-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointermatchMediahtml">trunk/LayoutTests/fast/media/mq-pointer-matchMedia.html</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointerstylingexpectedtxt">trunk/LayoutTests/fast/media/mq-pointer-styling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmediamqpointerstylinghtml">trunk/LayoutTests/fast/media/mq-pointer-styling.html</a></li>
<li>trunk/LayoutTests/platform/ios-simulator/fast/media/</li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqanyhovermatchMediaexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqanyhoverstylingexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-styling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqanypointermatchMediaexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqanypointerstylingexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-styling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqhovermatchMediaexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqhoverstylingexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-styling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqpointerexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqpointermatchMediaexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-matchMedia-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorfastmediamqpointerstylingexpectedtxt">trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-styling-expected.txt</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/LayoutTests/ChangeLog        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2015-01-23 Benjamin Poulain <bpoulain@apple.com>
+
+ Add pointer/hover media queries
+ https://bugs.webkit.org/show_bug.cgi?id=134822
+
+ Reviewed by Antti Koivisto.
+
+ * fast/media/mq-any-hover-cssom-expected.txt: Added.
+ * fast/media/mq-any-hover-cssom.html: Added.
+ * fast/media/mq-any-hover-invalid-expected.txt: Added.
+ * fast/media/mq-any-hover-invalid.html: Added.
+ * fast/media/mq-any-hover-matchMedia-expected.txt: Added.
+ * fast/media/mq-any-hover-matchMedia.html: Added.
+ * fast/media/mq-any-hover-styling-expected.txt: Added.
+ * fast/media/mq-any-hover-styling.html: Added.
+ * fast/media/mq-any-pointer-cssom-expected.txt: Added.
+ * fast/media/mq-any-pointer-cssom.html: Added.
+ * fast/media/mq-any-pointer-invalid-expected.txt: Added.
+ * fast/media/mq-any-pointer-invalid.html: Added.
+ * fast/media/mq-any-pointer-matchMedia-expected.txt: Added.
+ * fast/media/mq-any-pointer-matchMedia.html: Added.
+ * fast/media/mq-any-pointer-styling-expected.txt: Added.
+ * fast/media/mq-any-pointer-styling.html: Added.
+ * fast/media/mq-hover-cssom-expected.txt: Added.
+ * fast/media/mq-hover-cssom.html: Added.
+ * fast/media/mq-hover-invalid-expected.txt: Added.
+ * fast/media/mq-hover-invalid.html: Added.
+ * fast/media/mq-hover-matchMedia-expected.txt: Added.
+ * fast/media/mq-hover-matchMedia.html: Added.
+ * fast/media/mq-hover-styling-expected.txt: Added.
+ * fast/media/mq-hover-styling.html: Added.
+ * fast/media/mq-pointer-cssom-expected.txt: Added.
+ * fast/media/mq-pointer-cssom.html: Added.
+ * fast/media/mq-pointer-expected.txt:
+ * fast/media/mq-pointer-invalid-expected.txt: Added.
+ * fast/media/mq-pointer-invalid.html: Added.
+ * fast/media/mq-pointer-matchMedia-expected.txt: Added.
+ * fast/media/mq-pointer-matchMedia.html: Added.
+ * fast/media/mq-pointer-styling-expected.txt: Added.
+ * fast/media/mq-pointer-styling.html: Added.
+ * fast/media/mq-pointer.html:
+ * platform/ios-simulator/fast/media/mq-any-hover-matchMedia-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-any-hover-styling-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-any-pointer-matchMedia-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-any-pointer-styling-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-hover-matchMedia-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-hover-styling-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-pointer-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-pointer-matchMedia-expected.txt: Added.
+ * platform/ios-simulator/fast/media/mq-pointer-styling-expected.txt: Added.
+
</ins><span class="cx"> 2015-01-23 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r179051.
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhovercssomexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-cssom-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-cssom-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-cssom-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test the CSSOM serialization of the any-hover media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: on-demand)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: on-demand)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-hover: hover)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhovercssomhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-cssom.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-cssom.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-cssom.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test the CSSOM serialization of the any-hover media feature.")
+
+ var testCases = [
+ // Case.
+ ["(any-hover)", "(any-hover)"],
+ ["( any-hover)", "(any-hover)"],
+ ["(any-hover )", "(any-hover)"],
+ ["( any-hover )", "(any-hover)"],
+ ["(any-hover: hover)", "(any-hover: hover)"],
+ ["(any-hover: Hover)", "(any-hover: hover)"],
+ ["(any-hover: HOVER)", "(any-hover: hover)"],
+ ["(Any-Hover: hover)", "(any-hover: hover)"],
+ ["(ANY-HOVER: hover)", "(any-hover: hover)"],
+ ["(Any-Hover: Hover)", "(any-hover: hover)"],
+ ["(any-hover: ON-DEMAND)", "(any-hover: on-demand)"],
+ ["(Any-Hover: On-demand)", "(any-hover: on-demand)"],
+ ["(any-hover: NONE)", "(any-hover: none)"],
+ ["(Any-Hover: None)", "(any-hover: none)"],
+
+ // Spacing.
+ ["(any-hover:hover)", "(any-hover: hover)"],
+ ["(any-hover: hover)", "(any-hover: hover)"],
+ ["(any-hover :hover)", "(any-hover: hover)"],
+ ["(any-hover : hover)", "(any-hover: hover)"],
+ ["( any-hover : hover )", "(any-hover: hover)"],
+ ["(any-hover\t:\thover)", "(any-hover: hover)"],
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ targetStyle.innerText = "@media " + testCase[0] + " { }";
+ shouldBeEqualToString("document.styleSheets[1].cssRules[0].media.mediaText", testCase[1]);
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhoverinvalidexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-invalid-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-invalid-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-invalid-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test invalid input with the any-hover media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.matchMedia("(any-hover:)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-hover: )").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-hover: WebKit)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-hover: fine)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-hover: portrait)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-hover: \"None\")").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-hover: 'None')").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhoverinvalidhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-invalid.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-invalid.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-invalid.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test invalid input with the any-hover media feature.")
+
+ var testCases = [
+ "any-hover:",
+ "any-hover: ",
+ "any-hover: WebKit",
+ "any-hover: fine",
+ "any-hover: portrait",
+ "any-hover: \\\"None\\\"",
+ "any-hover: 'None'",
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ var testString = 'window.matchMedia("(' + testCase + ')").matches';
+ shouldBeFalse('window.matchMedia("(' + testCase + ')").matches');
+
+ targetStyle.innerText = "@media " + testCase + " { }";
+ shouldBe("document.styleSheets[1].cssRules[0].media.length", "0");
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhovermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the any-hover media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(any-hover)").matches = true
+window.matchMedia("(any-hover: hover)").matches = true
+window.matchMedia("(any-hover: on-demand)").matches = false
+window.matchMedia("(any-hover: none)").matches = false
+window.matchMedia("(any-hover: Hover)").matches = true
+window.matchMedia("(any-hover: On-demand)").matches = false
+window.matchMedia("(any-hover: None)").matches = false
+window.matchMedia("(Any-Hover: hover)").matches = true
+window.matchMedia("(Any-Hover: on-demand)").matches = false
+window.matchMedia("(Any-Hover: none)").matches = false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhovermatchMediahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-matchMedia.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-matchMedia.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-matchMedia.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+ description("Test the any-hover media feature with machMedia.")
+
+ function testHoverCondition(condition) {
+ var testString = 'window.matchMedia("(' + condition + ')").matches';
+ debug(testString + " = " + eval(testString));
+ }
+
+ testHoverCondition("any-hover");
+
+ testHoverCondition("any-hover: hover");
+ testHoverCondition("any-hover: on-demand");
+ testHoverCondition("any-hover: none");
+
+ testHoverCondition("any-hover: Hover");
+ testHoverCondition("any-hover: On-demand");
+ testHoverCondition("any-hover: None");
+
+ testHoverCondition("Any-Hover: hover");
+ testHoverCondition("Any-Hover: on-demand");
+ testHoverCondition("Any-Hover: none");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhoverstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the any-hover media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(0, 128, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 255)
+getComputedStyle(target)["width"] = 100px
+getComputedStyle(target)["height"] = 100px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanyhoverstylinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-hover-styling.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-hover-styling.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-hover-styling.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<div id="target"></div>
+<style>
+ #target {
+ color: red;
+ background-color: black;
+ width: 100px;
+ height: 100px;
+ display: none;
+ }
+ @media (any-hover) {
+ #target {
+ color: green;
+ }
+ }
+ @media (any-hover: hover) {
+ #target {
+ background-color: blue;
+ }
+ }
+ @media (any-hover: on-demand) {
+ #target {
+ width: 10px;
+ }
+ }
+ @media (any-hover: none) {
+ #target {
+ height: 10px;
+ }
+ }
+</style>
+
+<script>
+ description("Test the any-hover media feature to guard style rules.")
+
+ var target = document.getElementById('target');
+
+ function displayProperty(property) {
+ var testString = 'getComputedStyle(target)["' + property + '"]';
+ debug(testString + " = " + eval(testString));
+ }
+
+ displayProperty("color");
+ displayProperty("background-color");
+ displayProperty("width");
+ displayProperty("height");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointercssomexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-cssom-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-cssom-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-cssom-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test the CSSOM serialization of the any-pointer media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: coarse)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: coarse)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(any-pointer: fine)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointercssomhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-cssom.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-cssom.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-cssom.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test the CSSOM serialization of the any-pointer media feature.")
+
+ var testCases = [
+ // Case.
+ ["(any-pointer)", "(any-pointer)"],
+ ["( any-pointer)", "(any-pointer)"],
+ ["(any-pointer )", "(any-pointer)"],
+ ["( any-pointer )", "(any-pointer)"],
+ ["(any-pointer: fine)", "(any-pointer: fine)"],
+ ["(any-pointer: Fine)", "(any-pointer: fine)"],
+ ["(any-pointer: FINE)", "(any-pointer: fine)"],
+ ["(Any-Pointer: fine)", "(any-pointer: fine)"],
+ ["(ANY-POINTER: fine)", "(any-pointer: fine)"],
+ ["(Any-Pointer: Fine)", "(any-pointer: fine)"],
+ ["(any-pointer: COARSE)", "(any-pointer: coarse)"],
+ ["(Any-Pointer: Coarse)", "(any-pointer: coarse)"],
+ ["(any-pointer: NONE)", "(any-pointer: none)"],
+ ["(Any-Pointer: None)", "(any-pointer: none)"],
+
+ // Spacing.
+ ["(any-pointer:fine)", "(any-pointer: fine)"],
+ ["(any-pointer: fine)", "(any-pointer: fine)"],
+ ["(any-pointer :fine)", "(any-pointer: fine)"],
+ ["(any-pointer : fine)", "(any-pointer: fine)"],
+ ["( any-pointer : fine )", "(any-pointer: fine)"],
+ ["(any-pointer\t:\tfine)", "(any-pointer: fine)"],
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ targetStyle.innerText = "@media " + testCase[0] + " { }";
+ shouldBeEqualToString("document.styleSheets[1].cssRules[0].media.mediaText", testCase[1]);
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointerinvalidexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-invalid-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-invalid-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-invalid-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test invalid input with the any-pointer media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.matchMedia("(any-pointer:)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-pointer: )").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-pointer: WebKit)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-pointer: pointer)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-pointer: hover)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-pointer: portrait)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-pointer: \"None\")").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(any-pointer: 'None')").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointerinvalidhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-invalid.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-invalid.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-invalid.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test invalid input with the any-pointer media feature.")
+
+ var testCases = [
+ "any-pointer:",
+ "any-pointer: ",
+ "any-pointer: WebKit",
+ "any-pointer: pointer",
+ "any-pointer: hover",
+ "any-pointer: portrait",
+ "any-pointer: \\\"None\\\"",
+ "any-pointer: 'None'",
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ var testString = 'window.matchMedia("(' + testCase + ')").matches';
+ shouldBeFalse('window.matchMedia("(' + testCase + ')").matches');
+
+ targetStyle.innerText = "@media " + testCase + " { }";
+ shouldBe("document.styleSheets[1].cssRules[0].media.length", "0");
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the any-pointer media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(any-pointer)").matches = true
+window.matchMedia("(any-pointer: fine)").matches = true
+window.matchMedia("(any-pointer: coarse)").matches = false
+window.matchMedia("(any-pointer: none)").matches = false
+window.matchMedia("(any-pointer: Fine)").matches = true
+window.matchMedia("(any-pointer: Coarse)").matches = false
+window.matchMedia("(any-pointer: None)").matches = false
+window.matchMedia("(Any-Pointer: fine)").matches = true
+window.matchMedia("(Any-Pointer: coarse)").matches = false
+window.matchMedia("(Any-Pointer: none)").matches = false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointermatchMediahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+ description("Test the any-pointer media feature with machMedia.")
+
+ function testPointerCondition(condition) {
+ var testString = 'window.matchMedia("(' + condition + ')").matches';
+ debug(testString + " = " + eval(testString));
+ }
+
+ testPointerCondition("any-pointer");
+
+ testPointerCondition("any-pointer: fine");
+ testPointerCondition("any-pointer: coarse");
+ testPointerCondition("any-pointer: none");
+
+ testPointerCondition("any-pointer: Fine");
+ testPointerCondition("any-pointer: Coarse");
+ testPointerCondition("any-pointer: None");
+
+ testPointerCondition("Any-Pointer: fine");
+ testPointerCondition("Any-Pointer: coarse");
+ testPointerCondition("Any-Pointer: none");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointerstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the any-pointer media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(0, 128, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 255)
+getComputedStyle(target)["width"] = 100px
+getComputedStyle(target)["height"] = 100px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqanypointerstylinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-any-pointer-styling.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-any-pointer-styling.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-any-pointer-styling.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<div id="target"></div>
+<style>
+ #target {
+ color: red;
+ background-color: black;
+ width: 100px;
+ height: 100px;
+ display: none;
+ }
+ @media (any-pointer) {
+ #target {
+ color: green;
+ }
+ }
+ @media (any-pointer: fine) {
+ #target {
+ background-color: blue;
+ }
+ }
+ @media (any-pointer: coarse) {
+ #target {
+ width: 10px;
+ }
+ }
+ @media (any-pointer: none) {
+ #target {
+ height: 10px;
+ }
+ }
+</style>
+
+<script>
+ description("Test the any-pointer media feature to guard style rules.")
+
+ var target = document.getElementById('target');
+
+ function displayProperty(property) {
+ var testString = 'getComputedStyle(target)["' + property + '"]';
+ debug(testString + " = " + eval(testString));
+ }
+
+ displayProperty("color");
+ displayProperty("background-color");
+ displayProperty("width");
+ displayProperty("height");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhovercssomexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-cssom-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-cssom-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-cssom-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test the CSSOM serialization of the hover media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: on-demand)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: on-demand)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(hover: hover)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhovercssomhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-cssom.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-cssom.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-cssom.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test the CSSOM serialization of the hover media feature.")
+
+ var testCases = [
+ // Case.
+ ["(hover)", "(hover)"],
+ ["( hover)", "(hover)"],
+ ["(hover )", "(hover)"],
+ ["( hover )", "(hover)"],
+ ["(hover: hover)", "(hover: hover)"],
+ ["(hover: Hover)", "(hover: hover)"],
+ ["(hover: HOVER)", "(hover: hover)"],
+ ["(Hover: hover)", "(hover: hover)"],
+ ["(HOVER: hover)", "(hover: hover)"],
+ ["(Hover: Hover)", "(hover: hover)"],
+ ["(hover: ON-DEMAND)", "(hover: on-demand)"],
+ ["(Hover: On-demand)", "(hover: on-demand)"],
+ ["(hover: NONE)", "(hover: none)"],
+ ["(Hover: None)", "(hover: none)"],
+
+ // Spacing.
+ ["(hover:hover)", "(hover: hover)"],
+ ["(hover: hover)", "(hover: hover)"],
+ ["(hover :hover)", "(hover: hover)"],
+ ["(hover : hover)", "(hover: hover)"],
+ ["( hover : hover )", "(hover: hover)"],
+ ["(hover\t:\thover)", "(hover: hover)"],
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ targetStyle.innerText = "@media " + testCase[0] + " { }";
+ shouldBeEqualToString("document.styleSheets[1].cssRules[0].media.mediaText", testCase[1]);
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhoverinvalidexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-invalid-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-invalid-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-invalid-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Test invalid input with the hover media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.matchMedia("(hover:)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(hover: )").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(hover: WebKit)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(hover: fine)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(hover: portrait)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(hover: \"None\")").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(hover: 'None')").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhoverinvalidhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-invalid.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-invalid.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-invalid.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test invalid input with the hover media feature.")
+
+ var testCases = [
+ "hover:",
+ "hover: ",
+ "hover: WebKit",
+ "hover: fine",
+ "hover: portrait",
+ "hover: \\\"None\\\"",
+ "hover: 'None'",
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ var testString = 'window.matchMedia("(' + testCase + ')").matches';
+ shouldBeFalse('window.matchMedia("(' + testCase + ')").matches');
+
+ targetStyle.innerText = "@media " + testCase + " { }";
+ shouldBe("document.styleSheets[1].cssRules[0].media.length", "0");
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhovermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the hover media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(hover)").matches = true
+window.matchMedia("(hover: hover)").matches = true
+window.matchMedia("(hover: on-demand)").matches = false
+window.matchMedia("(hover: none)").matches = false
+window.matchMedia("(hover: Hover)").matches = true
+window.matchMedia("(hover: On-demand)").matches = false
+window.matchMedia("(hover: None)").matches = false
+window.matchMedia("(Hover: hover)").matches = true
+window.matchMedia("(Hover: on-demand)").matches = false
+window.matchMedia("(Hover: none)").matches = false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhovermatchMediahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-matchMedia.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-matchMedia.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-matchMedia.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+ description("Test the hover media feature with machMedia.")
+
+ function testHoverCondition(condition) {
+ var testString = 'window.matchMedia("(' + condition + ')").matches';
+ debug(testString + " = " + eval(testString));
+ }
+
+ testHoverCondition("hover");
+
+ testHoverCondition("hover: hover");
+ testHoverCondition("hover: on-demand");
+ testHoverCondition("hover: none");
+
+ testHoverCondition("hover: Hover");
+ testHoverCondition("hover: On-demand");
+ testHoverCondition("hover: None");
+
+ testHoverCondition("Hover: hover");
+ testHoverCondition("Hover: on-demand");
+ testHoverCondition("Hover: none");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhoverstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the hover media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(0, 128, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 255)
+getComputedStyle(target)["width"] = 100px
+getComputedStyle(target)["height"] = 100px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqhoverstylinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-hover-styling.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-hover-styling.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-hover-styling.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<div id="target"></div>
+<style>
+ #target {
+ color: red;
+ background-color: black;
+ width: 100px;
+ height: 100px;
+ display: none;
+ }
+ @media (hover) {
+ #target {
+ color: green;
+ }
+ }
+ @media (hover: hover) {
+ #target {
+ background-color: blue;
+ }
+ }
+ @media (hover: on-demand) {
+ #target {
+ width: 10px;
+ }
+ }
+ @media (hover: none) {
+ #target {
+ height: 10px;
+ }
+ }
+</style>
+
+<script>
+ description("Test the hover media feature to guard style rules.")
+
+ var target = document.getElementById('target');
+
+ function displayProperty(property) {
+ var testString = 'getComputedStyle(target)["' + property + '"]';
+ debug(testString + " = " + eval(testString));
+ }
+
+ displayProperty("color");
+ displayProperty("background-color");
+ displayProperty("width");
+ displayProperty("height");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointercssomexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-cssom-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-cssom-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-cssom-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+Test the CSSOM serialization of the pointer media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: coarse)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: coarse)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: none)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS document.styleSheets[1].cssRules[0].media.mediaText is "(pointer: fine)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointercssomhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-cssom.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-cssom.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-cssom.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test the CSSOM serialization of the pointer media feature.")
+
+ var testCases = [
+ // Case.
+ ["(pointer)", "(pointer)"],
+ ["( pointer)", "(pointer)"],
+ ["(pointer )", "(pointer)"],
+ ["( pointer )", "(pointer)"],
+ ["(pointer: fine)", "(pointer: fine)"],
+ ["(pointer: Fine)", "(pointer: fine)"],
+ ["(pointer: FINE)", "(pointer: fine)"],
+ ["(Pointer: fine)", "(pointer: fine)"],
+ ["(POINTER: fine)", "(pointer: fine)"],
+ ["(Pointer: Fine)", "(pointer: fine)"],
+ ["(pointer: COARSE)", "(pointer: coarse)"],
+ ["(Pointer: Coarse)", "(pointer: coarse)"],
+ ["(pointer: NONE)", "(pointer: none)"],
+ ["(Pointer: None)", "(pointer: none)"],
+
+ // Spacing.
+ ["(pointer:fine)", "(pointer: fine)"],
+ ["(pointer: fine)", "(pointer: fine)"],
+ ["(pointer :fine)", "(pointer: fine)"],
+ ["(pointer : fine)", "(pointer: fine)"],
+ ["( pointer : fine )", "(pointer: fine)"],
+ ["(pointer\t:\tfine)", "(pointer: fine)"],
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ targetStyle.innerText = "@media " + testCase[0] + " { }";
+ shouldBeEqualToString("document.styleSheets[1].cssRules[0].media.mediaText", testCase[1]);
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/media/mq-pointer-expected.txt (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-expected.txt        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/LayoutTests/fast/media/mq-pointer-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -1,27 +1,14 @@
</span><span class="cx"> Test the (pointer) and (hover) media features. See Bug 87403 for details.
</span><span class="cx">
</span><del>-------------- default configuration -------------
-Query "(pointer)": false
-Query "(Pointer)": false
</del><ins>+Query "(pointer)": true
+Query "(Pointer)": true
</ins><span class="cx"> Query "(pointer:none)": false
</span><span class="cx"> Query "(pointer:coarse)": false
</span><span class="cx"> Query "(pointer:coARse)": false
</span><span class="cx"> Query "(pointer:bogusvalue)": false
</span><del>-Query "(pointer:fine)": false
-Query "(hover)": false
</del><ins>+Query "(pointer:fine)": true
+Query "(hover)": true
</ins><span class="cx"> Query "(hover:0)": false
</span><span class="cx"> Query "(hover:1)": false
</span><span class="cx"> Query "(hover:bogusvalue)": false
</span><del>-------------- with touch screen -------------
-Query "(pointer)": true
-Query "(Pointer)": true
-Query "(pointer:none)": false
-Query "(pointer:coarse)": true
-Query "(pointer:coARse)": true
-Query "(pointer:bogusvalue)": false
-Query "(pointer:fine)": false
-Query "(hover)": false
-Query "(hover:0)": true
-Query "(hover:1)": false
-Query "(hover:bogusvalue)": false
</del><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointerinvalidexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-invalid-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-invalid-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-invalid-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+Test invalid input with the pointer media feature.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.matchMedia("(pointer:)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(pointer: )").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(pointer: WebKit)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(pointer: pointer)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(pointer: hover)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(pointer: portrait)").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(pointer: \"None\")").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS window.matchMedia("(pointer: 'None')").matches is false
+PASS document.styleSheets[1].cssRules[0].media.length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointerinvalidhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-invalid.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-invalid.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-invalid.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<style id="target-style"></style>
+
+<script>
+ description("Test invalid input with the pointer media feature.")
+
+ var testCases = [
+ "pointer:",
+ "pointer: ",
+ "pointer: WebKit",
+ "pointer: pointer",
+ "pointer: hover",
+ "pointer: portrait",
+ "pointer: \\\"None\\\"",
+ "pointer: 'None'",
+ ];
+
+ var targetStyle = document.getElementById('target-style');
+ for (var testCase of testCases) {
+ var testString = 'window.matchMedia("(' + testCase + ')").matches';
+ shouldBeFalse('window.matchMedia("(' + testCase + ')").matches');
+
+ targetStyle.innerText = "@media " + testCase + " { }";
+ shouldBe("document.styleSheets[1].cssRules[0].media.length", "0");
+ }
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the pointer media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(pointer)").matches = true
+window.matchMedia("(pointer: fine)").matches = true
+window.matchMedia("(pointer: coarse)").matches = false
+window.matchMedia("(pointer: none)").matches = false
+window.matchMedia("(pointer: Fine)").matches = true
+window.matchMedia("(pointer: Coarse)").matches = false
+window.matchMedia("(pointer: None)").matches = false
+window.matchMedia("(Pointer: fine)").matches = true
+window.matchMedia("(Pointer: coarse)").matches = false
+window.matchMedia("(Pointer: none)").matches = false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointermatchMediahtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-matchMedia.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-matchMedia.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-matchMedia.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<script>
+ description("Test the pointer media feature with machMedia.")
+
+ function testPointerCondition(condition) {
+ var testString = 'window.matchMedia("(' + condition + ')").matches';
+ debug(testString + " = " + eval(testString));
+ }
+
+ testPointerCondition("pointer");
+
+ testPointerCondition("pointer: fine");
+ testPointerCondition("pointer: coarse");
+ testPointerCondition("pointer: none");
+
+ testPointerCondition("pointer: Fine");
+ testPointerCondition("pointer: Coarse");
+ testPointerCondition("pointer: None");
+
+ testPointerCondition("Pointer: fine");
+ testPointerCondition("Pointer: coarse");
+ testPointerCondition("Pointer: none");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointerstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the pointer media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(0, 128, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 255)
+getComputedStyle(target)["width"] = 100px
+getComputedStyle(target)["height"] = 100px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointerstylinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/media/mq-pointer-styling.html (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer-styling.html         (rev 0)
+++ trunk/LayoutTests/fast/media/mq-pointer-styling.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test-pre.js"></script>
+<div id="target"></div>
+<style>
+ #target {
+ color: red;
+ background-color: black;
+ width: 100px;
+ height: 100px;
+ display: none;
+ }
+ @media (pointer) {
+ #target {
+ color: green;
+ }
+ }
+ @media (pointer: fine) {
+ #target {
+ background-color: blue;
+ }
+ }
+ @media (pointer: coarse) {
+ #target {
+ width: 10px;
+ }
+ }
+ @media (pointer: none) {
+ #target {
+ height: 10px;
+ }
+ }
+</style>
+
+<script>
+ description("Test the pointer media feature to guard style rules.")
+
+ var target = document.getElementById('target');
+
+ function displayProperty(property) {
+ var testString = 'getComputedStyle(target)["' + property + '"]';
+ debug(testString + " = " + eval(testString));
+ }
+
+ displayProperty("color");
+ displayProperty("background-color");
+ displayProperty("width");
+ displayProperty("height");
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmediamqpointerhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/media/mq-pointer.html (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/media/mq-pointer.html        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/LayoutTests/fast/media/mq-pointer.html        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -34,15 +34,7 @@
</span><span class="cx">
</span><span class="cx"> function runTests()
</span><span class="cx"> {
</span><del>- log("------------- default configuration -------------");
</del><span class="cx"> testQueries();
</span><del>-
- if (window.internals) {
- internals.settings.setDeviceSupportsTouch(true);
-
- log("------------- with touch screen -------------");
- testQueries();
- }
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> </script>
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqanyhovermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the any-hover media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(any-hover)").matches = false
+window.matchMedia("(any-hover: hover)").matches = false
+window.matchMedia("(any-hover: on-demand)").matches = false
+window.matchMedia("(any-hover: none)").matches = true
+window.matchMedia("(any-hover: Hover)").matches = false
+window.matchMedia("(any-hover: On-demand)").matches = false
+window.matchMedia("(any-hover: None)").matches = true
+window.matchMedia("(Any-Hover: hover)").matches = false
+window.matchMedia("(Any-Hover: on-demand)").matches = false
+window.matchMedia("(Any-Hover: none)").matches = true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqanyhoverstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the any-hover media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(255, 0, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 0)
+getComputedStyle(target)["width"] = 100px
+getComputedStyle(target)["height"] = 10px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqanypointermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the any-pointer media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(any-pointer)").matches = true
+window.matchMedia("(any-pointer: fine)").matches = false
+window.matchMedia("(any-pointer: coarse)").matches = true
+window.matchMedia("(any-pointer: none)").matches = false
+window.matchMedia("(any-pointer: Fine)").matches = false
+window.matchMedia("(any-pointer: Coarse)").matches = true
+window.matchMedia("(any-pointer: None)").matches = false
+window.matchMedia("(Any-Pointer: fine)").matches = false
+window.matchMedia("(Any-Pointer: coarse)").matches = true
+window.matchMedia("(Any-Pointer: none)").matches = false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqanypointerstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the any-pointer media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(0, 128, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 0)
+getComputedStyle(target)["width"] = 10px
+getComputedStyle(target)["height"] = 100px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqhovermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the hover media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(hover)").matches = false
+window.matchMedia("(hover: hover)").matches = false
+window.matchMedia("(hover: on-demand)").matches = false
+window.matchMedia("(hover: none)").matches = true
+window.matchMedia("(hover: Hover)").matches = false
+window.matchMedia("(hover: On-demand)").matches = false
+window.matchMedia("(hover: None)").matches = true
+window.matchMedia("(Hover: hover)").matches = false
+window.matchMedia("(Hover: on-demand)").matches = false
+window.matchMedia("(Hover: none)").matches = true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqhoverstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the hover media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(255, 0, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 0)
+getComputedStyle(target)["width"] = 100px
+getComputedStyle(target)["height"] = 10px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqpointerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test the (pointer) and (hover) media features. See Bug 87403 for details.
+
+Query "(pointer)": true
+Query "(Pointer)": true
+Query "(pointer:none)": false
+Query "(pointer:coarse)": true
+Query "(pointer:coARse)": true
+Query "(pointer:bogusvalue)": false
+Query "(pointer:fine)": false
+Query "(hover)": false
+Query "(hover:0)": false
+Query "(hover:1)": false
+Query "(hover:bogusvalue)": false
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqpointermatchMediaexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-matchMedia-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-matchMedia-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-matchMedia-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Test the pointer media feature with machMedia.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+window.matchMedia("(pointer)").matches = true
+window.matchMedia("(pointer: fine)").matches = false
+window.matchMedia("(pointer: coarse)").matches = true
+window.matchMedia("(pointer: none)").matches = false
+window.matchMedia("(pointer: Fine)").matches = false
+window.matchMedia("(pointer: Coarse)").matches = true
+window.matchMedia("(pointer: None)").matches = false
+window.matchMedia("(Pointer: fine)").matches = false
+window.matchMedia("(Pointer: coarse)").matches = true
+window.matchMedia("(Pointer: none)").matches = false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorfastmediamqpointerstylingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-styling-expected.txt (0 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-styling-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-styling-expected.txt        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+Test the pointer media feature to guard style rules.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+getComputedStyle(target)["color"] = rgb(0, 128, 0)
+getComputedStyle(target)["background-color"] = rgb(0, 0, 0)
+getComputedStyle(target)["width"] = 10px
+getComputedStyle(target)["height"] = 100px
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/Source/WebCore/ChangeLog        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -1,3 +1,54 @@
</span><ins>+2015-01-23 Benjamin Poulain <bpoulain@apple.com>
+
+ Add pointer/hover media queries
+ https://bugs.webkit.org/show_bug.cgi?id=134822
+
+ Reviewed by Antti Koivisto.
+
+ Media Queries Level 4 introduces two types of Interaction Media Features:
+ "pointer" and "hover". Those media features are useful for adapting the design
+ to the type of input:
+ http://dev.w3.org/csswg/mediaqueries-4/#mf-interaction
+
+ This implementation is trivial: just #ifdef the return value depending on
+ the support for touch events.
+ In the future we should move that to a client interface but let's start easy
+ for now.
+
+ Tests: fast/media/mq-any-hover-cssom.html
+ fast/media/mq-any-hover-invalid.html
+ fast/media/mq-any-hover-matchMedia.html
+ fast/media/mq-any-hover-styling.html
+ fast/media/mq-any-pointer-cssom.html
+ fast/media/mq-any-pointer-invalid.html
+ fast/media/mq-any-pointer-matchMedia.html
+ fast/media/mq-any-pointer-styling.html
+ fast/media/mq-hover-cssom.html
+ fast/media/mq-hover-invalid.html
+ fast/media/mq-hover-matchMedia.html
+ fast/media/mq-hover-styling.html
+ fast/media/mq-pointer-cssom.html
+ fast/media/mq-pointer-invalid.html
+ fast/media/mq-pointer-matchMedia.html
+ fast/media/mq-pointer-styling.html
+
+ * css/CSSValueKeywords.in:
+ * css/MediaFeatureNames.h:
+ * css/MediaQueryEvaluator.cpp:
+ (WebCore::hoverMediaFeatureEval):
+ (WebCore::any_hoverMediaFeatureEval):
+ (WebCore::pointerMediaFeatureEval):
+ (WebCore::any_pointerMediaFeatureEval):
+ (WebCore::leastCapablePrimaryPointerDeviceType): Deleted.
+ * css/MediaQueryExp.cpp:
+ (WebCore::featureWithCSSValueID):
+ (WebCore::featureWithZeroOrOne):
+ (WebCore::featureWithoutValue):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
+ (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
+ * page/Settings.in:
+
</ins><span class="cx"> 2015-01-23 Commit Queue <commit-queue@webkit.org>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r179051.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -1030,6 +1030,11 @@
</span><span class="cx"> coarse
</span><span class="cx"> fine
</span><span class="cx">
</span><ins>+// (hover:) media feature.
+// none
+hover
+on-demand
+
</ins><span class="cx"> // blend modes
</span><span class="cx"> // normal
</span><span class="cx"> multiply
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaFeatureNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaFeatureNames.h (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaFeatureNames.h        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/Source/WebCore/css/MediaFeatureNames.h        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -32,6 +32,8 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
</span><ins>+ macro(any_hover, "any-hover") \
+ macro(any_pointer, "any-pointer") \
</ins><span class="cx"> macro(color, "color") \
</span><span class="cx"> macro(color_index, "color-index") \
</span><span class="cx"> macro(grid, "grid") \
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryEvaluator.cpp (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -647,64 +647,45 @@
</span><span class="cx"> return !isRunningOnIPhoneOrIPod() || frame->settings().mediaPlaybackAllowsInline();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-enum PointerDeviceType { TouchPointer, MousePointer, NoPointer, UnknownPointer };
-
-static PointerDeviceType leastCapablePrimaryPointerDeviceType(Frame* frame)
</del><ins>+static bool hoverMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame*, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>- if (frame->settings().deviceSupportsTouch())
- return TouchPointer;
</del><ins>+ if (!is<CSSPrimitiveValue>(value)) {
+#if ENABLE(TOUCH_EVENTS)
+ return false;
+#else
+ return true;
+#endif
+ }
</ins><span class="cx">
</span><del>- // FIXME: We should also try to determine if we know we have a mouse.
- // When we do this, we'll also need to differentiate between known not to
- // have mouse or touch screen (NoPointer) and unknown (UnknownPointer).
- // We could also take into account other preferences like accessibility
- // settings to decide which of the available pointers should be considered
- // "primary".
-
- return UnknownPointer;
</del><ins>+ int hoverCSSKeywordID = downcast<CSSPrimitiveValue>(*value).getValueID();
+#if ENABLE(TOUCH_EVENTS)
+ return hoverCSSKeywordID == CSSValueNone;
+#else
+ return hoverCSSKeywordID == CSSValueHover;
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static bool hoverMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool any_hoverMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData& cssToLengthConversionData, Frame* frame, MediaFeaturePrefix prefix)
</ins><span class="cx"> {
</span><del>- PointerDeviceType pointer = leastCapablePrimaryPointerDeviceType(frame);
-
- // If we're on a port that hasn't explicitly opted into providing pointer device information
- // (or otherwise can't be confident in the pointer hardware available), then behave exactly
- // as if this feature feature isn't supported.
- if (pointer == UnknownPointer)
- return false;
-
- float number = 1;
- if (value) {
- if (!numberValue(value, number))
- return false;
- }
-
- return (pointer == NoPointer && !number)
- || (pointer == TouchPointer && !number)
- || (pointer == MousePointer && number == 1);
</del><ins>+ return hoverMediaFeatureEval(value, cssToLengthConversionData, frame, prefix);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static bool pointerMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool pointerMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame*, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>- PointerDeviceType pointer = leastCapablePrimaryPointerDeviceType(frame);
</del><ins>+ if (!is<CSSPrimitiveValue>(value))
+ return true;
</ins><span class="cx">
</span><del>- // If we're on a port that hasn't explicitly opted into providing pointer device information
- // (or otherwise can't be confident in the pointer hardware available), then behave exactly
- // as if this feature feature isn't supported.
- if (pointer == UnknownPointer)
- return false;
</del><ins>+ int pointerCSSKeywordID = downcast<CSSPrimitiveValue>(*value).getValueID();
+#if ENABLE(TOUCH_EVENTS)
+ return pointerCSSKeywordID == CSSValueCoarse;
+#else
+ return pointerCSSKeywordID == CSSValueFine;
+#endif
+}
</ins><span class="cx">
</span><del>- if (!value)
- return pointer != NoPointer;
-
- if (!is<CSSPrimitiveValue>(*value))
- return false;
-
- const CSSValueID id = downcast<CSSPrimitiveValue>(*value).getValueID();
- return (pointer == NoPointer && id == CSSValueNone)
- || (pointer == TouchPointer && id == CSSValueCoarse)
- || (pointer == MousePointer && id == CSSValueFine);
</del><ins>+static bool any_pointerMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData& cssToLengthConversionData, Frame* frame, MediaFeaturePrefix prefix)
+{
+ return pointerMediaFeatureEval(value, cssToLengthConversionData, frame, prefix);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // FIXME: Remove unnecessary '&' from the following 'ADD_TO_FUNCTIONMAP' definition
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryExpcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryExp.cpp (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryExp.cpp        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/Source/WebCore/css/MediaQueryExp.cpp        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -47,6 +47,9 @@
</span><span class="cx"> #if ENABLE(VIEW_MODE_CSS_MEDIA)
</span><span class="cx"> || mediaFeature == MediaFeatureNames::view_modeMediaFeature
</span><span class="cx"> #endif // ENABLE(VIEW_MODE_CSS_MEDIA)
</span><ins>+ || mediaFeature == MediaFeatureNames::any_hoverMediaFeature
+ || mediaFeature == MediaFeatureNames::any_pointerMediaFeature
+ || mediaFeature == MediaFeatureNames::hoverMediaFeature
</ins><span class="cx"> || mediaFeature == MediaFeatureNames::inverted_colorsMediaFeature
</span><span class="cx"> || mediaFeature == MediaFeatureNames::pointerMediaFeature;
</span><span class="cx"> }
</span><span class="lines">@@ -114,8 +117,7 @@
</span><span class="cx"> if (!value->isInt || !(value->fValue == 1 || !value->fValue))
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- return mediaFeature == MediaFeatureNames::gridMediaFeature
- || mediaFeature == MediaFeatureNames::hoverMediaFeature;
</del><ins>+ return mediaFeature == MediaFeatureNames::gridMediaFeature;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static inline bool featureWithAspectRatio(const AtomicString& mediaFeature)
</span><span class="lines">@@ -131,7 +133,9 @@
</span><span class="cx"> static inline bool featureWithoutValue(const AtomicString& mediaFeature)
</span><span class="cx"> {
</span><span class="cx"> // Media features that are prefixed by min/max cannot be used without a value.
</span><del>- return mediaFeature == MediaFeatureNames::monochromeMediaFeature
</del><ins>+ return mediaFeature == MediaFeatureNames::any_hoverMediaFeature
+ || mediaFeature == MediaFeatureNames::any_pointerMediaFeature
+ || mediaFeature == MediaFeatureNames::monochromeMediaFeature
</ins><span class="cx"> || mediaFeature == MediaFeatureNames::colorMediaFeature
</span><span class="cx"> || mediaFeature == MediaFeatureNames::color_indexMediaFeature
</span><span class="cx"> || mediaFeature == MediaFeatureNames::gridMediaFeature
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -2898,9 +2898,6 @@
</span><span class="cx"> if (m_mousePositionIsUnknown)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (!m_frame.settings().deviceSupportsMouse())
- return;
-
</del><span class="cx"> if (Page* page = m_frame.page()) {
</span><span class="cx"> if (!page->chrome().client().shouldDispatchFakeMouseMoveEvents())
</span><span class="cx"> return;
</span><span class="lines">@@ -2947,9 +2944,6 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_mousePressed);
</span><span class="cx">
</span><del>- if (!m_frame.settings().deviceSupportsMouse())
- return;
-
</del><span class="cx"> FrameView* view = m_frame.view();
</span><span class="cx"> if (!view)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.in (179054 => 179055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.in        2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/Source/WebCore/page/Settings.in        2015-01-24 04:15:56 UTC (rev 179055)
</span><span class="lines">@@ -147,8 +147,6 @@
</span><span class="cx"> imageSubsamplingEnabled initial=defaultImageSubsamplingEnabled
</span><span class="cx"> wantsBalancedSetDefersLoadingBehavior initial=false
</span><span class="cx"> requestAnimationFrameEnabled initial=true
</span><del>-deviceSupportsTouch initial=false
-deviceSupportsMouse initial=true
</del><span class="cx">
</span><span class="cx"> fixedPositionCreatesStackingContext initial=defaultFixedPositionCreatesStackingContext
</span><span class="cx"> syncXHRInDocumentsEnabled initial=true
</span></span></pre>
</div>
</div>
</body>
</html>