Title: [193478] branches/safari-601-branch
Revision
193478
Author
matthew_han...@apple.com
Date
2015-12-04 14:38:27 -0800 (Fri, 04 Dec 2015)

Log Message

Merge r191452. rdar://problem/23732400

Modified Paths

Added Paths

Diff

Modified: branches/safari-601-branch/LayoutTests/ChangeLog (193477 => 193478)


--- branches/safari-601-branch/LayoutTests/ChangeLog	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/LayoutTests/ChangeLog	2015-12-04 22:38:27 UTC (rev 193478)
@@ -1,5 +1,31 @@
 2015-12-04  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r191452. rdar://problem/23732400
+
+    2015-10-22  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            Implement touch-action: manipulation; for iOS
+            https://bugs.webkit.org/show_bug.cgi?id=149854
+            <rdar://problem/23017145>
+
+            Reviewed by Benjamin Poulain.
+
+            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:
+
+2015-12-04  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r191072. rdar://problem/23732400
 
     2015-10-14  Wenson Hsieh  <wenson_hs...@apple.com>

Modified: branches/safari-601-branch/LayoutTests/TestExpectations (193477 => 193478)


--- branches/safari-601-branch/LayoutTests/TestExpectations	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/LayoutTests/TestExpectations	2015-12-04 22:38:27 UTC (rev 193478)
@@ -2,6 +2,16 @@
 #
 # See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
 
+#//////////////////////////////////////////////////////////////////////////////////////////
+# Platform-specific tests. Skipped here, then re-enabled on the appropriate platform.
+#//////////////////////////////////////////////////////////////////////////////////////////
+
+css3/touch-action [ Skip ]
+
+#//////////////////////////////////////////////////////////////////////////////////////////
+# End platform-specific tests.
+#//////////////////////////////////////////////////////////////////////////////////////////
+
 # pending functional patch and per-port verification
 webkit.org/b/109954 css3/line-break [ Skip ]
 

Added: branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-computed-style-expected.txt (0 => 193478)


--- branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-computed-style-expected.txt	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-computed-style-expected.txt	2015-12-04 22:38:27 UTC (rev 193478)
@@ -0,0 +1,22 @@
+Testing touch-action: manipulation;
+PASS window.getComputedStyle(document.body).getPropertyValue('touch-action') is 'manipulation'
+Testing touch-action: auto;
+PASS window.getComputedStyle(document.body).getPropertyValue('touch-action') is 'auto'
+Testing a bogus value
+PASS window.getComputedStyle(document.body).getPropertyValue('touch-action') is 'auto'
+Testing all caps
+PASS window.getComputedStyle(document.body).getPropertyValue('touch-action') is 'manipulation'
+Testing weird casing
+PASS window.getComputedStyle(document.body).getPropertyValue('touch-action') is 'auto'
+Testing !important (auto)
+PASS window.getComputedStyle(document.body).getPropertyValue('touch-action') is 'auto'
+Testing !important (manipulation)
+PASS window.getComputedStyle(document.body).getPropertyValue('touch-action') is 'manipulation'
+Testing non-inheritance
+PASS window.getComputedStyle(document.getElementById('child')).getPropertyValue('touch-action') is 'auto'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Testing the computed style of touch-action:
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Added: branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-computed-style.html (0 => 193478)


--- branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-computed-style.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-computed-style.html	2015-12-04 22:38:27 UTC (rev 193478)
@@ -0,0 +1,61 @@
+<html>
+    <head>
+        <script src=""
+    </head>
+
+    <body id="body-elem">
+        <div id="child"></div>
+        <p id="description"></p>
+        <script>
+            description("Testing the computed style of touch-action:");
+            let styleElement = document.createElement("style");
+            document.head.appendChild(styleElement);
+            let stylesheet = styleElement.sheet;
+
+            debug("Testing touch-action: manipulation;");
+            stylesheet.insertRule("body { touch-action: manipulation; }", 0);
+            shouldBe("window.getComputedStyle(document.body).getPropertyValue('touch-action')", "'manipulation'");
+            stylesheet.deleteRule(0);
+
+            debug("Testing touch-action: auto;");
+            stylesheet.insertRule("body { touch-action: auto; }", 0);
+            shouldBe("window.getComputedStyle(document.body).getPropertyValue('touch-action')", "'auto'");
+            stylesheet.deleteRule(0);
+
+            debug("Testing a bogus value");
+            stylesheet.insertRule("body { touch-action: typo; }", 0);
+            shouldBe("window.getComputedStyle(document.body).getPropertyValue('touch-action')", "'auto'");
+            stylesheet.deleteRule(0);
+
+            debug("Testing all caps");
+            stylesheet.insertRule("body { touch-action: MANIPULATION; }", 0);
+            shouldBe("window.getComputedStyle(document.body).getPropertyValue('touch-action')", "'manipulation'");
+            stylesheet.deleteRule(0);
+
+            debug("Testing weird casing");
+            stylesheet.insertRule("body { touch-action: aUtO; }", 0);
+            shouldBe("window.getComputedStyle(document.body).getPropertyValue('touch-action')", "'auto'");
+            stylesheet.deleteRule(0);
+
+            debug("Testing !important (auto)");
+            stylesheet.insertRule("body { touch-action: auto !important; }", 0);
+            stylesheet.insertRule("#body-elem { touch-action: manipulation; }", 1);
+            shouldBe("window.getComputedStyle(document.body).getPropertyValue('touch-action')", "'auto'");
+            stylesheet.deleteRule(1);
+            stylesheet.deleteRule(0);
+
+            debug("Testing !important (manipulation)");
+            stylesheet.insertRule("body { touch-action: manipulation !important; }", 0);
+            stylesheet.insertRule("#body-elem { touch-action: auto; }", 1);
+            shouldBe("window.getComputedStyle(document.body).getPropertyValue('touch-action')", "'manipulation'");
+            stylesheet.deleteRule(1);
+            stylesheet.deleteRule(0);
+
+            debug("Testing non-inheritance");
+            stylesheet.insertRule("body { touch-action: manipulation; }", 0);
+            shouldBe("window.getComputedStyle(document.getElementById('child')).getPropertyValue('touch-action')", "'auto'");
+            stylesheet.deleteRule(0);
+        </script>
+        <script src=""
+    </body>
+</html>

Added: branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks-expected.txt (0 => 193478)


--- branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks-expected.txt	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks-expected.txt	2015-12-04 22:38:27 UTC (rev 193478)
@@ -0,0 +1,12 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+Repeatedly tapping on the button should fire click events.
+
+This test is best run in WebKitTestRunner. If you are running this test manually, verify that tapping the button causes a "Click!" message to appear below, and that click occurred without the regular 350ms delay for double tapping.
+
+Click!
+Click!
+Click!
+

Added: branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks.html (0 => 193478)


--- branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-manipulation-fast-clicks.html	2015-12-04 22:38:27 UTC (rev 193478)
@@ -0,0 +1,59 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="initial-scale=1.0">
+
+<head>
+    <script src=""
+    <script id="ui-script" type="text/plain">
+        (function() {
+            function performTap() {
+                uiController.singleTapAtPoint(200, 200, performTap);
+            }
+            performTap();
+        })();
+    </script>
+
+    <script>
+    var clickCount = 0;
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    function getUIScript() {
+        return document.getElementById("ui-script").text;
+    }
+
+    function runTest() {
+        if (testRunner.runUIScript)
+            testRunner.runUIScript(getUIScript(), function(result) { });
+    }
+    function handleClicked() {
+        clickCount++;
+        document.body.appendChild(document.createTextNode("Click!"));
+        document.body.appendChild(document.createElement("br"));
+        if (clickCount == 3)
+            testRunner.notifyDone();
+    }
+    </script>
+
+    <style>
+    body {
+        margin: 0;
+    }
+
+    #target {
+        touch-action: manipulation;
+        width: 400px;
+        height: 400px;
+    }
+    </style>
+</head>
+
+<body _onload_="runTest()">
+    <button id="target" _onclick_="handleClicked()"></button>
+    <p>Repeatedly tapping on the button should fire click events.</p>
+    <p>This test is best run in WebKitTestRunner. If you are running this test manually, verify that tapping the button causes a "Click!" message to appear below, and that click occurred without the regular 350ms delay for double tapping.</p>
+    <script src=""
+</body>
+
+</html>

Added: branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-parsing-expected.txt (0 => 193478)


--- branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-parsing-expected.txt	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-parsing-expected.txt	2015-12-04 22:38:27 UTC (rev 193478)
@@ -0,0 +1,12 @@
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('touch-action') is 'manipulation'
+PASS cssRule.type is 1
+PASS declaration.length is 1
+PASS declaration.getPropertyValue('touch-action') is 'auto'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Test the parsing of touch-action.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

Added: branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-parsing.html (0 => 193478)


--- branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-parsing.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/css3/touch-action/touch-action-parsing.html	2015-12-04 22:38:27 UTC (rev 193478)
@@ -0,0 +1,31 @@
+<html>
+    <head>
+        <script src=""
+    </head>
+    <body>
+        <p id="description"></p>
+        <script>
+            description("Test the parsing of touch-action.");
+
+            var cssRule, declaration;
+            var styleElement = document.createElement("style");
+            document.head.appendChild(styleElement);
+            let stylesheet = styleElement.sheet;
+
+            stylesheet.insertRule("body { touch-action: manipulation; }", 0);
+            cssRule = stylesheet.cssRules.item(0);
+            shouldBe("cssRule.type", "1");
+            declaration = cssRule.style;
+            shouldBe("declaration.length", "1");
+            shouldBe("declaration.getPropertyValue('touch-action')", "'manipulation'");
+
+            stylesheet.insertRule("body { touch-action: auto; }", 0);
+            cssRule = stylesheet.cssRules.item(0);
+            shouldBe("cssRule.type", "1");
+            declaration = cssRule.style;
+            shouldBe("declaration.length", "1");
+            shouldBe("declaration.getPropertyValue('touch-action')", "'auto'");
+        </script>
+        <script src=""
+    </body>
+</html>

Modified: branches/safari-601-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations (193477 => 193478)


--- branches/safari-601-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations	2015-12-04 22:38:27 UTC (rev 193478)
@@ -2,6 +2,16 @@
 #
 # See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
 
+#//////////////////////////////////////////////////////////////////////////////////////////
+# Platform-specific directories. Skipped globally, then re-enabled here.
+#//////////////////////////////////////////////////////////////////////////////////////////
+
+css3/touch-action [ Pass ]
+
+#//////////////////////////////////////////////////////////////////////////////////////////
+# End platform-specific directories.
+#//////////////////////////////////////////////////////////////////////////////////////////
+
 # Animation tests that fail:
 webkit.org/b/129562 [ Debug ] animations/animation-direction-reverse-fill-mode.html [ Skip ]
 webkit.org/b/129562 [ Debug ] animations/fill-mode-reverse.html [ Skip ]

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-04 22:38:27 UTC (rev 193478)
@@ -1,5 +1,50 @@
 2015-12-04  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r191452. rdar://problem/23732400
+
+    2015-10-22  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            Implement touch-action: manipulation; for iOS
+            https://bugs.webkit.org/show_bug.cgi?id=149854
+            <rdar://problem/23017145>
+
+            Reviewed by Benjamin Poulain.
+
+            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:
+
+2015-12-04  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r190595. rdar://problem/23732402
 
     2015-10-05  Dean Jackson  <d...@apple.com>

Modified: branches/safari-601-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2015-12-04 22:38:27 UTC (rev 193478)
@@ -2943,6 +2943,8 @@
 #if ENABLE(TOUCH_EVENTS)
         case CSSPropertyWebkitTapHighlightColor:
             return currentColorOrValidColor(style.get(), style->tapHighlightColor());
+        case CSSPropertyTouchAction:
+            return cssValuePool.createValue(style->touchAction());
 #endif
 #if PLATFORM(IOS)
         case CSSPropertyWebkitTouchCallout:

Modified: branches/safari-601-branch/Source/WebCore/css/CSSParser.cpp (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/css/CSSParser.cpp	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/css/CSSParser.cpp	2015-12-04 22:38:27 UTC (rev 193478)
@@ -745,6 +745,12 @@
         if (valueID == CSSValueNormal || valueID == CSSValueBreakWord)
             return true;
         break;
+#if ENABLE(TOUCH_EVENTS)
+    case CSSPropertyTouchAction: // auto | manipulation
+        if (valueID == CSSValueAuto || valueID == CSSValueManipulation)
+            return true;
+        break;
+#endif
 #if ENABLE(CSS_SCROLL_SNAP)
     case CSSPropertyWebkitScrollSnapType: // none | mandatory | proximity
         if (valueID == CSSValueNone || valueID == CSSValueMandatory || valueID == CSSValueProximity)
@@ -1160,6 +1166,9 @@
     case CSSPropertyWhiteSpace:
     case CSSPropertyWordBreak:
     case CSSPropertyWordWrap:
+#if ENABLE(TOUCH_EVENTS)
+    case CSSPropertyTouchAction:
+#endif
 #if ENABLE(CSS_SCROLL_SNAP)
     case CSSPropertyWebkitScrollSnapType:
 #endif
@@ -3149,6 +3158,9 @@
     case CSSPropertyWhiteSpace:
     case CSSPropertyWordBreak:
     case CSSPropertyWordWrap:
+#if ENABLE(TOUCH_EVENTS)
+    case CSSPropertyTouchAction:
+#endif
 #if ENABLE(CSS_SCROLL_SNAP)
     case CSSPropertyWebkitScrollSnapType:
 #endif

Modified: branches/safari-601-branch/Source/WebCore/css/CSSPrimitiveValueMappings.h (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/css/CSSPrimitiveValueMappings.h	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/css/CSSPrimitiveValueMappings.h	2015-12-04 22:38:27 UTC (rev 193478)
@@ -5254,6 +5254,37 @@
     return ContentDistributionStretch;
 }
 
+#if ENABLE(TOUCH_EVENTS)
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TouchAction touchAction)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_VALUE_ID;
+    switch (touchAction) {
+    case TouchAction::Auto:
+        m_value.valueID = CSSValueAuto;
+        break;
+    case TouchAction::Manipulation:
+        m_value.valueID = CSSValueManipulation;
+        break;
+    }
+}
+
+template<> inline CSSPrimitiveValue::operator TouchAction() const
+{
+    ASSERT(isValueID());
+    switch (m_value.valueID) {
+    case CSSValueAuto:
+        return TouchAction::Auto;
+    case CSSValueManipulation:
+        return TouchAction::Manipulation;
+    default:
+        break;
+    }
+    ASSERT_NOT_REACHED();
+    return TouchAction::Auto;
+}
+#endif
+
 #if ENABLE(CSS_SCROLL_SNAP)
 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollSnapType e)
     : CSSValue(PrimitiveClass)

Modified: branches/safari-601-branch/Source/WebCore/css/CSSPropertyNames.in (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/css/CSSPropertyNames.in	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/css/CSSPropertyNames.in	2015-12-04 22:38:27 UTC (rev 193478)
@@ -656,6 +656,9 @@
 #if defined(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) && ENABLE_ACCELERATED_OVERFLOW_SCROLLING
 -webkit-overflow-scrolling [Inherited, NameForMethods=UseTouchOverflowScrolling, Converter=OverflowScrolling]
 #endif
+#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
+touch-action
+#endif
 #if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
 -webkit-touch-callout [Inherited, NameForMethods=TouchCalloutEnabled, Converter=TouchCallout]
 #endif

Modified: branches/safari-601-branch/Source/WebCore/css/CSSValueKeywords.in (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/css/CSSValueKeywords.in	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/css/CSSValueKeywords.in	2015-12-04 22:38:27 UTC (rev 193478)
@@ -1135,3 +1135,8 @@
 // will-change
 scroll-position
 contents
+
+#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
+// touch-action
+manipulation
+#endif

Modified: branches/safari-601-branch/Source/WebCore/dom/Element.cpp (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/dom/Element.cpp	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/dom/Element.cpp	2015-12-04 22:38:27 UTC (rev 193478)
@@ -4,7 +4,7 @@
  *           (C) 2001 Peter Kelly (p...@post.com)
  *           (C) 2001 Dirk Mueller (muel...@kde.org)
  *           (C) 2007 David Smith (catfish....@gmail.com)
- * Copyright (C) 2004-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2015 Apple Inc. All rights reserved.
  *           (C) 2007 Eric Seidel (e...@webkit.org)
  *
  * This library is free software; you can redistribute it and/or
@@ -1369,6 +1369,17 @@
     return document().completeURL(stripLeadingAndTrailingHTMLSpaces(linkAttribute));
 }
 
+#if ENABLE(TOUCH_EVENTS)
+bool Element::allowsDoubleTapGesture() const
+{
+    if (renderStyle() && renderStyle()->touchAction() != TouchAction::Auto)
+        return false;
+
+    Element* parent = parentElement();
+    return !parent || parent->allowsDoubleTapGesture();
+}
+#endif
+
 // Returns true is the given attribute is an event handler.
 // We consider an event handler any attribute that begins with "on".
 // It is a simple solution that has the advantage of not requiring any

Modified: branches/safari-601-branch/Source/WebCore/dom/Element.h (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/dom/Element.h	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/dom/Element.h	2015-12-04 22:38:27 UTC (rev 193478)
@@ -485,6 +485,10 @@
 
     WEBCORE_EXPORT URL absoluteLinkURL() const;
 
+#if ENABLE(TOUCH_EVENTS)
+    virtual bool allowsDoubleTapGesture() const override;
+#endif
+
 protected:
     Element(const QualifiedName&, Document&, ConstructionType);
 

Modified: branches/safari-601-branch/Source/WebCore/dom/Node.h (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/dom/Node.h	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/dom/Node.h	2015-12-04 22:38:27 UTC (rev 193478)
@@ -528,6 +528,10 @@
     void dispatchSubtreeModifiedEvent();
     bool dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEvent);
 
+#if ENABLE(TOUCH_EVENTS)
+    virtual bool allowsDoubleTapGesture() const { return true; }
+#endif
+
 #if ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS)
     bool dispatchTouchEvent(PassRefPtr<TouchEvent>);
 #endif

Modified: branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyle.h (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyle.h	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyle.h	2015-12-04 22:38:27 UTC (rev 193478)
@@ -1107,6 +1107,10 @@
     int initialLetterDrop() const { return initialLetter().width(); }
     int initialLetterHeight() const { return initialLetter().height(); }
 
+#if ENABLE(TOUCH_EVENTS)
+    TouchAction touchAction() const { return static_cast<TouchAction>(rareNonInheritedData->m_touchAction); }
+#endif
+
 #if ENABLE(CSS_SCROLL_SNAP)
     ScrollSnapType scrollSnapType() const { return static_cast<ScrollSnapType>(rareNonInheritedData->m_scrollSnapType); }
     const ScrollSnapPoints* scrollSnapPointsX() const;
@@ -1663,6 +1667,10 @@
     
     void setInitialLetter(const IntSize& size) { SET_VAR(rareNonInheritedData, m_initialLetter, size); }
     
+#if ENABLE(TOUCH_EVENTS)
+    void setTouchAction(TouchAction touchAction) { SET_VAR(rareNonInheritedData, m_touchAction, static_cast<unsigned>(touchAction)); }
+#endif
+
 #if ENABLE(CSS_SCROLL_SNAP)
     void setScrollSnapType(ScrollSnapType type) { SET_VAR(rareNonInheritedData, m_scrollSnapType, static_cast<unsigned>(type)); }
     void setScrollSnapPointsX(std::unique_ptr<ScrollSnapPoints>);
@@ -2016,6 +2024,10 @@
 
     static WillChangeData* initialWillChange() { return nullptr; }
 
+#if ENABLE(TOUCH_EVENTS)
+    static TouchAction initialTouchAction() { return TouchAction::Auto; }
+#endif
+
 #if ENABLE(CSS_SCROLL_SNAP)
     static ScrollSnapType initialScrollSnapType() { return ScrollSnapType::None; }
     static ScrollSnapPoints* initialScrollSnapPointsX() { return nullptr; }

Modified: branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyleConstants.h (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyleConstants.h	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/rendering/style/RenderStyleConstants.h	2015-12-04 22:38:27 UTC (rev 193478)
@@ -637,6 +637,13 @@
 // Fill, Stroke, ViewBox are just used for SVG.
 enum CSSBoxType { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox };
 
+#if ENABLE(TOUCH_EVENTS)
+enum class TouchAction {
+    Auto,
+    Manipulation
+};
+#endif
+
 #if ENABLE(CSS_SCROLL_SNAP)
 enum class ScrollSnapType {
     None,

Modified: branches/safari-601-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2015-12-04 22:38:27 UTC (rev 193478)
@@ -77,6 +77,9 @@
     , m_justifyContent(RenderStyle::initialContentAlignment())
     , m_justifyItems(RenderStyle::initialSelfAlignment())
     , m_justifySelf(RenderStyle::initialSelfAlignment())
+#if ENABLE(TOUCH_EVENTS)
+    , m_touchAction(static_cast<unsigned>(RenderStyle::initialTouchAction()))
+#endif
 #if ENABLE(CSS_SCROLL_SNAP)
     , m_scrollSnapType(static_cast<unsigned>(RenderStyle::initialScrollSnapType()))
 #endif
@@ -166,6 +169,9 @@
     , m_justifyContent(o.m_justifyContent)
     , m_justifyItems(o.m_justifyItems)
     , m_justifySelf(o.m_justifySelf)
+#if ENABLE(TOUCH_EVENTS)
+    , m_touchAction(o.m_touchAction)
+#endif
 #if ENABLE(CSS_SCROLL_SNAP)
     , m_scrollSnapType(o.m_scrollSnapType)
 #endif
@@ -280,6 +286,9 @@
         && m_borderFit == o.m_borderFit
         && m_textCombine == o.m_textCombine
         && m_textDecorationStyle == o.m_textDecorationStyle
+#if ENABLE(TOUCH_EVENTS)
+        && m_touchAction == o.m_touchAction
+#endif
 #if ENABLE(CSS_SCROLL_SNAP)
         && m_scrollSnapType == o.m_scrollSnapType
 #endif

Modified: branches/safari-601-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (193477 => 193478)


--- branches/safari-601-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2015-12-04 22:38:27 UTC (rev 193478)
@@ -189,6 +189,10 @@
     StyleSelfAlignmentData m_justifyItems;
     StyleSelfAlignmentData m_justifySelf;
 
+#if ENABLE(TOUCH_EVENTS)
+    unsigned m_touchAction : 1; // TouchAction
+#endif
+
 #if ENABLE(CSS_SCROLL_SNAP)
     unsigned m_scrollSnapType : 2; // ScrollSnapType
 #endif

Modified: branches/safari-601-branch/Source/WebKit2/ChangeLog (193477 => 193478)


--- branches/safari-601-branch/Source/WebKit2/ChangeLog	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebKit2/ChangeLog	2015-12-04 22:38:27 UTC (rev 193478)
@@ -1,5 +1,25 @@
 2015-12-04  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r191452. rdar://problem/23732400
+
+    2015-10-22  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            Implement touch-action: manipulation; for iOS
+            https://bugs.webkit.org/show_bug.cgi?id=149854
+            <rdar://problem/23017145>
+
+            Reviewed by Benjamin Poulain.
+
+            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):
+
+2015-12-04  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r191409. rdar://problem/23732400
 
     2015-10-21  Wenson Hsieh  <wenson_hs...@apple.com>

Modified: branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (193477 => 193478)


--- branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-12-04 22:38:18 UTC (rev 193477)
+++ branches/safari-601-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-12-04 22:38:27 UTC (rev 193478)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -663,6 +663,12 @@
     m_potentialTapNode = m_page->mainFrame().nodeRespondingToClickEvents(position, m_potentialTapLocation);
     sendTapHighlightForNodeIfNecessary(requestID, m_potentialTapNode.get());
     if (m_potentialTapNode) {
+#if ENABLE(TOUCH_EVENTS)
+        if (!m_potentialTapNode->allowsDoubleTapGesture()) {
+            send(Messages::WebPageProxy::DisableDoubleTapGesturesUntilTapIsFinishedIfNecessary(requestID, false, FloatRect(), false, 0, 0));
+            return;
+        }
+#endif
         FloatPoint origin = position;
         FloatRect renderRect;
         bool isReplaced;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to