Closed Bug 118912 Opened 23 years ago Closed 21 years ago

Can't delete smily/smiley/emoticon

Categories

(Core :: DOM: Editor, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.5alpha

People

(Reporter: neil, Assigned: KaiE)

References

Details

(Keywords: topembed+, Whiteboard: [adt2] EDITORBASE+)

Attachments

(2 files)

I opened a compose window, typed some text, placed a smily face using the
toolbar, and typed some more text.  If I then press backspace numerous times,
the text around the smily gets deleted, but not the smily itself.

Neither backspace nor delete will get rid of it.

I have to first select it with the mouse then press delete or backspace.
QA Contact: sheelar → esther
Reassign to editor
Assignee: ducarroz → kin
Component: Composition → Editor: Core
Product: MailNews → Browser
QA Contact: esther → sujay
If you insert an image, can you delete that?
Should this bug be editorbase?
Keywords: regression
Nominating for EDITORBASE.
Reproduced with 2002021403 build on WINXP.
Severity: minor → normal
Whiteboard: EDITORBASE
Target Milestone: --- → mozilla1.0.1
Also reproduced with todays build 20002022003 build on WinXP.
EDITORBASE-
Whiteboard: EDITORBASE → EDITORBASE-
If I paste a smily, then hit backspace a couple times, when I send the email all
they get on the other side is ":" instead of ":-)".  It's as if it's deleting
the actual text and not the image of the smily.
Yeah that makes sense, I believe anatoliya@netscape.com implemented the smiley's 
as span wrapping the actual text. The span has style on it that displays the 
image and hides the actual text.

The core editor is unaware of this, and just treats the smiley text as if it 
were in an inline container ... like bold, italic, underline, etc ... so it just 
deletes a char at a time.
Priority: -- → P3
*** Bug 140798 has been marked as a duplicate of this bug. ***
Target Milestone: mozilla1.0.1 → Future
seek reconsideration
Whiteboard: EDITORBASE- → EDITORBASE
Method described in the bug for delete is incorrect.

Smileys are just background images.
To delete siley, user must:

1. select the smiley by, for instance, mouse click on the smiley
2. push "delete" (or backspace) key 

The smiley will be deleted.

Probably some relnotes needed to be porvided.
images can be deleted by just hitting backspace.
Keywords: nsbeta1+
Whiteboard: EDITORBASE → EDITORBASE+
Ehehe, that's weirder than we all thought it is.

1. launch Mozilla
2. open (a) a mail composition window (b) Composer
3. in mail compose, type aaaaa, insert a smiley, type bbbbbb
4. select all, copy, paste into Composer, hit return key in Composer
5. position caret right before the first b and hit backspace
6. cycle through steps 4 and 5 at least *6* times
7. in the Composer window, switch to view Source

result in Composer's view source :

  aaaaa<span class="moz-smiley-s1"><span> :-)</span></span>bbbbb<br>
  aaaaa<span class="moz-smiley-s1"><span> :-</span></span>bbbbb<br>
  aaaaa<span class="moz-smiley-s1"><span> :</span></span>bbbbb<br>
  aaaaa<span class="moz-smiley-s1"><span> </span></span>bbbbb<br>
  aaaaa<span class="moz-smiley-s1"><span></span></span>bbbbb<br>
  aaaaabbbbb<br>

So the smiley is not removed by a hit on backspace because we only remove
one character at a time in the corresponding span.

Hope that helps.
Btw, Kathy, you added the regression kwd, but as states it Anatolyi in comment #10
it is _not_ a regression. It seems to me that it never worked because there is
no magic at all in the editor for the detection of span[class^="-moz-smiley"]
Keywords: regression
EDITORBASE- since it doesn't affect the core composer app. Leaving nsbeta1+ for
kevin/jfrancis to prioritize as they see fit
Assignee: kin → jfrancis
Whiteboard: EDITORBASE+ → EDITORBASE-
*** Bug 166285 has been marked as a duplicate of this bug. ***
*** Bug 164136 has been marked as a duplicate of this bug. ***
Once # 180034 lands all we need to do is set -moz-user-select: all on the span.
 Then the editor will delete it atomically.
Depends on: 180034
Target Milestone: Future → M1
*** Bug 182057 has been marked as a duplicate of this bug. ***
*** Bug 189116 has been marked as a duplicate of this bug. ***
Summary: Can't delete smily → Can't delete smily/smiley/emoticon
QA Contact: sujay → beppe
Whiteboard: EDITORBASE- → EDITORBASE+
Whiteboard: EDITORBASE+ → EDITORBASE+ fixinhand
Comment on attachment 116660 [details] [diff] [review]
patch to messageBody.css

