Changeset 247524 in webkit
- Timestamp:
- Jul 17, 2019, 11:23:38 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/ios/SelectionModifyByParagraphBoundary.h (added)
-
Tools/TestWebKitAPI/Tests/ios/SelectionModifyByParagraphBoundary.mm (added)
-
Tools/TestWebKitAPI/ios/UIKitSPI.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247510 r247524 1 2019-07-17 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Option + Up or Down Arrow key doesn’t move cursor past paragraph boundaries in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=199851 5 6 Reviewed by Wenson Hsieh. 7 8 The bug was caused by the difference in the way AppKit and UIKit responds to Option + Up / Down. 9 10 On macOS, AppKit sends moveForward before sending moveToStartOfParagraph and moveBackward 11 before sending moveToEndOfParagraph. As a result, when Option + Down is pressed when we are at 12 the end of a line, we would first move to the beginning of the next line (i.e. after the line break) 13 before moving or extending selection with the paragraph boundary granurality. 14 15 On iOS, UIKit only calls _moveToStartOfParagraph without moving forward by a character. As a result, 16 moving forward by the paragraph boundary granurality immediately stops when we're starting at the 17 end of a line when Option + Down is pressed. Option + Up case is similar. 18 19 Fix the bug on iOS by emulating what happens on macOS. Namely, move the selection forward or backward 20 by the character granurality before moving by the paragraph boundary granurality. 21 22 * UIProcess/ios/WKContentViewInteraction.mm: 23 (-[WKContentView _moveToStartOfParagraph:withHistory:]): 24 (-[WKContentView _moveToEndOfParagraph:withHistory:]): 25 1 26 2019-07-17 Carlos Garcia Campos <cgarcia@igalia.com> 2 27 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r247411 r247524 4936 4936 - (UITextInputArrowKeyHistory *)_moveToStartOfParagraph:(BOOL)extending withHistory:(UITextInputArrowKeyHistory *)history 4937 4937 { 4938 [self executeEditCommandWithCallback:extending ? @"moveBackwardAndModifySelection" : @"moveBackward"]; 4938 4939 [self executeEditCommandWithCallback:extending ? @"moveToBeginningOfParagraphAndModifySelection" : @"moveToBeginningOfParagraph"]; 4939 4940 return nil; … … 4960 4961 - (UITextInputArrowKeyHistory *)_moveToEndOfParagraph:(BOOL)extending withHistory:(UITextInputArrowKeyHistory *)history 4961 4962 { 4963 [self executeEditCommandWithCallback:extending ? @"moveForwardAndModifySelection" : @"moveForward"]; 4962 4964 [self executeEditCommandWithCallback:extending ? @"moveToEndOfParagraphAndModifySelection" : @"moveToEndOfParagraph"]; 4963 4965 return nil; -
trunk/Tools/ChangeLog
r247523 r247524 1 2019-07-17 Ryosuke Niwa <rniwa@webkit.org> 2 3 [iOS] Option + Up or Down Arrow key doesn’t move cursor past paragraph boundaries in WebKit2 4 https://bugs.webkit.org/show_bug.cgi?id=199851 5 6 Reviewed by Wenson Hsieh. 7 8 Added a regression test for iOS. Unfortunately, event sender, etc... doesn't work because 9 this code is getting directly triggered from UIKeyboard's code. 10 11 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 12 * TestWebKitAPI/Tests/ios/SelectionModifyByParagraphBoundary.h: Added. 13 * TestWebKitAPI/Tests/ios/SelectionModifyByParagraphBoundary.mm: Added. 14 * TestWebKitAPI/ios/UIKitSPI.h: 15 1 16 2019-07-17 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r247402 r247524 698 698 9B26FCCA159D16DE00CC3765 /* HTMLFormCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */; }; 699 699 9B270FEE1DDC2C0B002D53F3 /* closed-shadow-tree-test.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B270FED1DDC25FD002D53F3 /* closed-shadow-tree-test.html */; }; 700 9B4B5EA522DEBE19001E3D5A /* SelectionModifyByParagraphBoundary.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B4B5EA422DEBE19001E3D5A /* SelectionModifyByParagraphBoundary.mm */; }; 700 701 9B4F8FA7159D52DD002D9F94 /* HTMLCollectionNamedItem.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */; }; 701 702 9B59F12A2034086F009E63D5 /* mso-list-compat-mode.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9B59F12920340854009E63D5 /* mso-list-compat-mode.html */; }; … … 2020 2021 9B26FCB4159D15E700CC3765 /* HTMLFormCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLFormCollectionNamedItem.html; sourceTree = "<group>"; }; 2021 2022 9B270FED1DDC25FD002D53F3 /* closed-shadow-tree-test.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "closed-shadow-tree-test.html"; sourceTree = "<group>"; }; 2023 9B4B5EA422DEBE19001E3D5A /* SelectionModifyByParagraphBoundary.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SelectionModifyByParagraphBoundary.mm; sourceTree = "<group>"; }; 2022 2024 9B4F8FA3159D52B1002D9F94 /* HTMLCollectionNamedItem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HTMLCollectionNamedItem.mm; sourceTree = "<group>"; }; 2023 2025 9B4F8FA6159D52CA002D9F94 /* HTMLCollectionNamedItem.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = HTMLCollectionNamedItem.html; sourceTree = "<group>"; }; … … 2986 2988 F4C8797E2059D8D3009CD00B /* ScrollViewInsetTests.mm */, 2987 2989 0FF1134D22D68679009A81DA /* ScrollViewScrollabilityTests.mm */, 2990 9B4B5EA422DEBE19001E3D5A /* SelectionModifyByParagraphBoundary.mm */, 2988 2991 CE6E819F20A6935F00E2C80F /* SetTimeoutFunction.mm */, 2989 2992 4433A395208044130091ED57 /* SynchronousTimeoutTests.mm */, … … 4545 4548 0FF1134E22D68679009A81DA /* ScrollViewScrollabilityTests.mm in Sources */, 4546 4549 CE06DF9B1E1851F200E570C9 /* SecurityOrigin.cpp in Sources */, 4550 9B4B5EA522DEBE19001E3D5A /* SelectionModifyByParagraphBoundary.mm in Sources */, 4547 4551 5769C50B1D9B0002000847FB /* SerializedCryptoKeyWrap.mm in Sources */, 4548 4552 51EB12941FDF052500A5A1BD /* ServiceWorkerBasic.mm in Sources */, -
trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h
r246924 r247524 33 33 #import <UIKit/UIBarButtonItemGroup_Private.h> 34 34 #import <UIKit/UICalloutBar.h> 35 #import <UIKit/UIKeyboardImpl.h> 35 36 #import <UIKit/UIKeyboard_Private.h> 36 37 #import <UIKit/UIResponder_Private.h> … … 78 79 @class WebEvent; 79 80 81 @class UITextInputArrowKeyHistory; 82 80 83 @protocol UITextInputPrivate <UITextInput, UITextInputTraits_Private> 81 84 - (UITextInputTraits *)textInputTraits;
Note:
See TracChangeset
for help on using the changeset viewer.