haikuwebkit/LayoutTests/fast/media/mq-any-pointer-cssom-expect...

30 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

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. Canonical link: https://commits.webkit.org/158838@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-01-24 04:15:56 +00:00
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