Closed Bug 335344 Opened 18 years ago Closed 18 years ago

Remove leading and trailing space character from emoticon text when using graphical smilies

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

Attachments

(1 file, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060404 SeaMonkey/1.0.1 Mnenhy/0.7.3.10006
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060404 SeaMonkey/1.0.1 Mnenhy/0.7.3.10006

The emoticon-building characters are placed inside a hidden <span> element when using graphical smilies. Inside this element, the smily characters become enclosed by additional whitespace characters not present in the messages' original text. 

This is an unnecessary alteration, and can even lead to unwanted behaviour if the original text smilies are re-activated via userContenc.css while leaving general "glyph replacement" activated (that's how I discovered this).

Reproducible: Always



Expected Results:  
Do not alter the smilies' text in any way.
Status: UNCONFIRMED → NEW
Component: MailNews: Main Mail Window → MailNews: Backend
Ever confirmed: true
Product: Mozilla Application Suite → Core
Version: unspecified → Trunk
Assignee: mail → bugzilla
Actually, your patch here won't solve bug 234638, but it's needed to fix that one (I have a patch for that)... :-)
Blocks: 234638
(In reply to comment #2)
> Actually, your patch here won't solve bug 234638,

I know - that's why I said "trying :-)

> but it's needed to fix that one (I have a patch for that)... :-)

Great.
 

Attached patch same patch, improved file format (obsolete) — Splinter Review
Attachment #219728 - Attachment is obsolete: true
Attachment #219829 - Flags: review?(ben.bucksch)
Comment on attachment 219829 [details] [diff] [review]
same patch, improved file format

Patch is still messed up.

You're only removing 2 spaces and adding title="tagTXT", right? (Or trying to...)

Please check for side effects, the space may have been intentional as workaround for Gecko wrapping strangeness.
Attachment #219829 - Flags: review?(ben.bucksch) → review-
> Patch is still messed up.

First "+" line missing, it seems.

> You're only removing 2 spaces and adding title="tagTXT", right?

Adding the tagTXT as a title.

> Please check for side effects, the space may have been intentional as
> workaround for Gecko wrapping strangeness.
 
I don't see any side effects. Usually, we recognise only smilies surrounded by spaces, and those are kept - what good should spaces do here that are not needed in real HTML? These spaces are even messing up textual copies of smilies!
I really think they're just (misplaced) there for "beauty", because they were believed not to be seen at all. Or do you have any special edge cases in mind?
Attached patch fixed patch (been stupid) (obsolete) — Splinter Review
Yikes! Yes, my bad - the missing line was the result of a c&p mishap while editing the source file. *Now* it only removes two whitespaces around the smily and adds the title attribute in preparation for bug 234638. :-)

I tested this patch thoroughly with both plain text and HTML messages, using manual line wrap and letting mailnews doing the wrapping, and couldn't find any peculiarity in wrapping behaviour - or even any difference at all.
Attachment #219829 - Attachment is obsolete: true
Attachment #219946 - Flags: review?(ben.bucksch)
Comment on attachment 219946 [details] [diff] [review]
fixed patch (been stupid)

I wonder why the additional <span> is added there, too, so I think we're missing something.

Nevertheless, trusting your claim to have tested it carefully. r=BenB
Attachment #219946 - Flags: review?(ben.bucksch) → review+
(P.S. please keep the comment
// e.g. smiley-frown
instead of "smiley image" - it's important to make sense of the code and the related CSS.)
(In reply to comment #9)
> (P.S. please keep the comment
> // e.g. smiley-frown
> instead of "smiley image" - it's important to make sense of the code and the
> related CSS.)

Oh, sorry, I wasn't aware of that - this being my very first patch submission on Bugzilla, I'm not sure how to do this with a patch already bearing an r+ flag.

Resubmit a new patch anyway?
> Resubmit a new patch anyway?

Not necessarily, a small change like that can be done on check-in. Ask for sr, and only if the sr wants other changes as well provide a new patch.

Attachment #219946 - Flags: superreview?(bienvenu)
Attachment #219946 - Flags: superreview?(bienvenu) → superreview+
Attachment #219946 - Attachment is obsolete: true
Checked in on the trunk.
mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp 	1.82
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9alpha
*** Bug 341476 has been marked as a duplicate of this bug. ***
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: