Changeset 226067 in webkit
- Timestamp:
- Dec 18, 2017 12:13:56 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/fast/events/touch/ios/resources/basic-gestures.js
r222813 r226067 1 function didShowKeyboard() 2 { 3 return ` 4 (function() { 5 uiController.didShowKeyboardCallback = function() { 6 uiController.uiScriptComplete(); 7 } 8 })();` 9 } 10 11 1 12 function longPressAtPoint(x, y) 2 13 { … … 9 20 } 10 21 11 function longPressAndHoldAtPoint(X, Y) 22 function liftUpAtPoint(x, y) 23 { 24 return ` 25 (function() { 26 uiController.liftUpAtPoint(${x}, ${y}, 1, function() { 27 uiController.uiScriptComplete(); 28 }); 29 })();` 30 } 31 32 function longPressAndHoldAtPoint(x, y) 12 33 { 13 34 return ` … … 27 48 phase : "began", 28 49 id : 1, 29 x : ${ X},30 y : ${ Y},50 x : ${x}, 51 y : ${y}, 31 52 pressure : 0 32 53 } … … 41 62 phase : "moved", 42 63 id : 1, 43 x : ${ X},44 y : ${ Y},64 x : ${x}, 65 y : ${y}, 45 66 pressure : 0 46 67 } … … 98 119 x : ${endX}, 99 120 y : ${endY}, 121 pressure : 0 122 } 123 ] 124 } 125 }]}; 126 127 uiController.sendEventStream(JSON.stringify(eventStream), function() {}); 128 uiController.uiScriptComplete(); 129 })();` 130 } 131 132 function holdAtPoint(x, y) 133 { 134 return ` 135 (function() { 136 var eventStream = { 137 events : [ 138 { 139 interpolate : "linear", 140 timestep: 0.1, 141 coordinateSpace : "content", 142 startEvent : { 143 inputType : "hand", 144 timeOffset : 0, 145 touches : [ 146 { 147 inputType : "finger", 148 phase : "moved", 149 id : 1, 150 x : ${x}, 151 y : ${y}, 152 pressure : 0 153 } 154 ] 155 }, 156 endEvent : { 157 inputType : "hand", 158 timeOffset : 5.0, 159 touches : [ 160 { 161 inputType : "finger", 162 phase : "moved", 163 id : 1, 164 x : ${x}, 165 y : ${y}, 100 166 pressure : 0 101 167 } -
trunk/Source/WebCore/ChangeLog
r226066 r226067 1 2017-12-18 Megan Gardner <megan_gardner@apple.com> 2 3 Support Autoscrolling in contenteditable for WK2 4 https://bugs.webkit.org/show_bug.cgi?id=180789 5 6 Reviewed by Simon Frasier and Wenson Hsieh.. 7 8 Activate the autoscrollController to scroll to the position provided to us by the 9 UIProcess. Allows for scrolling in contentEditable for WebKit2 10 11 Test: fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html 12 13 * page/AutoscrollController.cpp: 14 (WebCore::AutoscrollController::autoscrollTimerFired): 15 * page/EventHandler.cpp: 16 (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded): 17 (WebCore::EventHandler::targetPositionForSelectionAutoscroll const): 18 (WebCore::EventHandler::shouldUpdateAutoscroll): 19 (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted. 20 * page/EventHandler.h: 21 * page/ios/EventHandlerIOS.mm: 22 (WebCore::EventHandler::startTextAutoscroll): 23 (WebCore::EventHandler::cancelTextAutoscroll): 24 (WebCore::EventHandler::targetPositionForSelectionAutoscroll const): 25 (WebCore::EventHandler::shouldUpdateAutoscroll): 26 * page/mac/EventHandlerMac.mm: 27 (WebCore::EventHandler::targetPositionForSelectionAutoscroll const): 28 (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted. 29 1 30 2017-12-18 Youenn Fablet <youenn@apple.com> 2 31 -
trunk/Source/WebCore/page/AutoscrollController.cpp
r222392 r226067 244 244 break; 245 245 case AutoscrollForSelection: { 246 if (!frame.eventHandler(). mousePressed()) {246 if (!frame.eventHandler().shouldUpdateAutoscroll()) { 247 247 stopAutoscrollTimer(); 248 248 return; … … 251 251 frame.eventHandler().updateSelectionForMouseDrag(); 252 252 #endif 253 m_autoscrollRenderer->autoscroll(frame.eventHandler(). effectiveMousePositionForSelectionAutoscroll());253 m_autoscrollRenderer->autoscroll(frame.eventHandler().targetPositionInWindowForSelectionAutoscroll()); 254 254 break; 255 255 } -
trunk/Source/WebCore/page/EventHandler.cpp
r225494 r226067 2682 2682 } 2683 2683 2684 IntPoint EventHandler::effectiveMousePositionForSelectionAutoscroll() const 2684 void EventHandler::clearOrScheduleClearingLatchedStateIfNeeded(const PlatformWheelEvent&) 2685 { 2686 clearLatchedState(); 2687 } 2688 2689 #if !PLATFORM(IOS) 2690 2691 IntPoint EventHandler::targetPositionInWindowForSelectionAutoscroll() const 2685 2692 { 2686 2693 return m_lastKnownMousePosition; 2687 2694 } 2688 2689 void EventHandler::clearOrScheduleClearingLatchedStateIfNeeded(const PlatformWheelEvent&) 2690 { 2691 clearLatchedState(); 2692 } 2693 #endif 2695 2696 #endif // !PLATFORM(IOS) 2697 2698 #endif // !PLATFORM(MAC) 2699 2700 #if !PLATFORM(IOS) 2701 2702 bool EventHandler::shouldUpdateAutoscroll() 2703 { 2704 return mousePressed(); 2705 } 2706 2707 #endif // !PLATFORM(IOS) 2694 2708 2695 2709 Widget* EventHandler::widgetForEventTarget(Element* eventTarget) -
trunk/Source/WebCore/page/EventHandler.h
r224459 r226067 32 32 #include "LayoutPoint.h" 33 33 #include "PlatformMouseEvent.h" 34 #include "RenderObject.h" 34 35 #include "ScrollTypes.h" 35 36 #include "TextEventInputType.h" … … 189 190 Cursor currentMouseCursor() const { return m_currentMouseCursor; } 190 191 191 IntPoint effectiveMousePositionForSelectionAutoscroll() const; 192 IntPoint targetPositionInWindowForSelectionAutoscroll() const; 193 bool shouldUpdateAutoscroll(); 192 194 193 195 static Frame* subframeForTargetNode(Node*); … … 333 335 WEBCORE_EXPORT bool tryToBeginDataInteractionAtPoint(const IntPoint& clientPosition, const IntPoint& globalPosition); 334 336 #endif 337 338 #if PLATFORM(IOS) 339 WEBCORE_EXPORT void startTextAutoscroll(RenderObject* renderer, const FloatPoint& positionInWindow); 340 WEBCORE_EXPORT void cancelTextAutoscroll(); 341 IntPoint m_targetAutoscrollPositionInWindow; 342 bool m_isAutoscrolling { false }; 343 #endif 335 344 336 345 private: -
trunk/Source/WebCore/page/ios/EventHandlerIOS.mm
r222595 r226067 28 28 29 29 #import "AXObjectCache.h" 30 #import "AutoscrollController.h" 30 31 #import "Chrome.h" 31 32 #import "ChromeClient.h" … … 559 560 return PlatformEventFactory::createPlatformMouseEvent(currentEvent()); 560 561 } 562 563 void EventHandler::startTextAutoscroll(RenderObject* renderer, const FloatPoint& positionInWindow) 564 { 565 m_targetAutoscrollPositionInWindow = roundedIntPoint(positionInWindow); 566 m_isAutoscrolling = true; 567 m_autoscrollController->startAutoscrollForSelection(renderer); 568 } 569 570 void EventHandler::cancelTextAutoscroll() 571 { 572 m_isAutoscrolling = false; 573 m_autoscrollController->stopAutoscrollTimer(); 574 } 575 576 IntPoint EventHandler::targetPositionInWindowForSelectionAutoscroll() const 577 { 578 return m_targetAutoscrollPositionInWindow; 579 } 580 581 bool EventHandler::shouldUpdateAutoscroll() 582 { 583 return m_isAutoscrolling; 584 } 561 585 562 586 #if ENABLE(DRAG_SUPPORT) -
trunk/Source/WebCore/page/mac/EventHandlerMac.mm
r225142 r226067 1142 1142 } 1143 1143 1144 IntPoint EventHandler:: effectiveMousePositionForSelectionAutoscroll() const1144 IntPoint EventHandler::targetPositionInWindowForSelectionAutoscroll() const 1145 1145 { 1146 1146 Page* page = m_frame.page(); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r225983 r226067 2753 2753 } 2754 2754 2755 void RenderLayer::autoscroll(const IntPoint& position )2756 { 2757 IntPoint currentDocumentPosition = renderer().view().frameView().windowToContents(position );2755 void RenderLayer::autoscroll(const IntPoint& positionInWindow) 2756 { 2757 IntPoint currentDocumentPosition = renderer().view().frameView().windowToContents(positionInWindow); 2758 2758 scrollRectToVisible(SelectionRevealMode::Reveal, LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 2759 2759 } -
trunk/Source/WebKit/ChangeLog
r226066 r226067 1 2017-12-18 Megan Gardner <megan_gardner@apple.com> 2 3 Support Autoscrolling in contenteditable for WK2 4 https://bugs.webkit.org/show_bug.cgi?id=180789 5 6 Reviewed by Simon Frasier and Wenson Hsieh. 7 8 Implements the UIKit protocol for autoscrolling and alerts the Web Process to start 9 (or stop) an autoscroll to the specified position. Allows for scrolling in contenteditable 10 in WebKit2. 11 12 * Platform/spi/ios/UIKitSPI.h: 13 * UIProcess/WebPageProxy.h: 14 * UIProcess/ios/WKContentViewInteraction.h: 15 * UIProcess/ios/WKContentViewInteraction.mm: 16 (-[WKContentView startAutoscroll:]): 17 (-[WKContentView cancelAutoscroll]): 18 (-[WKContentView scrollSelectionToVisible:]): 19 * UIProcess/ios/WebPageProxyIOS.mm: 20 (WebKit::WebPageProxy::startAutoscrollAtPosition): 21 (WebKit::WebPageProxy::cancelAutoscroll): 22 * WebProcess/WebPage/WebPage.h: 23 * WebProcess/WebPage/WebPage.messages.in: 24 * WebProcess/WebPage/ios/WebPageIOS.mm: 25 (WebKit::WebPage::startAutoscrollAtPosition): 26 (WebKit::WebPage::cancelAutoscroll): 27 1 28 2017-12-18 Youenn Fablet <youenn@apple.com> 2 29 -
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
r225958 r226067 626 626 @end 627 627 628 @protocol UITextAutoscrolling 629 - (void)startAutoscroll:(CGPoint)point; 630 - (void)cancelAutoscroll; 631 - (void)scrollSelectionToVisible:(BOOL)animated; 632 @end 633 634 628 635 @protocol UIWebFormAccessoryDelegate; 629 636 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r226016 r226067 583 583 void autofillLoginCredentials(const String& username, const String& password); 584 584 void storeSelectionForAccessibility(bool); 585 void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow); 586 void cancelAutoscroll(); 585 587 #if ENABLE(DATA_INTERACTION) 586 588 void didPerformDataInteractionControllerOperation(bool handled); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r224029 r226067 242 242 @end 243 243 244 @interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UIWebTouchEventsGestureRecognizerDelegate, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWKInteractionViewProtocol, WKFileUploadPanelDelegate, WKActionSheetAssistantDelegate 244 @interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UIWebTouchEventsGestureRecognizerDelegate, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWKInteractionViewProtocol, WKFileUploadPanelDelegate, WKActionSheetAssistantDelegate, UITextAutoscrolling 245 245 #if ENABLE(DATA_INTERACTION) 246 246 , UIDragInteractionDelegate, UIDropInteractionDelegate -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r226048 r226067 691 691 return _page->unobscuredContentRect(); 692 692 } 693 694 695 #pragma mark - UITextAutoscrolling 696 - (void)startAutoscroll:(CGPoint)point 697 { 698 _page->startAutoscrollAtPosition(point); 699 } 700 701 - (void)cancelAutoscroll 702 { 703 _page->cancelAutoscroll(); 704 } 705 706 - (void)scrollSelectionToVisible:(BOOL)animated 707 { 708 // Used to scroll selection on keyboard up; we already scroll to visible. 709 } 710 693 711 694 712 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r225562 r226067 714 714 } 715 715 716 void WebPageProxy::startAutoscrollAtPosition(const WebCore::FloatPoint& position) 717 { 718 m_process->send(Messages::WebPage::StartAutoscrollAtPosition(position), m_pageID); 719 } 720 721 void WebPageProxy::cancelAutoscroll() 722 { 723 m_process->send(Messages::WebPage::CancelAutoscroll(), m_pageID); 724 } 725 716 726 void WebPageProxy::moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&& callbackFunction) 717 727 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r226016 r226067 606 606 void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID); 607 607 void storeSelectionForAccessibility(bool); 608 void startAutoscrollAtPosition(const WebCore::FloatPoint&); 609 void cancelAutoscroll(); 608 610 609 611 void contentSizeCategoryDidChange(const String&); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r226008 r226067 100 100 GetRectsAtSelectionOffsetWithText(int32_t offset, String text, WebKit::CallbackID callbackID) 101 101 StoreSelectionForAccessibility(bool shouldStore) 102 StartAutoscrollAtPosition(WebCore::FloatPoint positionInWindow) 103 CancelAutoscroll() 102 104 #endif 103 105 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r225715 r226067 1382 1382 send(Messages::WebPageProxy::VoidCallback(callbackID)); 1383 1383 } 1384 1385 void WebPage::startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow) 1386 { 1387 if (m_assistedNode && m_assistedNode->renderer()) 1388 m_page->mainFrame().eventHandler().startTextAutoscroll(m_assistedNode->renderer(), positionInWindow); 1389 } 1390 1391 void WebPage::cancelAutoscroll() 1392 { 1393 m_page->mainFrame().eventHandler().cancelTextAutoscroll(); 1394 } 1384 1395 1385 1396 void WebPage::getRectsForGranularityWithSelectionOffset(uint32_t granularity, int32_t offset, CallbackID callbackID) -
trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj
r225320 r226067 186 186 0F74B93C1F89713E00B935D3 /* CryptoRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CryptoRandom.h; path = bmalloc/CryptoRandom.h; sourceTree = "<group>"; }; 187 187 0F74B93D1F89713E00B935D3 /* CryptoRandom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoRandom.cpp; path = bmalloc/CryptoRandom.cpp; sourceTree = "<group>"; }; 188 0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = libtestbmalloc; path = testbmalloc; sourceTree = BUILT_PRODUCTS_DIR; };188 0F7EB7EF1F95285300F1ABCB /* testbmalloc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testbmalloc; sourceTree = BUILT_PRODUCTS_DIR; }; 189 189 0F7EB7F11F95285300F1ABCB /* testbmalloc.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = testbmalloc.cpp; sourceTree = "<group>"; }; 190 190 0F7EB7FC1F9541AD00F1ABCB /* EligibilityResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EligibilityResult.h; path = bmalloc/EligibilityResult.h; sourceTree = SOURCE_ROOT; }; … … 417 417 14F271BE18EA3963008C152F /* libbmalloc.a */, 418 418 14CC394418EA8743004AFE34 /* libmbmalloc.dylib */, 419 0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */,419 0F7EB7EF1F95285300F1ABCB /* testbmalloc */, 420 420 ); 421 421 name = Products; … … 660 660 name = testbmalloc; 661 661 productName = testbmalloc; 662 productReference = 0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */;662 productReference = 0F7EB7EF1F95285300F1ABCB /* testbmalloc */; 663 663 productType = "com.apple.product-type.tool"; 664 664 };
Note: See TracChangeset
for help on using the changeset viewer.