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.
Created attachment 2339 [details] Fixes the problem
I'd like to know if this is a real problem? Could you attach a testcase?
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 :)
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.
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.
Created attachment 2626 [details] Patch and ChangeLog entry
Comment on attachment 2626 [details] Patch and ChangeLog entry r=me
Reporter, please mark this bug as verified if it has been fixed for you.