VERIFIED FIXED 3535
Spelling suggestions in the context menu don't call the should* delegate methods
https://bugs.webkit.org/show_bug.cgi?id=3535
Summary Spelling suggestions in the context menu don't call the should* delegate methods
Duncan Wilcox
Reported 2005-06-14 14:47:56 PDT
Type some miss-spelled text, control click, select a correct spelling from the context menu, the delegate: - (BOOL)webView:(WebView *)webView shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action isn't called, instead the: - (void)webViewDidChange:(NSNotification *)notification is called right away.
Attachments
Fixes the problem (905 bytes, patch)
2005-06-14 15:03 PDT, Duncan Wilcox
no flags
testcase (1.43 KB, application/octet-stream)
2005-06-15 03:18 PDT, Duncan Wilcox
no flags
Patch and ChangeLog entry (1.77 KB, patch)
2005-06-24 04:02 PDT, Duncan Wilcox
darin: review+
Duncan Wilcox
Comment 1 2005-06-14 15:03:13 PDT
Created attachment 2339 [details] Fixes the problem
Joost de Valk (AlthA)
Comment 2 2005-06-14 23:31:25 PDT
I'd like to know if this is a real problem? Could you attach a testcase?
Duncan Wilcox
Comment 3 2005-06-15 03:18:09 PDT
Created attachment 2355 [details] testcase I suppose that it doesn't make any difference at all if you are using the default editing delegate, however it certainly is a violation of the editing delegate protocol. The editing delegate is allowed to return a NO/FALSE to webView:shouldInsertText:replacingDOMRange:givenAction:, for example try building the attached testcase (create an empty project in xcode and replace main.m with this code) and typing "three". The editing delegate replaces all "e"s with "i"s, so you will see "thrii". The contextual menu will propose "three", and when you select it you will incorrectly get "three", because the webkit isn't going through the delegate correctly. With the patch applied you will get "thrii" instead, which is weird but is correct :)
Darin Adler
Comment 4 2005-06-23 14:26:38 PDT
Yes, this is a real editing bug. We have lots of cases where we're not calling the editing delegates, and we should be doing that consistently in all cases.
Darin Adler
Comment 5 2005-06-23 14:29:58 PDT
It's hard to make test cases for these things -- we'd need to enhance DumpRenderTree to dump when the editing delegate is called at the very least.
Duncan Wilcox
Comment 6 2005-06-24 04:02:25 PDT
Created attachment 2626 [details] Patch and ChangeLog entry
Darin Adler
Comment 7 2005-06-24 08:36:06 PDT
Comment on attachment 2626 [details] Patch and ChangeLog entry r=me
Joost de Valk (AlthA)
Comment 8 2005-07-03 08:07:55 PDT
Reporter, please mark this bug as verified if it has been fixed for you.
Note You need to log in before you can comment on or make changes to this bug.