WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
201085
[iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does nothing
https://bugs.webkit.org/show_bug.cgi?id=201085
Summary
[iOS] [WebKit2] Tapping on the “I’m” text suggestion after typing “i’” does n...
Wenson Hsieh
Reported
2019-08-23 12:23:48 PDT
<
rdar://problem/53056118
>
Attachments
Patch
(10.03 KB, patch)
2019-08-23 13:01 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Make foldQuoteMarks take a const String&
(11.66 KB, patch)
2019-08-23 14:22 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2019-08-23 13:01:02 PDT
Created
attachment 377151
[details]
Patch
Darin Adler
Comment 2
2019-08-23 13:43:50 PDT
Comment on
attachment 377151
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=377151&action=review
> Source/WebCore/editing/TextIterator.h:57 > +WEBCORE_EXPORT String foldQuoteMarks(String);
Seems a little peculiar to have the argument the be "String" rather than "const String&". Also, I am a little concerned using this outside the context of ICU’s usearch. The folding here was specifically to work around what usearch does and does not do. This folding alone without all the other folding that usearch does is a sort of peculiar subset. Finally, it’s not great to have this in this header since it’s not really an "iteration" thing. Just because the file-local version was here doesn’t mean this is a good logical home for the function.
Darin Adler
Comment 3
2019-08-23 13:46:27 PDT
Comment on
attachment 377151
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=377151&action=review
> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2342 > textForRange = plainTextReplacingNoBreakSpace(range.get());
Might be cleaner to integrate the quote mark folding into a replacement for the "plainTextReplacingNoBreakSpace" function instead of doing it as a separate step.
Wenson Hsieh
Comment 4
2019-08-23 13:48:37 PDT
(In reply to Darin Adler from
comment #3
)
> Comment on
attachment 377151
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=377151&action=review
> > > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2342 > > textForRange = plainTextReplacingNoBreakSpace(range.get()); > > Might be cleaner to integrate the quote mark folding into a replacement for > the "plainTextReplacingNoBreakSpace" function instead of doing it as a > separate step.
This was my first thought, but then I realized that we’d still need a way to fold quote marks for the original text passed into applyAutocorrectionInternal.
Darin Adler
Comment 5
2019-08-23 13:50:28 PDT
Comment on
attachment 377151
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=377151&action=review
>>> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2342 >>> textForRange = plainTextReplacingNoBreakSpace(range.get()); >> >> Might be cleaner to integrate the quote mark folding into a replacement for the "plainTextReplacingNoBreakSpace" function instead of doing it as a separate step. > > This was my first thought, but then I realized that we’d still need a way to fold quote marks for the original text passed into applyAutocorrectionInternal.
Does that text perhaps also ultimately come from a call to plainTextReplacingNoBreakSpace?
Wenson Hsieh
Comment 6
2019-08-23 13:58:04 PDT
Comment on
attachment 377151
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=377151&action=review
>>>> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2342 >>>> textForRange = plainTextReplacingNoBreakSpace(range.get()); >>> >>> Might be cleaner to integrate the quote mark folding into a replacement for the "plainTextReplacingNoBreakSpace" function instead of doing it as a separate step. >> >> This was my first thought, but then I realized that we’d still need a way to fold quote marks for the original text passed into applyAutocorrectionInternal. > > Does that text perhaps also ultimately come from a call to plainTextReplacingNoBreakSpace?
It comes from UIKit (which, in turn, gets it from kbd).
Wenson Hsieh
Comment 7
2019-08-23 14:07:09 PDT
(In reply to Darin Adler from
comment #2
)
> Comment on
attachment 377151
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=377151&action=review
> > > Source/WebCore/editing/TextIterator.h:57 > > +WEBCORE_EXPORT String foldQuoteMarks(String); > > Seems a little peculiar to have the argument the be "String" rather than > "const String&”.
Agreed. On closer inspection, we should be able to make this const String& (the only call site that depends on this is one of the SearchBuffer constructors that could be tweaked). I’ll post a v2 that does this.
> Also, I am a little concerned using this outside the > context of ICU’s usearch. The folding here was specifically to work around > what usearch does and does not do. This folding alone without all the other > folding that usearch does is a sort of peculiar subset.
I see. Perhaps the function could be renamed in such a way that makes this clear?
> Finally, it’s not > great to have this in this header since it’s not really an "iteration" > thing. Just because the file-local version was here doesn’t mean this is a > good logical home for the function.
Yeah, I had considered moving this (either to WTFString.h as an instance method of WTF::String, or a standalone function in that file, or just a function in StringCommon.h, or even a new header in WebCore) but decided to leave it out of this patch to make this change simpler. One thing to note is that wherever we decide to move it, we should probably keep foldQuoteMarks and foldQuoteMark in the same place. Would it be okay to do this in a followup patch?
Wenson Hsieh
Comment 8
2019-08-23 14:22:59 PDT
Created
attachment 377154
[details]
Make foldQuoteMarks take a const String&
Wenson Hsieh
Comment 9
2019-08-23 15:17:18 PDT
> One thing to note is that wherever we decide to move it, we should probably > keep foldQuoteMarks and foldQuoteMark in the same place. > > Would it be okay to do this in a followup patch?
I filed <
https://bugs.webkit.org/show_bug.cgi?id=201092
> for this.
WebKit Commit Bot
Comment 10
2019-08-23 16:00:45 PDT
Comment on
attachment 377154
[details]
Make foldQuoteMarks take a const String& Clearing flags on attachment: 377154 Committed
r249074
: <
https://trac.webkit.org/changeset/249074
>
WebKit Commit Bot
Comment 11
2019-08-23 16:00:46 PDT
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 12
2019-08-23 16:37:25 PDT
Comment on
attachment 377154
[details]
Make foldQuoteMarks take a const String& View in context:
https://bugs.webkit.org/attachment.cgi?id=377154&action=review
> Source/WebCore/editing/TextIterator.cpp:-2422 > - foldQuoteMarks(m_target);
What you did here seems to be fixing a serious bug! This was calling a function and ignoring its result so it wasn’t folding the quote marks. Glad you fixed it, but not at all happy that we didn’t have test coverage that showed us what was happening.
Wenson Hsieh
Comment 13
2019-08-23 16:59:35 PDT
(In reply to Darin Adler from
comment #12
)
> Comment on
attachment 377154
[details]
> Make foldQuoteMarks take a const String& > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=377154&action=review
> > > Source/WebCore/editing/TextIterator.cpp:-2422 > > - foldQuoteMarks(m_target); > > What you did here seems to be fixing a serious bug! This was calling a > function and ignoring its result so it wasn’t folding the quote marks. Glad > you fixed it, but not at all happy that we didn’t have test coverage that > showed us what was happening.
Indeed! One thing to note here is that this codepath is only compiled if UCONFIG_NO_COLLATION, which might explain the lack of test coverage (at least, on macOS and iOS bots).
Darin Adler
Comment 14
2019-08-23 19:57:56 PDT
Comment on
attachment 377154
[details]
Make foldQuoteMarks take a const String& View in context:
https://bugs.webkit.org/attachment.cgi?id=377154&action=review
>>> Source/WebCore/editing/TextIterator.cpp:-2422 >>> - foldQuoteMarks(m_target); >> >> What you did here seems to be fixing a serious bug! This was calling a function and ignoring its result so it wasn’t folding the quote marks. Glad you fixed it, but not at all happy that we didn’t have test coverage that showed us what was happening. > > Indeed! > > One thing to note here is that this codepath is only compiled if UCONFIG_NO_COLLATION, which might explain the lack of test coverage (at least, on macOS and iOS bots).
Aha, yes, that makes sense. And I think that means this does not affect any Cocoa platforms.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug