Implement touch-action: manipulation; for iOS
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Oct 2015 13:54:55 +0000 (13:54 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Oct 2015 13:54:55 +0000 (13:54 +0000)
commita64f924fe2c9f813912a63d8ae9c7eff9a67e060
treea2e5837cc53eacebbe15bc4415a700bf04e3bfba
parentd93a48e1c338c62da8362fa33581754ca6f708f8
Implement touch-action: manipulation; for iOS
https://bugs.webkit.org/show_bug.cgi?id=149854
<rdar://problem/23017145>

Reviewed by Benjamin Poulain.

Source/WebCore:

Implements the manipulation value for the CSS property touch-action. Adds support for
parsing the touch-action property and two of its values: auto and manipulation.

Tests: css3/touch-action/touch-action-computed-style.html
       css3/touch-action/touch-action-manipulation-fast-clicks.html
       css3/touch-action/touch-action-parsing.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::parseValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TouchAction):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* dom/Element.cpp:
(WebCore::Element::allowsDoubleTapGesture): Here, we determine whether an element that resulted from
    hit-testing a touch should allow double-tap gestures. To do this, we walk up the element's parents,
    stopping when we detect an element that disallows double tap gestures by having a touch-action other
    than auto or by hitting the root node.
* dom/Element.h:
* dom/Node.h:
(WebCore::Node::allowsDoubleTapGesture):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

Source/WebKit2:

Implements the manipulation value for the CSS property touch-action. Performs hit-testing upon receiving a potential
tap to determine whether to disable double-tap gesture recognition over the duration of the tap. If so, sends a message
from the web process to the UI process indicating that double-tapping should be disabled, allowing single taps to
avoid the delay.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::potentialTapAtPosition):

LayoutTests:

Add tests to check that the manipulation and auto values of the touch-action property can be
properly parsed and can be obtained through computed style. Also tests that putting touch-action:
manipulation on an element and tapping repeatedly on it will fire clicks instead of recognizing
double taps and causing the viewport to zoom.

* TestExpectations:
* css3/touch-action/touch-action-computed-style-expected.txt: Added.
* css3/touch-action/touch-action-computed-style.html: Added.
* css3/touch-action/touch-action-manipulation-fast-clicks-expected.txt: Added.
* css3/touch-action/touch-action-manipulation-fast-clicks.html: Added.
* css3/touch-action/touch-action-parsing-expected.txt: Added.
* css3/touch-action/touch-action-parsing.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/css3/touch-action/touch-action-computed-style-expected.txt [new file with mode: 0644]
LayoutTests/css3/touch-action/touch-action-computed-style.html [new file with mode: 0644]
LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks-expected.txt [new file with mode: 0644]
LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks.html [new file with mode: 0644]
LayoutTests/css3/touch-action/touch-action-parsing-expected.txt [new file with mode: 0644]
LayoutTests/css3/touch-action/touch-action-parsing.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Node.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
Source/WebCore/rendering/style/StyleRareNonInheritedData.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm