Deleting text at begining of a line adds an extra space

RESOLVED FIXED in M1

Status

()

Core
Editor
RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: kinmoz, Assigned: Joe Francis)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: EDITORBASE+, fixinhand)

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
If I load the following example into composer:

  <body><b>foo</b> bar</body>

and hilite the word "foo" and hit backspace, I end up with 2 spaces before the
word "bar":

  <body>&nbsp; bar</body>

It seems that nsWSRunObject::ConvertToNBSP() fails to delete the space it is
trying to replace with the nbsp because the point returned by GetAsciiWSBounds()
contains no node.

It looks like it might be due to the fact that GetWSPointAfter() assumes that
the node passed in will be in the mNodeArray, which in this case, it isn't.

GetWSPointAfter() gets invoked via a call chain that  looks like this:

  ConvertToNBSP()->GetAsciiWSBounds()->GetCharAfter()->GetWSPointAfter()

FYI: This bug is present in the MOZILLA_1_0_BRANCH as well as the TRUNK and
tends to throw off the offset tracking used in the TextServices, resulting in
the  wrong things getting selected and replaced during spellchecking.
(Reporter)

Updated

15 years ago
Whiteboard: EDITORBASE
(Assignee)

Comment 1

15 years ago
Good catch; nice test case.  Nominating nsbeta1.
Status: NEW → ASSIGNED
Keywords: nsbeta1
Target Milestone: --- → M1
(Assignee)

Updated

15 years ago
Keywords: nsbeta1 → nsbeta1+
Whiteboard: EDITORBASE → EDITORBASE+
(Assignee)

Comment 2

15 years ago
Created attachment 113980 [details] [diff] [review]
fix for nsWSRunObject.cpp
(Assignee)

Updated

15 years ago
Attachment #113980 - Flags: superreview?(kin)
Attachment #113980 - Flags: review?(brade)
(Assignee)

Comment 3

15 years ago
make the ConvertToNBSP() call on the right object, so that it will be examining
the correct data structures when gathering info for the conversion.
Whiteboard: EDITORBASE+ → EDITORBASE+, fixinhand

Comment 4

15 years ago
Comment on attachment 113980 [details] [diff] [review]
fix for nsWSRunObject.cpp

r=brade
Attachment #113980 - Flags: review?(brade) → review+
(Reporter)

Comment 5

15 years ago
Comment on attachment 113980 [details] [diff] [review]
fix for nsWSRunObject.cpp

sr=kin@netscape.com
Attachment #113980 - Flags: superreview?(kin) → superreview+
QA Contact: sujay → sairuh
(Assignee)

Comment 6

15 years ago
fix landed on trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
testing with 2003.04.03 comm trunk builds, i still get &nbsp; bar as the result
after deleting the bold foo. it didn't matter if i selected foo via click-drag
or click-shift-arrow-key. reopening. unless i'm misunderstanding something?
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 8

15 years ago
I see &nbsp;bar (no interveneing space).  closing again...
Status: REOPENED → RESOLVED
Last Resolved: 15 years ago15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.