not really sure who reviewers should be, but this it pretty trivial regardless
Attachment #116660 - Flags: superreview?(kin)
Attachment #116660 - Flags: review?(brade)
Comment on attachment 116660 [details] [diff] [review]
patch to messageBody.css

r=glazman
Attachment #116660 - Flags: review?(brade) → review+
Comment on attachment 116661 [details] [diff] [review]
patch to EditorContent.css

r=glazman
Attachment #116661 - Flags: review+
Attachment #116661 - Flags: superreview?(kin)
Comment on attachment 116661 [details] [diff] [review]
patch to EditorContent.css

sr=kin@netscape.com
Attachment #116661 - Flags: superreview?(kin) → superreview+
Comment on attachment 116660 [details] [diff] [review]
patch to messageBody.css

sr=kin@netscape.com
Attachment #116660 - Flags: superreview?(kin) → superreview+
EDITORBASE+ topembed+ normalization
Keywords: topembed+
fix landed on tip
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
maybe I jumped the gun on this one, but using the build from 2003032404, using
the backspace did not delete the smiley. I followed Daniel's test. After pasting
the aaaaa(smiley)bbbbb, I placed the caret to the right of the last 'b' and
selected backspace. When I reached the smiley, I hot backspace and the caret
shifted to the left of the smiley permitting me to continue deleting the a's --
but the smailey remained.
not sure why this isn't working.  reopening.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
OS: Windows 2000 → All
Hardware: PC → All
Kai can you look at this when you get a chance?
Assignee: jfrancis → kaie
Status: REOPENED → NEW
Whiteboard: EDITORBASE+ fixinhand → EDITORBASE+
Target Milestone: M1 → mozilla1.5alpha
adt: nsbeta1+/adt2
Whiteboard: EDITORBASE+ → [adt2] EDITORBASE+
I think the patch in this bug has made the situation worse.

I see a regression that is now present on trunk builds, and by backing it out
locally, I confirmed is caused by this patch.

For some reason, the regression is only seen the first time you try it in a
Mozilla session!

To see the regression:
- start Mozilla
- open a mail composer window
- type some chars, like "wfwkfpwef"
- use smiley toolbar, insert topmost smiley
- type any letter, e.g. "x"

Actual behaviour: The smiley gets deleted!

I backed out the
 -moz-user-select: all;
lines in all three files modified by the patches in this bug.

This makes the regression go away, but of course, the original bug reappears.

Could somebody please explain what kind of effect -moz-user-select is supposed
to control?


What approach do you think is more reasonable:
1) back out the patch and find another solution to the original bug?
or
2) keep the -moz-user-select addition and try to figure out why typing a char
deletes the smiley?
However, while we see this regression, the original patch seems fixed to me,
hitting backspace deletes the smiley, as opposed to what beepe saw two months
ago (comment 29).
> Could somebody please explain what kind of effect -moz-user-select is supposed
> to control?

Ok, I found some information and now understand the meaning. We want to delete
the smiley chars in an atomic operation.


I guess the conclusion is, this bug is fixed, I always can use backspace to
delete a smiley. Marking fixed again. Beth, can you please test again?


I have filed the new bug 207183 to track the regression.
Status: NEW → RESOLVED
Closed: 21 years ago21 years ago
Resolution: --- → FIXED
The regression is most likely caused by the selection being inside the span when
the smiley is inserted. 

Probably the code that inserts the smiley places the selection beyond the span,
but then later one (in the processing handled by
nsHTMLEditRules:AfterEditInner()) the selection is getting pulled back into the
span (in the case where the smiley is at the end of it's block, as is often the
case when you insert it as you type).

The selection adjusting code needs to make sure that it does not cross
-moz-user-select: all boundaries when adjusting the selection.
> The regression is most likely caused by the selection being inside the span
> when the smiley is inserted. 

Discussed with Joe on IRC, this is not the cause.
The bug still is seen if one moves the caret around in the document, moving to
back to the position after the smiley.
using the trunk build from 20030612 on win2K

1. opened mail
2. created a new message with the following:
aaaa[smiley]bbbb
3. put focus at the end of the line and hit backspace

smiley was deleted as expected
Status: RESOLVED → VERIFIED
I can't delete smileys with the backspace key in TB17. The delete key works fine.
Steps to reproduce:
1. Write:
aaaaa[smiley]aaaaaaaa
2. Press backspace numerous times

Result: only text deleted

I'm not sure if i should file another bug for my issue.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: