Changeset 191452 in webkit
- Timestamp:
- Oct 22, 2015 6:54:55 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r191446 r191452 1 2015-10-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Implement touch-action: manipulation; for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=149854 5 <rdar://problem/23017145> 6 7 Reviewed by Benjamin Poulain. 8 9 Add tests to check that the manipulation and auto values of the touch-action property can be 10 properly parsed and can be obtained through computed style. Also tests that putting touch-action: 11 manipulation on an element and tapping repeatedly on it will fire clicks instead of recognizing 12 double taps and causing the viewport to zoom. 13 14 * TestExpectations: 15 * css3/touch-action/touch-action-computed-style-expected.txt: Added. 16 * css3/touch-action/touch-action-computed-style.html: Added. 17 * css3/touch-action/touch-action-manipulation-fast-clicks-expected.txt: Added. 18 * css3/touch-action/touch-action-manipulation-fast-clicks.html: Added. 19 * css3/touch-action/touch-action-parsing-expected.txt: Added. 20 * css3/touch-action/touch-action-parsing.html: Added. 21 * platform/ios-simulator-wk2/TestExpectations: 22 1 23 2015-10-22 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 24 -
trunk/LayoutTests/TestExpectations
r191384 r191452 7 7 #////////////////////////////////////////////////////////////////////////////////////////// 8 8 9 css3/touch-action [ Skip ] 9 10 accessibility/ios-simulator [ Skip ] 10 11 accessibility/gtk [ Skip ] -
trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations
r190644 r191452 7 7 #////////////////////////////////////////////////////////////////////////////////////////// 8 8 9 css3/touch-action [ Pass ] 9 10 fast/harness/ui-side-scripts.html [ Pass ] 10 11 fast/harness/concurrent-ui-side-scripts.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r191451 r191452 1 2015-10-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Implement touch-action: manipulation; for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=149854 5 <rdar://problem/23017145> 6 7 Reviewed by Benjamin Poulain. 8 9 Implements the manipulation value for the CSS property touch-action. Adds support for 10 parsing the touch-action property and two of its values: auto and manipulation. 11 12 Tests: css3/touch-action/touch-action-computed-style.html 13 css3/touch-action/touch-action-manipulation-fast-clicks.html 14 css3/touch-action/touch-action-parsing.html 15 16 * css/CSSComputedStyleDeclaration.cpp: 17 (WebCore::ComputedStyleExtractor::propertyValue): 18 * css/CSSParser.cpp: 19 (WebCore::isValidKeywordPropertyAndValue): 20 (WebCore::isKeywordPropertyID): 21 (WebCore::CSSParser::parseValue): 22 * css/CSSPrimitiveValueMappings.h: 23 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 24 (WebCore::CSSPrimitiveValue::operator TouchAction): 25 * css/CSSPropertyNames.in: 26 * css/CSSValueKeywords.in: 27 * dom/Element.cpp: 28 (WebCore::Element::allowsDoubleTapGesture): Here, we determine whether an element that resulted from 29 hit-testing a touch should allow double-tap gestures. To do this, we walk up the element's parents, 30 stopping when we detect an element that disallows double tap gestures by having a touch-action other 31 than auto or by hitting the root node. 32 * dom/Element.h: 33 * dom/Node.h: 34 (WebCore::Node::allowsDoubleTapGesture): 35 * rendering/style/RenderStyle.h: 36 * rendering/style/RenderStyleConstants.h: 37 * rendering/style/StyleRareNonInheritedData.cpp: 38 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 39 (WebCore::StyleRareNonInheritedData::operator==): 40 * rendering/style/StyleRareNonInheritedData.h: 41 1 42 2015-10-22 Ryosuke Niwa <rniwa@webkit.org> 2 43 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r191178 r191452 3194 3194 case CSSPropertyWebkitTapHighlightColor: 3195 3195 return currentColorOrValidColor(style.get(), style->tapHighlightColor()); 3196 case CSSPropertyTouchAction: 3197 return cssValuePool.createValue(style->touchAction()); 3196 3198 #endif 3197 3199 #if PLATFORM(IOS) -
trunk/Source/WebCore/css/CSSParser.cpp
r191252 r191452 755 755 return true; 756 756 break; 757 #if ENABLE(TOUCH_EVENTS) 758 case CSSPropertyTouchAction: // auto | manipulation 759 if (valueID == CSSValueAuto || valueID == CSSValueManipulation) 760 return true; 761 break; 762 #endif 757 763 #if ENABLE(CSS_SCROLL_SNAP) 758 764 case CSSPropertyWebkitScrollSnapType: // none | mandatory | proximity … … 1177 1183 case CSSPropertyWordBreak: 1178 1184 case CSSPropertyWordWrap: 1185 #if ENABLE(TOUCH_EVENTS) 1186 case CSSPropertyTouchAction: 1187 #endif 1179 1188 #if ENABLE(CSS_SCROLL_SNAP) 1180 1189 case CSSPropertyWebkitScrollSnapType: … … 3268 3277 case CSSPropertyWordBreak: 3269 3278 case CSSPropertyWordWrap: 3279 #if ENABLE(TOUCH_EVENTS) 3280 case CSSPropertyTouchAction: 3281 #endif 3270 3282 #if ENABLE(CSS_SCROLL_SNAP) 3271 3283 case CSSPropertyWebkitScrollSnapType: -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r191014 r191452 5253 5253 } 5254 5254 5255 #if ENABLE(TOUCH_EVENTS) 5256 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TouchAction touchAction) 5257 : CSSValue(PrimitiveClass) 5258 { 5259 m_primitiveUnitType = CSS_VALUE_ID; 5260 switch (touchAction) { 5261 case TouchAction::Auto: 5262 m_value.valueID = CSSValueAuto; 5263 break; 5264 case TouchAction::Manipulation: 5265 m_value.valueID = CSSValueManipulation; 5266 break; 5267 } 5268 } 5269 5270 template<> inline CSSPrimitiveValue::operator TouchAction() const 5271 { 5272 ASSERT(isValueID()); 5273 switch (m_value.valueID) { 5274 case CSSValueAuto: 5275 return TouchAction::Auto; 5276 case CSSValueManipulation: 5277 return TouchAction::Manipulation; 5278 default: 5279 break; 5280 } 5281 ASSERT_NOT_REACHED(); 5282 return TouchAction::Auto; 5283 } 5284 #endif 5285 5255 5286 #if ENABLE(CSS_SCROLL_SNAP) 5256 5287 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ScrollSnapType e) -
trunk/Source/WebCore/css/CSSPropertyNames.in
r191184 r191452 667 667 -webkit-overflow-scrolling [Inherited, NameForMethods=UseTouchOverflowScrolling, Converter=OverflowScrolling] 668 668 #endif 669 #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS 670 touch-action 671 #endif 669 672 #if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS 670 673 -webkit-touch-callout [Inherited, NameForMethods=TouchCalloutEnabled, Converter=TouchCallout] -
trunk/Source/WebCore/css/CSSValueKeywords.in
r191252 r191452 1173 1173 scroll-position 1174 1174 contents 1175 1176 #if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS 1177 // touch-action 1178 manipulation 1179 #endif -
trunk/Source/WebCore/dom/Element.cpp
r191451 r191452 5 5 * (C) 2001 Dirk Mueller (mueller@kde.org) 6 6 * (C) 2007 David Smith (catfish.man@gmail.com) 7 * Copyright (C) 2004-201 4Apple Inc. All rights reserved.7 * Copyright (C) 2004-2015 Apple Inc. All rights reserved. 8 8 * (C) 2007 Eric Seidel (eric@webkit.org) 9 9 * … … 1382 1382 } 1383 1383 1384 #if ENABLE(TOUCH_EVENTS) 1385 bool Element::allowsDoubleTapGesture() const 1386 { 1387 if (renderStyle() && renderStyle()->touchAction() != TouchAction::Auto) 1388 return false; 1389 1390 Element* parent = parentElement(); 1391 return !parent || parent->allowsDoubleTapGesture(); 1392 } 1393 #endif 1394 1384 1395 StyleResolver& Element::styleResolver() 1385 1396 { -
trunk/Source/WebCore/dom/Element.h
r191451 r191452 488 488 WEBCORE_EXPORT URL absoluteLinkURL() const; 489 489 490 #if ENABLE(TOUCH_EVENTS) 491 virtual bool allowsDoubleTapGesture() const override; 492 #endif 493 490 494 StyleResolver& styleResolver(); 491 495 Ref<RenderStyle> resolveStyle(RenderStyle* parentStyle); -
trunk/Source/WebCore/dom/Node.h
r191327 r191452 530 530 bool dispatchDOMActivateEvent(int detail, PassRefPtr<Event> underlyingEvent); 531 531 532 #if ENABLE(TOUCH_EVENTS) 533 virtual bool allowsDoubleTapGesture() const { return true; } 534 #endif 535 532 536 #if ENABLE(TOUCH_EVENTS) && !PLATFORM(IOS) 533 537 bool dispatchTouchEvent(PassRefPtr<TouchEvent>); -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r191128 r191452 1119 1119 int initialLetterDrop() const { return initialLetter().width(); } 1120 1120 int initialLetterHeight() const { return initialLetter().height(); } 1121 1122 #if ENABLE(TOUCH_EVENTS) 1123 TouchAction touchAction() const { return static_cast<TouchAction>(rareNonInheritedData->m_touchAction); } 1124 #endif 1121 1125 1122 1126 #if ENABLE(CSS_SCROLL_SNAP) … … 1680 1684 void setInitialLetter(const IntSize& size) { SET_VAR(rareNonInheritedData, m_initialLetter, size); } 1681 1685 1686 #if ENABLE(TOUCH_EVENTS) 1687 void setTouchAction(TouchAction touchAction) { SET_VAR(rareNonInheritedData, m_touchAction, static_cast<unsigned>(touchAction)); } 1688 #endif 1689 1682 1690 #if ENABLE(CSS_SCROLL_SNAP) 1683 1691 void setScrollSnapType(ScrollSnapType type) { SET_VAR(rareNonInheritedData, m_scrollSnapType, static_cast<unsigned>(type)); } … … 2033 2041 static WillChangeData* initialWillChange() { return nullptr; } 2034 2042 2043 #if ENABLE(TOUCH_EVENTS) 2044 static TouchAction initialTouchAction() { return TouchAction::Auto; } 2045 #endif 2046 2035 2047 #if ENABLE(CSS_SCROLL_SNAP) 2036 2048 static ScrollSnapType initialScrollSnapType() { return ScrollSnapType::None; } -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r191310 r191452 644 644 enum CSSBoxType { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox }; 645 645 646 #if ENABLE(TOUCH_EVENTS) 647 enum class TouchAction { 648 Auto, 649 Manipulation 650 }; 651 #endif 652 646 653 #if ENABLE(CSS_SCROLL_SNAP) 647 654 enum class ScrollSnapType { -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r191017 r191452 80 80 , m_justifyItems(RenderStyle::initialSelfAlignment()) 81 81 , m_justifySelf(RenderStyle::initialSelfAlignment()) 82 #if ENABLE(TOUCH_EVENTS) 83 , m_touchAction(static_cast<unsigned>(RenderStyle::initialTouchAction())) 84 #endif 82 85 #if ENABLE(CSS_SCROLL_SNAP) 83 86 , m_scrollSnapType(static_cast<unsigned>(RenderStyle::initialScrollSnapType())) … … 169 172 , m_justifyItems(o.m_justifyItems) 170 173 , m_justifySelf(o.m_justifySelf) 174 #if ENABLE(TOUCH_EVENTS) 175 , m_touchAction(o.m_touchAction) 176 #endif 171 177 #if ENABLE(CSS_SCROLL_SNAP) 172 178 , m_scrollSnapType(o.m_scrollSnapType) … … 283 289 && m_textCombine == o.m_textCombine 284 290 && m_textDecorationStyle == o.m_textDecorationStyle 291 #if ENABLE(TOUCH_EVENTS) 292 && m_touchAction == o.m_touchAction 293 #endif 285 294 #if ENABLE(CSS_SCROLL_SNAP) 286 295 && m_scrollSnapType == o.m_scrollSnapType -
trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h
r191017 r191452 185 185 StyleSelfAlignmentData m_justifySelf; 186 186 187 #if ENABLE(TOUCH_EVENTS) 188 unsigned m_touchAction : 1; // TouchAction 189 #endif 190 187 191 #if ENABLE(CSS_SCROLL_SNAP) 188 192 unsigned m_scrollSnapType : 2; // ScrollSnapType -
trunk/Source/WebKit2/ChangeLog
r191451 r191452 1 2015-10-22 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Implement touch-action: manipulation; for iOS 4 https://bugs.webkit.org/show_bug.cgi?id=149854 5 <rdar://problem/23017145> 6 7 Reviewed by Benjamin Poulain. 8 9 Implements the manipulation value for the CSS property touch-action. Performs hit-testing upon receiving a potential 10 tap to determine whether to disable double-tap gesture recognition over the duration of the tap. If so, sends a message 11 from the web process to the UI process indicating that double-tapping should be disabled, allowing single taps to 12 avoid the delay. 13 14 * WebProcess/WebPage/ios/WebPageIOS.mm: 15 (WebKit::WebPage::potentialTapAtPosition): 16 1 17 2015-10-22 Ryosuke Niwa <rniwa@webkit.org> 2 18 -
trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm
r191381 r191452 1 1 /* 2 * Copyright (C) 2012-201 4Apple Inc. All rights reserved.2 * Copyright (C) 2012-2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 666 666 sendTapHighlightForNodeIfNecessary(requestID, m_potentialTapNode.get()); 667 667 if (m_potentialTapNode) { 668 #if ENABLE(TOUCH_EVENTS) 669 if (!m_potentialTapNode->allowsDoubleTapGesture()) { 670 send(Messages::WebPageProxy::DisableDoubleTapGesturesUntilTapIsFinishedIfNecessary(requestID, false, FloatRect(), false, 0, 0)); 671 return; 672 } 673 #endif 668 674 FloatPoint origin = position; 669 675 FloatRect renderRect;
Note: See TracChangeset
for help on using the changeset viewer.