]]>
Touch support is reported even when the device doesn't have a touch screencarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>Mon, 27 May 2019 08:34:35 +0000http://git.webkit.org/?p=WebKit-https.git;a=commitdiff;h=374fba736a95c19528eadb4b37a8f5d215d126fchttp://git.webkit.org/?p=WebKit-https.git;a=commitdiff;h=374fba736a95c19528eadb4b37a8f5d215d126fc
Touch support is reported even when the device doesn't have a touch screen
Touch support is reported even when the device doesn't have a touch screen
https://bugs.webkit.org/show_bug.cgi?id=139681
Reviewed by Michael Catanzaro.
Source/WebCore:
Add screenHasTouchDevice() and screenIsTouchPrimaryInputDevice() to PlatformScreen and use it to decide whether
to expose touch events functionality or not.
* bindings/js/WebCoreBuiltinNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::hoverEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
(WebCore::anyHoverEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
(WebCore::pointerEvaluate): Use screenIsTouchPrimaryInputDevice() when touch events are enabled at build time.
(WebCore::anyPointerEvaluate): Use screenHasTouchDevice() when touch events are enabled at build time.
* dom/GlobalEventHandlers.idl: Make touch event attributes enabled at runtime.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::touchEventsEnabled const): Return whether touch events are enabled.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setTouchEventsEnabled): Force touch events to be enabled or disabled.
* platform/PlatformScreen.h:
(WebCore::screenHasTouchDevice): Just return true when touch events are enabled at build time for non-gtk ports.
(WebCore::screenIsTouchPrimaryInputDevice): Ditto.
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenHasTouchDevice):
(WebCore::screenIsTouchPrimaryInputDevice):
(WebCore::isTouchDevice):
(WebCore::deviceAddedCallback):
(WebCore::deviceRemovedCallback):
LayoutTests:
Remove expectations for tests that are passing now.
* platform/gtk/TestExpectations:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245788 268f45cc-cd09-0410-ab3c-d52691b4dbfc