WebKit Bugzilla
Attachment 339626 Details for
Bug 185289
: [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-185289-20180504203033.patch (text/plain), 6.70 KB, created by
Wenson Hsieh
on 2018-05-04 20:30:34 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-05-04 20:30:34 PDT
Size:
6.70 KB
patch
obsolete
>Subversion Revision: 231386 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 99990c71c2b226d7260aff50d7c974a0d28d8716..cb1ad235fb57aa7f668e192a475d76a1dd4efe94 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2018-05-04 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart >+ https://bugs.webkit.org/show_bug.cgi?id=185289 >+ <rdar://problem/35756912> >+ >+ Reviewed by Tim Horton and Darin Adler. >+ >+ When inserting multiple URLs as individual items in a single drop, we currently separate each item with a space >+ (see r217284). However, it still seems difficult to tell dropped links apart. This patch makes some slight >+ tweaks to WebContentReader::readURL so that it inserts line breaks before dropped URLs, if the dropped URL isn't >+ the first item to be inserted in the resulting document fragment. >+ >+ Augments existing API tests in DataInteractionTests. >+ >+ * editing/ios/WebContentReaderIOS.mm: >+ >+ Additionally remove some extraneous header imports from this implementation file. >+ >+ (WebCore::WebContentReader::readURL): >+ > 2018-05-04 Zalan Bujtas <zalan@apple.com> > > [Simple line layout] Add support for line layout box generation with multiple text renderers. >diff --git a/Source/WebCore/editing/ios/WebContentReaderIOS.mm b/Source/WebCore/editing/ios/WebContentReaderIOS.mm >index 9b310d56c68dd93ce17e93e78628dd4ec32b3808..8de5c15006cb9a9d833e18795af0a2e74704cb0c 100644 >--- a/Source/WebCore/editing/ios/WebContentReaderIOS.mm >+++ b/Source/WebCore/editing/ios/WebContentReaderIOS.mm >@@ -28,24 +28,14 @@ > > #if PLATFORM(IOS) > >-#import "ArchiveResource.h" > #import "Document.h" > #import "DocumentFragment.h" >-#import "DocumentLoader.h" > #import "Editor.h" > #import "EditorClient.h" >-#import "FragmentScriptingPermission.h" >-#import "FrameLoader.h" >-#import "FrameLoaderClient.h" > #import "HTMLAnchorElement.h" >+#import "HTMLBRElement.h" > #import "HTMLNames.h" >-#import "LegacyWebArchive.h" >-#import "MIMETypeRegistry.h" > #import "Text.h" >-#import "UTIUtilities.h" >-#import "markup.h" >-#import <MobileCoreServices/MobileCoreServices.h> >-#import <wtf/unicode/CharacterNames.h> > > namespace WebCore { > >@@ -63,15 +53,16 @@ bool WebContentReader::readURL(const URL& url, const String& title) > if ([(NSURL *)url isFileURL]) > return false; > >- auto anchor = HTMLAnchorElement::create(*frame.document()); >+ auto document = makeRef(*frame.document()); >+ auto anchor = HTMLAnchorElement::create(document.get()); > anchor->setAttributeWithoutSynchronization(HTMLNames::hrefAttr, url.string()); > > String linkText = title.length() ? title : String([[(NSURL *)url absoluteString] precomposedStringWithCanonicalMapping]); >- anchor->appendChild(frame.document()->createTextNode(linkText)); >+ anchor->appendChild(document->createTextNode(linkText)); > >- auto newFragment = frame.document()->createDocumentFragment(); >+ auto newFragment = document->createDocumentFragment(); > if (fragment) >- newFragment->appendChild(Text::create(*frame.document(), { &space, 1 })); >+ newFragment->appendChild(HTMLBRElement::create(document.get())); > newFragment->appendChild(anchor); > addFragment(WTFMove(newFragment)); > return true; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 5316f6465c6a9d226a48a1b4fb53a1de7253100c..5a2e27668cb51f1d50f98892aee48fc9c862c56f 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-05-04 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart >+ https://bugs.webkit.org/show_bug.cgi?id=185289 >+ <rdar://problem/35756912> >+ >+ Reviewed by Tim Horton and Darin Adler. >+ >+ Augment and rebaseline some iOS drag-and-drop API tests that handle dropping URLs as a part of multi-item drop >+ sessions. >+ >+ * TestWebKitAPI/Tests/ios/DataInteractionTests.mm: >+ (TestWebKitAPI::TEST): >+ > 2018-05-04 Timothy Hatcher <timothy@apple.com> > > Deprecate legacy WebView and friends >diff --git a/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm b/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm >index 4a348c2504e77625c3eff344f6bcdd97de1a594f..bf0d9295bfce882dccc05b5b49ec2081831b156a 100644 >--- a/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm >+++ b/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm >@@ -856,11 +856,17 @@ TEST(DataInteractionTests, ExternalSourceMultipleURLsToContentEditable) > [dataInteractionSimulator setExternalItemProviders:@[ firstItem.get(), secondItem.get(), thirdItem.get() ]]; > [dataInteractionSimulator runFrom:CGPointMake(300, 400) to:CGPointMake(100, 300)]; > >- NSArray *separatedLinks = [[webView stringByEvaluatingJavaScript:@"editor.textContent"] componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; >- EXPECT_EQ(3UL, separatedLinks.count); >- EXPECT_WK_STREQ("https://www.apple.com/iphone/", separatedLinks[0]); >- EXPECT_WK_STREQ("https://www.apple.com/mac/", separatedLinks[1]); >- EXPECT_WK_STREQ("https://webkit.org/", separatedLinks[2]); >+ NSArray *droppedURLs = [webView objectByEvaluatingJavaScript:@"Array.from(editor.querySelectorAll('a')).map(a => a.href)"]; >+ EXPECT_EQ(3UL, droppedURLs.count); >+ EXPECT_WK_STREQ("https://www.apple.com/iphone/", droppedURLs[0]); >+ EXPECT_WK_STREQ("https://www.apple.com/mac/", droppedURLs[1]); >+ EXPECT_WK_STREQ("https://webkit.org/", droppedURLs[2]); >+ >+ NSArray *linksSeparatedByLine = [[webView objectByEvaluatingJavaScript:@"editor.innerText"] componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; >+ EXPECT_EQ(3UL, linksSeparatedByLine.count); >+ EXPECT_WK_STREQ("https://www.apple.com/iphone/", linksSeparatedByLine[0]); >+ EXPECT_WK_STREQ("https://www.apple.com/mac/", linksSeparatedByLine[1]); >+ EXPECT_WK_STREQ("https://webkit.org/", linksSeparatedByLine[2]); > } > > TEST(DataInteractionTests, RespectsExternalSourceFidelityRankings) >@@ -1466,7 +1472,7 @@ TEST(DataInteractionTests, AdditionalLinkAndImageIntoContentEditable) > @0.33: [NSValue valueWithCGPoint:CGPointMake(50, 150)], > @0.66: [NSValue valueWithCGPoint:CGPointMake(50, 250)] > }]; >- EXPECT_WK_STREQ("ABCD A link", [webView stringByEvaluatingJavaScript:@"editor.textContent"]); >+ EXPECT_WK_STREQ("ABCDA link", [webView stringByEvaluatingJavaScript:@"editor.textContent"]); > EXPECT_TRUE([webView stringByEvaluatingJavaScript:@"!!editor.querySelector('img')"]); > EXPECT_WK_STREQ("https://www.apple.com/", [webView stringByEvaluatingJavaScript:@"editor.querySelector('a').href"]); > }
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 185289
:
339512
| 339626