Open Bug 95657 Opened 24 years ago Updated 11 months ago

Caret is not painted middle of empty inline element even when `Selection` is collapsed in it

Categories

(Core :: Layout: Text and Fonts, defect)

defect

Tracking

()

Future

People

(Reporter: sujay, Unassigned, NeedInfo)

References

Details

(Whiteboard: [caret][selection])

Attachments

(1 file)

using 8/15 build of netscape 1) launch netscape 2) launch composer 3) insert some text 4) on that same line immediately after the text, insert anchor now try inserting the caret either after the anchor or below the text you entered. can't do it. looks like we don't insert a <br> after the anchor workaround = if you keep typing after the anchor then you can see the caret.
the caret is there, it just isn't rendering until the first character is typed.
Assignee: beppe → sfraser
Priority: -- → P2
Whiteboard: [care]
Target Milestone: --- → mozilla0.9.4
Off to 0.9.5
Target Milestone: mozilla0.9.4 → mozilla0.9.5
-> editor owners
Assignee: sfraser → kin
There are a couple of problems here. One is that clicking below the HR, seems to place the caret before the HR. This looks like a bug in nsFrame::GetContentAndOffsetsFromPoint(), which can be fixed with the following patch: Index: nsFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/base/src/nsFrame.cpp,v retrieving revision 3.327 diff -u -r3.327 nsFrame.cpp --- nsFrame.cpp 2001/09/19 12:34:48 3.327 +++ nsFrame.cpp 2001/09/27 00:16:20 @@ -1811,7 +1811,7 @@ aContentOffsetEnd = aContentOffset +1; else { - if ((thisRect.x + thisRect.width) < aPoint.x || thisRect.y > aPoint.y) + if ((thisRect.x + thisRect.width) < aPoint.x || (thisRect.y + thisRect.height) <= aPoint.y) { aBeginFrameContent = PR_FALSE; aContentOffset++; The 2nd problem seems to be that mjudge added some code to nsFrame::IsSelectable() which prevents us from placing the caret when clicking just after the HR. Sending this over to mjudge. (selection owner)
Priority: P2 → --
Whiteboard: [care] → [caret][selection]
Target Milestone: mozilla0.9.5 → ---
--> mjudge
Assignee: kin → mjudge
when I get a chance to rework the snapping caret all these will go away. until then i am shoving this into future
Target Milestone: --- → Future
*** Bug 114310 has been marked as a duplicate of this bug. ***
QA Contact: sujay → editor
Assignee: mjudge → nobody
Attached file testcase
This issue is still there in current trunk build.
Depends on: 389321

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority.

If you have reason to believe this is wrong (especially for the severity), please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5

Oddly, the testcase does not work anymore. I guess the anchor is removed by the server for some security reasons.

It works in my test suite. However, the care appears even though it's overlapped with the border of the <a>. It could be nicer that the care appears at middle of the box, though.

Inserting text after clicking around the anchor is different from Chrome. We insert text into the anchor, but Chrome appends the text to the preceding text. The reason is, Chrome adjusts Selection before handling to insert text and some web developers complain about that. So, we should not align the behavior at least for now.

So, the remaining issue is about the caret rendering position. Moving this to the layout module.

Severity: S4 → --
Component: DOM: Editor → Layout: Text and Fonts
Priority: P5 → --
Summary: lose caret after adding anchor → Caret is not painted middle of empty inline element even when `Selection` is collapsed in it

The severity field is not set for this bug.
:alaskanemily, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(emcdonough)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: