Bug 4011

Summary: Editing delegate selection methods not called when using mouse
Product: WebKit Reporter: Duncan Wilcox <duncan>
Component: HTML EditingAssignee: Dave Hyatt <hyatt>
Status: RESOLVED FIXED    
Severity: Major CC: dwood
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on: 3734    
Bug Blocks: 4375    
Attachments:
Description Flags
test case
none
patch with changelog entries
darin: review-
patch with changelog entries
darin: review+
layout test (crashes webcore) none

Duncan Wilcox
Reported 2005-07-15 06:18:22 PDT
webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting: should be called before webViewDidChangeSelection: when using the mouse on an editable area: - moving the cursor with arrow keys, with or without extending the selection with shift, will call both the SHOULD and the DID method - clicking or doubleclicking will call the DID method, but not the SHOULD method
Attachments
test case (1.69 KB, application/octet-stream)
2005-07-15 06:23 PDT, Duncan Wilcox
no flags
patch with changelog entries (13.50 KB, patch)
2005-07-15 12:49 PDT, Duncan Wilcox
darin: review-
patch with changelog entries (15.54 KB, patch)
2005-08-01 17:31 PDT, Duncan Wilcox
darin: review+
layout test (crashes webcore) (800 bytes, text/plain)
2005-08-06 09:00 PDT, Duncan Wilcox
no flags
Duncan Wilcox
Comment 1 2005-07-15 06:23:10 PDT
Created attachment 2973 [details] test case Create a cocoa app in xcode, replace main.m with the attachment and add the WeKit.framework to the project.
Duncan Wilcox
Comment 2 2005-07-15 12:49:44 PDT
Created attachment 2975 [details] patch with changelog entries This is the first patch I develop that drills through all the glue layers, please advise.
Dan Wood
Comment 3 2005-07-15 16:50:20 PDT
It looks like this bug may be a partial duplicate of 3967.
Darin Adler
Comment 4 2005-07-18 08:21:02 PDT
Comment on attachment 2975 [details] patch with changelog entries Formatting problem -- if statements say "if(" and should say "if (" instead. Ideally we should also have a layout test. We added support to the layout test engine for reporting editing delegate output, and you can create mouse events using the DOM events support -- with these two things together you should be able to make a layout test that would work. Otherwise, looks good.
Duncan Wilcox
Comment 5 2005-08-01 17:31:29 PDT
Created attachment 3201 [details] patch with changelog entries Updated for current HEAD, seems to work fine.
Darin Adler
Comment 6 2005-08-04 11:25:08 PDT
Comment on attachment 3201 [details] patch with changelog entries Looks good. Marking review- because there's still no layout test. If there was a test I'd have done review+.
Dan Wood
Comment 7 2005-08-05 11:34:02 PDT
Darin, will the test cases from 3967 suffice? As I mentioned above, this bug is pretty much a duplicate of that, so the test cases I generated for that should work. Do I need to upload them and explicitly attach to this bug?
Duncan Wilcox
Comment 8 2005-08-06 09:00:51 PDT
Created attachment 3240 [details] layout test (crashes webcore) This is an attempt at building a layout test that should use the new editing delegate support in DumpRenderTree. Unfortunately I don't know much about DOM2 events, so I don't know if my JS code is correct. I can only get WebCore to crash. I will file the bug for the crash, I would need someone to look at the JS in the layout test to know if it is correct, and this bug should depend on the layout test crash bug.
Darin Adler
Comment 9 2005-08-07 09:49:15 PDT
A test program is not a substitute for a layout test. We don't have any way to run a compiled test program in an automated way. So the tests attached to bug 3967 don't help with the lack of layout test.
Darin Adler
Comment 10 2005-08-07 09:55:35 PDT
Comment on attachment 3201 [details] patch with changelog entries I guess we can't easily make a layout test for this, so r=me.
Dan Wood
Comment 11 2005-08-10 12:20:59 PDT
I've tried out this patch against the test application that I made for bug 3967, and I can confirm that the callback I is getting called in my test. What do we need to do to get this checked in? :-)
Note You need to log in before you can comment on or make changes to this bug.