WebKit Bugzilla
Attachment 346978 Details for
Bug 188485
: [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188485-20180811202042.patch (text/plain), 21.77 KB, created by
Wenson Hsieh
on 2018-08-11 20:20:43 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-08-11 20:20:43 PDT
Size:
21.77 KB
patch
obsolete
>Subversion Revision: 234777 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index fb3b1d364e0925d6fae3aa7139fa1eaf66f71c6c..9eb8b83412d2b279ef3468abedb88f670f490a7f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,56 @@ >+2018-08-11 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup >+ https://bugs.webkit.org/show_bug.cgi?id=188485 >+ <rdar://problem/43168784> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Before r223678, -typeIdentifiersToLoadForRegisteredTypeIdentifiers:, which is responsible for determining which >+ type identifiers to load upon performing a drop, returned the following when dropping a rich text selection onto >+ a textarea: >+ >+ "public.plain-text", >+ "public.html" >+ >+ After r223678, we now propagate a custom pasteboard data type when dragging, and the same list now looks like: >+ >+ "com.apple.WebKit.custom-pasteboard-data", >+ "public.html", >+ "public.plain-text" >+ >+ Subsequently, logic in `-_preLoadedDataConformingToType:â¦` (responsible for mapping a requested type identifier >+ to data that has been loaded from an item provider) iterates through the aforementioned list of type identifiers >+ and selects the data of the first type identifier in the list that conforms to the requested type identifier. >+ However, this list of type identifiers is currently the result of `-[NSSet allObjects]`, which means that the >+ type identifiers in the list are in no particular order! >+ >+ As such, this particular use case only worked by accident prior to r223678, and after that change, this latent >+ bug was surfaced. The patch here makes two adjustments to pasteboard handling on iOS to fix the bug. >+ >+ Test: DragAndDropTests.NonEditableTextSelectionToTextarea >+ >+ * platform/ios/PasteboardIOS.mm: >+ (WebCore::Pasteboard::read): >+ >+ When reading plain text from the pasteboard, give "public.plain-text" priority over "public.text". This ensures >+ that we don't end up reading markup as "plain text" when there's already more relevant plain text data present >+ in the pasteboard. >+ >+ * platform/ios/WebItemProviderPasteboard.mm: >+ (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): >+ >+ Refactor existing logic to enforce a consistent ordering of type identifiers to load. First, we use >+ NSMutableOrderedSet instead of just an NSMutableSet to store type identifiers we've added. Secondly, move all >+ logic to insert type identifiers into this set to the end of the method, where we iterate over all of the type >+ identifiers in order and add each type identifier to the set if needed. This ensures that the order of resulting >+ types is from highest to lowest fidelity. >+ >+ (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]): >+ (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]): Deleted. >+ >+ Fix a typo in the method name. >+ > 2018-08-10 Daniel Bates <dabates@apple.com> > > Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore() >diff --git a/Source/WebCore/platform/ios/PasteboardIOS.mm b/Source/WebCore/platform/ios/PasteboardIOS.mm >index d26c5848efeba5363f10d3c338f9acc09e3d577c..7d82c093903cc4b2fc8b6ade18368cf2d98403f0 100644 >--- a/Source/WebCore/platform/ios/PasteboardIOS.mm >+++ b/Source/WebCore/platform/ios/PasteboardIOS.mm >@@ -148,14 +148,14 @@ void Pasteboard::read(PasteboardPlainText& text) > { > PasteboardStrategy& strategy = *platformStrategies()->pasteboardStrategy(); > text.text = strategy.readStringFromPasteboard(0, kUTTypeURL, m_pasteboardName); >- if (!text.text.isNull() && !text.text.isEmpty()) { >+ if (!text.text.isEmpty()) { > text.isURL = true; > return; > } > >- text.text = strategy.readStringFromPasteboard(0, kUTTypeText, m_pasteboardName); >+ text.text = strategy.readStringFromPasteboard(0, kUTTypePlainText, m_pasteboardName); > if (text.text.isEmpty()) >- text.text = strategy.readStringFromPasteboard(0, kUTTypePlainText, m_pasteboardName); >+ text.text = strategy.readStringFromPasteboard(0, kUTTypeText, m_pasteboardName); > > text.isURL = false; > } >diff --git a/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm b/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm >index 399f9e0e03ab51f1aacc0e5a821348bb1bf0f3eb..db3cf9cfb5e41ce54e178da966b87580b8e813b6 100644 >--- a/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm >+++ b/Source/WebCore/platform/ios/WebItemProviderPasteboard.mm >@@ -685,13 +685,14 @@ static NSURL *linkTemporaryItemProviderFilesToDropStagingDirectory(NSURL *url, N > return [fileManager linkItemAtURL:url toURL:destination error:nil] ? destination : nil; > } > >-- (NSArray<NSString *> *)typeIdentifiersToLoadForRegisteredTypeIdentfiers:(NSArray<NSString *> *)registeredTypeIdentifiers >+- (NSArray<NSString *> *)typeIdentifiersToLoadForRegisteredTypeIdentifiers:(NSArray<NSString *> *)registeredTypeIdentifiers > { >- NSMutableSet *typesToLoad = [NSMutableSet set]; >+ auto typesToLoad = adoptNS([[NSMutableOrderedSet alloc] init]); >+ NSString *highestFidelitySupportedType = nil; > NSString *highestFidelityContentType = nil; > > BOOL containsFlatRTFD = [registeredTypeIdentifiers containsObject:(NSString *)kUTTypeFlatRTFD]; >- // First, we want to either load the highest fidelity supported type or the highest fidelity generic content type. >+ // First, search for the highest fidelity supported type or the highest fidelity generic content type. > for (NSString *registeredTypeIdentifier in registeredTypeIdentifiers) { > if (containsFlatRTFD && [registeredTypeIdentifier isEqualToString:(NSString *)kUTTypeRTFD]) { > // In the case where attachments are enabled and we're accepting all types of content using attachment >@@ -703,34 +704,27 @@ static NSURL *linkTemporaryItemProviderFilesToDropStagingDirectory(NSURL *url, N > continue; > } > >- if (typeConformsToTypes(registeredTypeIdentifier, _supportedTypeIdentifiers.get())) { >- [typesToLoad addObject:registeredTypeIdentifier]; >- break; >- } >+ if (!highestFidelitySupportedType && typeConformsToTypes(registeredTypeIdentifier, _supportedTypeIdentifiers.get())) >+ highestFidelitySupportedType = registeredTypeIdentifier; > > if (!highestFidelityContentType && UTTypeConformsTo((CFStringRef)registeredTypeIdentifier, kUTTypeContent)) > highestFidelityContentType = registeredTypeIdentifier; > } >- if (!typesToLoad.count && highestFidelityContentType) >- [typesToLoad addObject:highestFidelityContentType]; > > // For compatibility with DataTransfer APIs, additionally load web-exposed types. Since this is the only chance to > // fault in any data at all, we need to load up front any information that the page may ask for later down the line. > NSString *customPasteboardDataUTI = @(PasteboardCustomData::cocoaType()); > for (NSString *registeredTypeIdentifier in registeredTypeIdentifiers) { >- if ([typesToLoad containsObject:registeredTypeIdentifier]) >- continue; >- if ([registeredTypeIdentifier isEqualToString:customPasteboardDataUTI]) >- [typesToLoad addObject:customPasteboardDataUTI]; >- if (UTTypeConformsTo((CFStringRef)registeredTypeIdentifier, kUTTypeURL)) >- [typesToLoad addObject:(NSString *)kUTTypeURL]; >- if (UTTypeConformsTo((CFStringRef)registeredTypeIdentifier, kUTTypeHTML)) >- [typesToLoad addObject:(NSString *)kUTTypeHTML]; >- if (UTTypeConformsTo((CFStringRef)registeredTypeIdentifier, kUTTypePlainText)) >- [typesToLoad addObject:(NSString *)kUTTypePlainText]; >+ if ([registeredTypeIdentifier isEqualToString:highestFidelityContentType] >+ || [registeredTypeIdentifier isEqualToString:highestFidelitySupportedType] >+ || [registeredTypeIdentifier isEqualToString:customPasteboardDataUTI] >+ || UTTypeConformsTo((CFStringRef)registeredTypeIdentifier, kUTTypeURL) >+ || UTTypeConformsTo((CFStringRef)registeredTypeIdentifier, kUTTypeHTML) >+ || UTTypeConformsTo((CFStringRef)registeredTypeIdentifier, kUTTypePlainText)) >+ [typesToLoad addObject:registeredTypeIdentifier]; > } > >- return typesToLoad.allObjects; >+ return [typesToLoad array]; > } > > - (void)doAfterLoadingProvidedContentIntoFileURLs:(WebItemProviderFileLoadBlock)action >@@ -749,7 +743,7 @@ static NSURL *linkTemporaryItemProviderFilesToDropStagingDirectory(NSURL *url, N > BOOL foundAnyDataToLoad = NO; > RetainPtr<WebItemProviderPasteboard> protectedSelf = self; > for (NSItemProvider *itemProvider in _itemProviders.get()) { >- NSArray<NSString *> *typeIdentifiersToLoad = [protectedSelf typeIdentifiersToLoadForRegisteredTypeIdentfiers:itemProvider.registeredTypeIdentifiers]; >+ NSArray<NSString *> *typeIdentifiersToLoad = [protectedSelf typeIdentifiersToLoadForRegisteredTypeIdentifiers:itemProvider.registeredTypeIdentifiers]; > foundAnyDataToLoad |= typeIdentifiersToLoad.count; > [loadResults addObject:[WebItemProviderLoadResult loadResultWithItemProvider:itemProvider typesToLoad:typeIdentifiersToLoad]]; > } >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index cf2a4a57e25ccac46386d887f9696e18ce930765..11fba84a5418e3e3c1b77e2120f9cff121d67cae 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,25 @@ >+2018-08-11 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup >+ https://bugs.webkit.org/show_bug.cgi?id=188485 >+ <rdar://problem/43168784> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new API test to verify that dropping selected non-editable rich text into a textarea inserts text as >+ expected, rather than markup. >+ >+ It's somewhat interesting to note that this particular use case isn't exercised by any existing tests; the >+ closest test is DragAndDropTests.ContentEditableToTextarea, which drags a rich text selection from a >+ contenteditable element to a text area. However, due to logic in `DragController::concludeEditDrag` that handles >+ drag and drop across editable content differently than drag and drop from non-editable to editable content, the >+ bug that is fixed here doesn't surface in that existing test. >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WebKitCocoa/selected-text-and-textarea.html: Added. >+ * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm: >+ (TestWebKitAPI::TEST): >+ > 2018-08-10 Daniel Bates <dabates@apple.com> > > webkit-patch setup-git-clone should set Git core editor to commit-log-editor >diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >index 198eb7d7de7c4751be0f7ef66a09179f48b4e5dc..fdf454cfd9faf6a9f8125624e51ef686a3603fa4 100644 >--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >@@ -839,6 +839,7 @@ > F4D5E4E81F0C5D38008C1A49 /* dragstart-clear-selection.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4D5E4E71F0C5D27008C1A49 /* dragstart-clear-selection.html */; }; > F4D65DA81F5E4704009D8C27 /* selected-text-image-link-and-editable.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4D65DA71F5E46C0009D8C27 /* selected-text-image-link-and-editable.html */; }; > F4DEF6ED1E9B4DB60048EF61 /* image-in-link-and-input.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4DEF6EC1E9B4D950048EF61 /* image-in-link-and-input.html */; }; >+ F4E0A296211FC5FB00AF7C7F /* selected-text-and-textarea.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4E0A295211FC5A300AF7C7F /* selected-text-and-textarea.html */; }; > F4E3D80820F70BB9007B58C5 /* significant-text-milestone-article.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4E3D80720F708E4007B58C5 /* significant-text-milestone-article.html */; }; > F4F137921D9B683E002BEC57 /* large-video-test-now-playing.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4F137911D9B6832002BEC57 /* large-video-test-now-playing.html */; }; > F4F405BC1D4C0D1C007A9707 /* full-size-autoplaying-video-with-audio.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4F405BA1D4C0CF8007A9707 /* full-size-autoplaying-video-with-audio.html */; }; >@@ -921,9 +922,6 @@ > dstPath = TestWebKitAPI.resources; > dstSubfolderSpec = 7; > files = ( >- CD57779C211CE91F001B371E /* audio-with-web-audio.html in Copy Resources */, >- CD57779D211CE91F001B371E /* video-with-audio-and-web-audio.html in Copy Resources */, >- CD577799211CE0E4001B371E /* web-audio-only.html in Copy Resources */, > 1A9E52C913E65EF4006917F5 /* 18-characters.html in Copy Resources */, > 379028B914FAC24C007E6B43 /* acceptsFirstMouse.html in Copy Resources */, > 1C2B81871C8925A000A5529F /* Ahem.ttf in Copy Resources */, >@@ -940,6 +938,7 @@ > 7C9ED98B17A19F4B00E4DC33 /* attributedStringStrikethrough.html in Copy Resources */, > 37137E4B21124D01002BEEA4 /* AttrStyle.html in Copy Resources */, > CD9E292E1C90C33F000BB800 /* audio-only.html in Copy Resources */, >+ CD57779C211CE91F001B371E /* audio-with-web-audio.html in Copy Resources */, > 76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */, > F41AB99F1EF4696B0083FA08 /* autofocus-contenteditable.html in Copy Resources */, > 93CFA8671CEB9E38000565A8 /* autofocused-text-input.html in Copy Resources */, >@@ -1138,6 +1137,7 @@ > A12DDC001E8373E700CF6CAE /* rendered-image-excluding-overflow.html in Copy Resources */, > F46849C01EEF5EF300B937FE /* rich-and-plain-text.html in Copy Resources */, > 0F5651F91FCE513500310FBC /* scroll-to-anchor.html in Copy Resources */, >+ F4E0A296211FC5FB00AF7C7F /* selected-text-and-textarea.html in Copy Resources */, > F4D65DA81F5E4704009D8C27 /* selected-text-image-link-and-editable.html in Copy Resources */, > 7A66BDB81EAF18D500CCC924 /* set-long-title.html in Copy Resources */, > CE6E81A420A933D500E2C80F /* set-timeout-function.html in Copy Resources */, >@@ -1172,6 +1172,7 @@ > F41AB9AA1EF4696B0083FA08 /* textarea-to-input.html in Copy Resources */, > F4451C761EB8FD890020C5DA /* two-paragraph-contenteditable.html in Copy Resources */, > C540F784152E5A9A00A40C8C /* verboseMarkup.html in Copy Resources */, >+ CD57779D211CE91F001B371E /* video-with-audio-and-web-audio.html in Copy Resources */, > CDC8E4941BC6F10800594FEC /* video-with-audio.html in Copy Resources */, > CDC8E4951BC6F10800594FEC /* video-with-audio.mp4 in Copy Resources */, > CD321B041E3A85FA00EB21C8 /* video-with-muted-audio-and-webaudio.html in Copy Resources */, >@@ -1180,6 +1181,7 @@ > CDC8E4961BC6F10800594FEC /* video-without-audio.html in Copy Resources */, > CDC8E4971BC6F10800594FEC /* video-without-audio.mp4 in Copy Resources */, > 07CD32F82065B72B0064A4BE /* video.html in Copy Resources */, >+ CD577799211CE0E4001B371E /* web-audio-only.html in Copy Resources */, > 1C2B81861C89259D00A5529F /* webfont.html in Copy Resources */, > 51714EB41CF8C78C004723C4 /* WebProcessKillIDBCleanup-1.html in Copy Resources */, > 51714EB51CF8C78C004723C4 /* WebProcessKillIDBCleanup-2.html in Copy Resources */, >@@ -2074,6 +2076,7 @@ > F4D5E4E71F0C5D27008C1A49 /* dragstart-clear-selection.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "dragstart-clear-selection.html"; sourceTree = "<group>"; }; > F4D65DA71F5E46C0009D8C27 /* selected-text-image-link-and-editable.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "selected-text-image-link-and-editable.html"; sourceTree = "<group>"; }; > F4DEF6EC1E9B4D950048EF61 /* image-in-link-and-input.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "image-in-link-and-input.html"; sourceTree = "<group>"; }; >+ F4E0A295211FC5A300AF7C7F /* selected-text-and-textarea.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "selected-text-and-textarea.html"; sourceTree = "<group>"; }; > F4E3D80720F708E4007B58C5 /* significant-text-milestone-article.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "significant-text-milestone-article.html"; sourceTree = "<group>"; }; > F4F137911D9B6832002BEC57 /* large-video-test-now-playing.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "large-video-test-now-playing.html"; sourceTree = "<group>"; }; > F4F405BA1D4C0CF8007A9707 /* full-size-autoplaying-video-with-audio.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "full-size-autoplaying-video-with-audio.html"; sourceTree = "<group>"; }; >@@ -2587,6 +2590,7 @@ > 5C9E59401D3EB1DE00E3C62E /* ApplicationCache.db-wal */, > F4856CA21E6498A8009D7EE7 /* attachment-element.html */, > 3760C4F221124BD000233ACC /* AttrStyle.html */, >+ CD57779A211CE6B7001B371E /* audio-with-web-audio.html */, > F41AB9981EF4692C0083FA08 /* autofocus-contenteditable.html */, > 93CFA8661CEB9DE1000565A8 /* autofocused-text-input.html */, > 2E14A5281D3FE8B80010F35B /* autoplaying-video-with-audio.html */, >@@ -2708,6 +2712,7 @@ > F41AB99A1EF4692C0083FA08 /* prevent-start.html */, > A12DDBFF1E8373C100CF6CAE /* rendered-image-excluding-overflow.html */, > F46849BF1EEF5EDC00B937FE /* rich-and-plain-text.html */, >+ F4E0A295211FC5A300AF7C7F /* selected-text-and-textarea.html */, > F4D65DA71F5E46C0009D8C27 /* selected-text-image-link-and-editable.html */, > F4E3D80720F708E4007B58C5 /* significant-text-milestone-article.html */, > F4FC077620F0108100CA043C /* significant-text-milestone.html */, >@@ -2724,13 +2729,12 @@ > F44C7A0420FAAE320014478C /* text-with-deferred-script.html */, > F41AB9951EF4692C0083FA08 /* textarea-to-input.html */, > F4451C751EB8FD7C0020C5DA /* two-paragraph-contenteditable.html */, >+ CD57779B211CE6CE001B371E /* video-with-audio-and-web-audio.html */, >+ CD577798211CDE8F001B371E /* web-audio-only.html */, > 51714EB21CF8C761004723C4 /* WebProcessKillIDBCleanup-1.html */, > 51714EB31CF8C761004723C4 /* WebProcessKillIDBCleanup-2.html */, > 5120C83B1E674E350025B250 /* WebsiteDataStoreCustomPaths.html */, > 2E131C171D83A97E001BA36C /* wide-autoplaying-video-with-audio.html */, >- CD577798211CDE8F001B371E /* web-audio-only.html */, >- CD57779A211CE6B7001B371E /* audio-with-web-audio.html */, >- CD57779B211CE6CE001B371E /* video-with-audio-and-web-audio.html */, > ); > name = Resources; > sourceTree = "<group>"; >@@ -3748,7 +3752,6 @@ > CD78E11D1DB7EA660014A2DE /* FullscreenDelegate.mm in Sources */, > 7C83E0BD1D0A650C00FEBCF3 /* FullscreenTopContentInset.mm in Sources */, > CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */, >- CD227E44211A4D5D00D285AF /* PreferredAudioBufferSize.mm in Sources */, > 83DB79691EF63B3C00BFA5E5 /* Function.cpp in Sources */, > 7CCE7EF81A411AE600447C4C /* Geolocation.cpp in Sources */, > 631EFFF61E7B5E8D00D2EBB8 /* Geolocation.mm in Sources */, >@@ -3867,6 +3870,7 @@ > 7CCE7EA71A411A1300447C4C /* PlatformWebViewMac.mm in Sources */, > 83BAEE8D1EF4625500DDE894 /* PluginLoadClientPolicies.mm in Sources */, > 7CCE7F261A411AF600447C4C /* Preferences.mm in Sources */, >+ CD227E44211A4D5D00D285AF /* PreferredAudioBufferSize.mm in Sources */, > 7C1AF7951E8DCBAB002645B9 /* PrepareForMoveToWindow.mm in Sources */, > 7CCE7F0B1A411AE600447C4C /* PreventEmptyUserAgent.cpp in Sources */, > 7CCE7F2C1A411B1000447C4C /* PreventImageLoadWithAutoResizing.mm in Sources */, >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/selected-text-and-textarea.html b/Tools/TestWebKitAPI/Tests/WebKitCocoa/selected-text-and-textarea.html >new file mode 100644 >index 0000000000000000000000000000000000000000..bdb9c9e468103824a6ba884a3f842fa7eee1b131 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/selected-text-and-textarea.html >@@ -0,0 +1,29 @@ >+<head> >+<meta name="viewport" content="width=device-width"> >+<style> >+body { >+ width: 100%; >+ height: 100%; >+ margin: 0; >+} >+ >+#source, #destination { >+ width: 100%; >+ height: 200px; >+ font-size: 200px; >+ white-space: nowrap; >+} >+ >+#destination { >+ border: black 1px solid; >+} >+</style> >+</head> >+<body> >+<div id="source">Hello world</div> >+<textarea id="destination"></textarea> >+<script> >+let text = source.childNodes[0]; >+getSelection().setBaseAndExtent(text, 0, text, text.data.length); >+</script> >+</body> >diff --git a/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm b/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm >index d60494190fc26959fcd468c5b3a92ee5da234bd5..00c13f0dcb6f675962f8f1f6f34b51a732d49732 100644 >--- a/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm >+++ b/Tools/TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm >@@ -376,6 +376,17 @@ TEST(DragAndDropTests, ContentEditableToTextarea) > checkRichTextTypePrecedesPlainTextType(simulator.get()); > } > >+TEST(DragAndDropTests, NonEditableTextSelectionToTextarea) >+{ >+ auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]); >+ auto simulator = adoptNS([[DragAndDropSimulator alloc] initWithWebView:webView.get()]); >+ >+ [webView synchronouslyLoadTestPageNamed:@"selected-text-and-textarea"]; >+ [simulator runFrom:CGPointMake(160, 100) to:CGPointMake(160, 300)]; >+ >+ EXPECT_WK_STREQ("Hello world", [webView stringByEvaluatingJavaScript:@"destination.value"]); >+} >+ > TEST(DragAndDropTests, ContentEditableMoveParagraphs) > { > auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188485
: 346978