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> 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.
Good catch; nice test case. Nominating nsbeta1.
make the ConvertToNBSP() call on the right object, so that it will be examining the correct data structures when gathering info for the conversion.
Comment on attachment 113980 [details] [diff] [review] fix for nsWSRunObject.cpp r=brade
Comment on attachment 113980 [details] [diff] [review] fix for nsWSRunObject.cpp firstname.lastname@example.org
fix landed on trunk
testing with 2003.04.03 comm trunk builds, i still get 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?
I see bar (no interveneing space). closing again...