Closed
Bug 303642
Opened 19 years ago
Closed 19 years ago
Drag-n-drop caret is not drawn correctly on some empty lines
Categories
(Core :: DOM: Selection, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 240416
People
(Reporter: MatsPalmgren_bugz, Unassigned)
Details
(Keywords: testcase)
Attachments
(1 file, 1 obsolete file)
|
855 bytes,
text/html
|
Details |
Drag-n-drop caret is not drawn correctly on some empty lines. STEPS TO REPRODUCE 1. load the attached testcase 2. drag text over the textarea and watch the caret ACTUAL RESULTS The caret does not appear anywhere when the mouse is on line 4. The caret is drawn on line 5 when mouse is on line 6. PLATFORMS & BUILDS TESTED Bug occurs in SeaMonkey nightly build 2005-08-05-05 (gtk1) Linux Bug occurs in SeaMonkey nightly build 2005-08-04-01 (gtk2) Linux
| Reporter | ||
Comment 1•19 years ago
|
||
Comment 2•19 years ago
|
||
This is likely due to http://lxr.mozilla.org/mozilla/source/layout/base/nsCaret.cpp#414 : // XXX we need to do more work here to get the correct hint. This is (somewhat) related to bug 303399, which I'm working on (also has to do with wrong positioning of the caret on blank lines, due to a bad hint).
Comment 3•19 years ago
|
||
This looks stupid, but it actually works. Tested both on empty and non-empty lines, and both at ends and beginnings of lines. Everything works fine.
Updated•19 years ago
|
Comment 4•19 years ago
|
||
Comment on attachment 192190 [details] [diff] [review] patch When trying to figure out why this worked, I found that the two empty lines each have their own content offset, making me wonder why the hint is at all necessary in this case. r=me
Attachment #192190 -
Flags: review?(mrbkap) → review+
Updated•19 years ago
|
Attachment #192190 -
Flags: superreview?(roc)
Comment 5•19 years ago
|
||
Bah. After thinking about this for a while (something I should have probably done before posting the patch), I found out the case which this does break: When dragging over the end of an overflowing line. With this patch, the caret appears at the beginning of the next line. I still think this is an improvement over the previous behaviour (I'd think dragging over blank lines is more common than dragging over edges of overflowing lines, and also the placement of the caret on the next line is not completely wrong, unlike the original bug). But I'm not sure. mrbkap - do you want to re-consider your r+?
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•19 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to comment #5) > Bah. After thinking about this for a while (something I should have probably > done before posting the patch), I found out the case which this does break: > When dragging over the end of an overflowing line. With this patch, the caret > appears at the beginning of the next line. You mean a line that's wrapping, right? I think I'd prefer to see this fixed for real. The editor listener that calls DrawAtPosition should really be calling DrawAtPositionWithHint (then we can remove DrawAtPosition). I think nsIDOMNSUIEvent should actually get a new method that returns the hint (defined in a precise and sane way!). Then nsDOMUIEvent can actually compute the hint in a way that ensures the caret will at least stay on the right line. Basically if the content at the offset is on the desired line, then "hint next", otherwise "hint previous".
That new method would be a readonly attribute, say readonly attribute boolean rangeAssociateNext;
Comment 9•19 years ago
|
||
(In reply to comment #7) > You mean a line that's wrapping, right? Right. > I think I'd prefer to see this fixed for real. I think I agree, but I'm not sure I'll be working on this. So reassigning back to default owner (I'll also depricate the patch).
Assignee: uriber → selection
Status: ASSIGNED → NEW
Updated•19 years ago
|
Attachment #192190 -
Attachment is obsolete: true
Attachment #192190 -
Flags: superreview?(roc)
Duplicate of bug 240416?
Comment 11•19 years ago
|
||
(In reply to comment #10) > Duplicate of bug 240416? Certainly. *** This bug has been marked as a duplicate of 240416 ***
Status: NEW → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•