Closed Bug 189225 Opened 22 years ago Closed 21 years ago

Deleting text at begining of a line adds an extra space

Categories

(Core :: DOM: Editor, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kinmoz, Assigned: mozeditor)

References

(Blocks 1 open bug)

Details

(Whiteboard: EDITORBASE+, fixinhand)

Attachments

(1 file)

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.
Whiteboard: EDITORBASE
Good catch; nice test case.  Nominating nsbeta1.
Status: NEW → ASSIGNED
Keywords: nsbeta1
Target Milestone: --- → M1
Keywords: nsbeta1nsbeta1+
Whiteboard: EDITORBASE → EDITORBASE+
Attachment #113980 - Flags: superreview?(kin)
Attachment #113980 - Flags: review?(brade)
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 on attachment 113980 [details] [diff] [review]
fix for nsWSRunObject.cpp

r=brade
Attachment #113980 - Flags: review?(brade) → review+
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
fix landed on trunk
Status: ASSIGNED → RESOLVED
Closed: 21 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 → ---
I see &nbsp;bar (no interveneing space).  closing again...
Status: REOPENED → RESOLVED
Closed: 21 years ago21 years ago
Resolution: --- → FIXED
Blocks: 1892254
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: