Diff
Modified: trunk/LayoutTests/ChangeLog (179054 => 179055)
--- trunk/LayoutTests/ChangeLog 2015-01-24 03:05:36 UTC (rev 179054)
+++ trunk/LayoutTests/ChangeLog 2015-01-24 04:15:56 UTC (rev 179055)
@@ -1,3 +1,54 @@
+2015-01-23 Benjamin Poulain <[email protected]>
+
+ 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.
+
2015-01-23 Commit Queue <[email protected]>
Unreviewed, rolling out r179051.
Added: trunk/LayoutTests/fast/media/mq-any-hover-cssom-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,29 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-hover-cssom.html (0 => 179055)
--- 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)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-any-hover-invalid-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,23 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-hover-invalid.html (0 => 179055)
--- 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)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-any-hover-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-hover-matchMedia.html (0 => 179055)
--- 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)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-any-hover-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-hover-styling.html (0 => 179055)
--- 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)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-any-pointer-cssom-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,29 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-pointer-cssom.html (0 => 179055)
--- 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)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-any-pointer-invalid-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,25 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-pointer-invalid.html (0 => 179055)
--- 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)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-pointer-matchMedia.html (0 => 179055)
--- 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)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-any-pointer-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-any-pointer-styling.html (0 => 179055)
--- 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)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-hover-cssom-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,29 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-hover-cssom.html (0 => 179055)
--- 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)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-hover-invalid-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,23 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-hover-invalid.html (0 => 179055)
--- 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)
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-hover-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-hover-matchMedia.html (0 => 179055)
--- 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)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-hover-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-hover-styling.html (0 => 179055)
--- 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)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-pointer-cssom-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,29 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-pointer-cssom.html (0 => 179055)
--- 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)
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Modified: trunk/LayoutTests/fast/media/mq-pointer-expected.txt (179054 => 179055)
--- 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)
@@ -1,27 +1,14 @@
Test the (pointer) and (hover) media features. See Bug 87403 for details.
-------------- default configuration -------------
-Query "(pointer)": false
-Query "(Pointer)": false
+Query "(pointer)": true
+Query "(Pointer)": true
Query "(pointer:none)": false
Query "(pointer:coarse)": false
Query "(pointer:coARse)": false
Query "(pointer:bogusvalue)": false
-Query "(pointer:fine)": false
-Query "(hover)": false
+Query "(pointer:fine)": true
+Query "(hover)": true
Query "(hover:0)": false
Query "(hover:1)": false
Query "(hover:bogusvalue)": false
-------------- 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
Added: trunk/LayoutTests/fast/media/mq-pointer-invalid-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,25 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-pointer-invalid.html (0 => 179055)
--- 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)
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-pointer-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-pointer-matchMedia.html (0 => 179055)
--- 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)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/media/mq-pointer-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Added: trunk/LayoutTests/fast/media/mq-pointer-styling.html (0 => 179055)
--- 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)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<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=""
+</body>
+</html>
Modified: trunk/LayoutTests/fast/media/mq-pointer.html (179054 => 179055)
--- 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)
@@ -34,15 +34,7 @@
function runTests()
{
- log("------------- default configuration -------------");
testQueries();
-
- if (window.internals) {
- internals.settings.setDeviceSupportsTouch(true);
-
- log("------------- with touch screen -------------");
- testQueries();
- }
}
</script>
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-hover-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-any-pointer-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-hover-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,14 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-matchMedia-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,19 @@
+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
+
Added: trunk/LayoutTests/platform/ios-simulator/fast/media/mq-pointer-styling-expected.txt (0 => 179055)
--- 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)
@@ -0,0 +1,13 @@
+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
+
Modified: trunk/Source/WebCore/ChangeLog (179054 => 179055)
--- 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)
@@ -1,3 +1,54 @@
+2015-01-23 Benjamin Poulain <[email protected]>
+
+ 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:
+
2015-01-23 Commit Queue <[email protected]>
Unreviewed, rolling out r179051.
Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (179054 => 179055)
--- 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)
@@ -1030,6 +1030,11 @@
coarse
fine
+// (hover:) media feature.
+// none
+hover
+on-demand
+
// blend modes
// normal
multiply
Modified: trunk/Source/WebCore/css/MediaFeatureNames.h (179054 => 179055)
--- 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)
@@ -32,6 +32,8 @@
#endif
#define CSS_MEDIAQUERY_NAMES_FOR_EACH_MEDIAFEATURE(macro) \
+ macro(any_hover, "any-hover") \
+ macro(any_pointer, "any-pointer") \
macro(color, "color") \
macro(color_index, "color-index") \
macro(grid, "grid") \
Modified: trunk/Source/WebCore/css/MediaQueryEvaluator.cpp (179054 => 179055)
--- 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)
@@ -647,64 +647,45 @@
return !isRunningOnIPhoneOrIPod() || frame->settings().mediaPlaybackAllowsInline();
}
-enum PointerDeviceType { TouchPointer, MousePointer, NoPointer, UnknownPointer };
-
-static PointerDeviceType leastCapablePrimaryPointerDeviceType(Frame* frame)
+static bool hoverMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame*, MediaFeaturePrefix)
{
- if (frame->settings().deviceSupportsTouch())
- return TouchPointer;
+ if (!is<CSSPrimitiveValue>(value)) {
+#if ENABLE(TOUCH_EVENTS)
+ return false;
+#else
+ return true;
+#endif
+ }
- // 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;
+ int hoverCSSKeywordID = downcast<CSSPrimitiveValue>(*value).getValueID();
+#if ENABLE(TOUCH_EVENTS)
+ return hoverCSSKeywordID == CSSValueNone;
+#else
+ return hoverCSSKeywordID == CSSValueHover;
+#endif
}
-static bool hoverMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame* frame, MediaFeaturePrefix)
+static bool any_hoverMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData& cssToLengthConversionData, Frame* frame, MediaFeaturePrefix prefix)
{
- 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);
+ return hoverMediaFeatureEval(value, cssToLengthConversionData, frame, prefix);
}
-static bool pointerMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame* frame, MediaFeaturePrefix)
+static bool pointerMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&, Frame*, MediaFeaturePrefix)
{
- PointerDeviceType pointer = leastCapablePrimaryPointerDeviceType(frame);
+ if (!is<CSSPrimitiveValue>(value))
+ return true;
- // 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;
+ int pointerCSSKeywordID = downcast<CSSPrimitiveValue>(*value).getValueID();
+#if ENABLE(TOUCH_EVENTS)
+ return pointerCSSKeywordID == CSSValueCoarse;
+#else
+ return pointerCSSKeywordID == CSSValueFine;
+#endif
+}
- 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);
+static bool any_pointerMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData& cssToLengthConversionData, Frame* frame, MediaFeaturePrefix prefix)
+{
+ return pointerMediaFeatureEval(value, cssToLengthConversionData, frame, prefix);
}
// FIXME: Remove unnecessary '&' from the following 'ADD_TO_FUNCTIONMAP' definition
Modified: trunk/Source/WebCore/css/MediaQueryExp.cpp (179054 => 179055)
--- 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)
@@ -47,6 +47,9 @@
#if ENABLE(VIEW_MODE_CSS_MEDIA)
|| mediaFeature == MediaFeatureNames::view_modeMediaFeature
#endif // ENABLE(VIEW_MODE_CSS_MEDIA)
+ || mediaFeature == MediaFeatureNames::any_hoverMediaFeature
+ || mediaFeature == MediaFeatureNames::any_pointerMediaFeature
+ || mediaFeature == MediaFeatureNames::hoverMediaFeature
|| mediaFeature == MediaFeatureNames::inverted_colorsMediaFeature
|| mediaFeature == MediaFeatureNames::pointerMediaFeature;
}
@@ -114,8 +117,7 @@
if (!value->isInt || !(value->fValue == 1 || !value->fValue))
return false;
- return mediaFeature == MediaFeatureNames::gridMediaFeature
- || mediaFeature == MediaFeatureNames::hoverMediaFeature;
+ return mediaFeature == MediaFeatureNames::gridMediaFeature;
}
static inline bool featureWithAspectRatio(const AtomicString& mediaFeature)
@@ -131,7 +133,9 @@
static inline bool featureWithoutValue(const AtomicString& mediaFeature)
{
// Media features that are prefixed by min/max cannot be used without a value.
- return mediaFeature == MediaFeatureNames::monochromeMediaFeature
+ return mediaFeature == MediaFeatureNames::any_hoverMediaFeature
+ || mediaFeature == MediaFeatureNames::any_pointerMediaFeature
+ || mediaFeature == MediaFeatureNames::monochromeMediaFeature
|| mediaFeature == MediaFeatureNames::colorMediaFeature
|| mediaFeature == MediaFeatureNames::color_indexMediaFeature
|| mediaFeature == MediaFeatureNames::gridMediaFeature
Modified: trunk/Source/WebCore/page/EventHandler.cpp (179054 => 179055)
--- 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)
@@ -2898,9 +2898,6 @@
if (m_mousePositionIsUnknown)
return;
- if (!m_frame.settings().deviceSupportsMouse())
- return;
-
if (Page* page = m_frame.page()) {
if (!page->chrome().client().shouldDispatchFakeMouseMoveEvents())
return;
@@ -2947,9 +2944,6 @@
{
ASSERT(!m_mousePressed);
- if (!m_frame.settings().deviceSupportsMouse())
- return;
-
FrameView* view = m_frame.view();
if (!view)
return;
Modified: trunk/Source/WebCore/page/Settings.in (179054 => 179055)
--- 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)
@@ -147,8 +147,6 @@
imageSubsamplingEnabled initial=defaultImageSubsamplingEnabled
wantsBalancedSetDefersLoadingBehavior initial=false
requestAnimationFrameEnabled initial=true
-deviceSupportsTouch initial=false
-deviceSupportsMouse initial=true
fixedPositionCreatesStackingContext initial=defaultFixedPositionCreatesStackingContext
syncXHRInDocumentsEnabled initial=true