RESOLVED FIXED 179646
Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
https://bugs.webkit.org/show_bug.cgi?id=179646
Summary Long pressing a phone number with spaces in it results in a link sheet instea...
Tim Horton
Reported 2017-11-13 17:39:39 PST
Long pressing a phone number with spaces in it results in a link sheet instead of a data detectors sheet
Attachments
Patch (6.91 KB, patch)
2017-11-13 17:40 PST, Tim Horton
no flags
Patch (12.27 KB, patch)
2017-11-13 22:37 PST, Tim Horton
no flags
Patch (12.27 KB, patch)
2017-11-13 22:38 PST, Tim Horton
no flags
Tim Horton
Comment 1 2017-11-13 17:40:08 PST
Tim Horton
Comment 2 2017-11-13 17:40:30 PST
Darin Adler
Comment 3 2017-11-13 18:32:28 PST
Comment on attachment 326832 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326832&action=review > Source/WebCore/editing/cocoa/DataDetection.h:65 > + WEBCORE_EXPORT static bool URLCanBePresentedByDataDetectors(const URL&); I don’t think this function needs the word “URL” in its name. Either linkCanBePresentefdByDataDetectors or canBePresentedByDataDetectors seems fine to me. > Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:559 > + NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation->url]; Why isn’t this just: NSURL *targetURL = _positionInformation->url; Does the _web_URLWithWTFString method do something special that the NSURL operator from WebCore::URL does not?
Wenson Hsieh
Comment 4 2017-11-13 18:37:03 PST
I think writing a test for this wouldn't be too bad — you can find similar tests in ActionSheetTests. Checking that the resulting _WKActivatedElementInfo's type is not a link, image or attachment after simulating a long press would cover this.
Tim Horton
Comment 5 2017-11-13 21:18:01 PST
(In reply to Darin Adler from comment #3) > Comment on attachment 326832 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=326832&action=review > > > Source/WebCore/editing/cocoa/DataDetection.h:65 > > + WEBCORE_EXPORT static bool URLCanBePresentedByDataDetectors(const URL&); > > I don’t think this function needs the word “URL” in its name. Either > linkCanBePresentefdByDataDetectors or canBePresentedByDataDetectors seems > fine to me. Sure! > > Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:559 > > + NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation->url]; > > Why isn’t this just: > > NSURL *targetURL = _positionInformation->url; > > Does the _web_URLWithWTFString method do something special that the NSURL > operator from WebCore::URL does not? I think somebody got confused and thought _positionInformation->url was a string. I’ll fix it. (In reply to Wenson Hsieh from comment #4) > I think writing a test for this wouldn't be too bad — you can find similar > tests in ActionSheetTests. Checking that the resulting > _WKActivatedElementInfo's type is not a link, image or attachment after > simulating a long press would cover this. Good idea!
Tim Horton
Comment 6 2017-11-13 21:26:20 PST
> > > Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm:559 > > > + NSURL *targetURL = [NSURL _web_URLWithWTFString:_positionInformation->url]; > > > > Why isn’t this just: > > > > NSURL *targetURL = _positionInformation->url; > > > > Does the _web_URLWithWTFString method do something special that the NSURL > > operator from WebCore::URL does not? > > I think somebody got confused and thought _positionInformation->url was a > string. I’ll fix it. Actually, it *used to be* a string, until https://trac.webkit.org/changeset/216152/webkit, but I missed some cleanup!
Tim Horton
Comment 7 2017-11-13 22:37:30 PST
Tim Horton
Comment 8 2017-11-13 22:38:15 PST
WebKit Commit Bot
Comment 9 2017-11-14 09:44:21 PST
Comment on attachment 326858 [details] Patch Clearing flags on attachment: 326858 Committed r224819: <https://trac.webkit.org/changeset/224819>
WebKit Commit Bot
Comment 10 2017-11-14 09:44:22 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.