Bug 4375
Summary: | You are able to drag-select outside of the active editing block | ||
---|---|---|---|
Product: | WebKit | Reporter: | Dan Wood <dwood> |
Component: | HTML Editing | Assignee: | Justin Garcia <justin.garcia> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ap |
Priority: | P2 | ||
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
Bug Depends on: | 4011 | ||
Bug Blocks: | 5354 |
Dan Wood
When you are editing a block that is not the entire webview (where you can see the blue glowing
outline), you are able to drag outside of that block and extend your selection above or below the edting
block.
This is very similar to bug 3967 and its almost-duplicate, bug 4011 ... except that I would like to
"tighten" the report to consider that perhaps the current behavior is a bug, not a feature.
Steps to reproduce:
1. Start with my modified "Blot" sample code attached to bug 3967; I've inserted a batch of web editing
delegate methods in BlotDocument.m.
2. Click in the first editable div, and drag within that block.
3. Now drag down outside of that block.
Expected results: You should not be able to select anything outside of that block, just as you are not
able to drag-select outside of a <textarea> in an HTML form.
Actual results: Selection continues out of the block.
Workaround: Assuming the patch to bug 4011 is applied, one can theoretically implement
webView:shouldChangeSelectedDOMRange:toDOMRange:affinity:stillSelecting: to disallow this.
However, I would submit that this workaround is not enough -- it should be standard behavior not to
be able to drag-select outside of an active contentEditable div.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Dan Wood
I am adding this as dependent on 4011, since I'm guessing that in order to fix this, we need to get the fix
to 4011 applied. I hope this is an accurate assessment.
Dave Hyatt
Agreed. The same should be true of overflow blocks as well. In fact overflow blocks should auto-scroll.
That should probably be a separate bug though.
It will be necessary to fix all this in order to use contenteditable to implement textfields and textareas
using the engine.
Dan Wood
Another related issue that I will add here ... if you have two editable divs, and you drag out of one and into
the other, the other editable node will suddenly activate as the editable node.
Dan Wood
Also, probably related -- when you delete or left-arrow past the beginning of an editable block, the
selection jumps to the previous editable block. It should stop at the start of the editable block.
Justin Garcia
I think that my recent checkin fixes some or all of the problems that you mentioned here. Please open
new bugs for issues that remain.
Thanks