Need text highlight feature to apply background color to selected text (inline css <span style="background-color:xxx">) / Page background color picker is misplaced

NEW
Unassigned

Status

MailNews Core
Composition
--
enhancement
13 years ago
a year ago

People

(Reporter: Kevin Cook, Unassigned, NeedInfo)

Tracking

(Blocks: 1 bug)

Dependency tree / graph
Bug Flags:
wanted-thunderbird3 ?

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [GS], URL)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Attempting to apply a background color to a block of text in an HTML compose window applies the color to the page background instead.  HTML source code does not appear to be modified by the background-color selection.

Reproducible: Always

Steps to Reproduce:
1. Select text (in HTML compose window)
2. Click on "choose color for background" icon in HTML attributes task bar next to font selection.
3. Select a color
4. Click "OK" to apply color.


Actual Results:  
Color gets applied to page background and not to text selected.


There doesn't seem to be a workaround or any other way to highlight text with background color in HTML mail.

Comment 1

13 years ago
The desired behavior is not implemented.  One primary reason for this is that mail compose does not make use of CSS; background coloration only applies to 
the body in mail compose.

Note that using NVu, which has more advanced HTML editing, it is possible to use the toolbar to set the background color for the block-level tag (e.g. <p> or <div>) containing the selection, but not for only the selected text itself, nor for an inline tag (<span> or <b>) containing it.

The workaround is to select the text you wish to highlight, then from the menu pick   Insert | HTML.   A window will appear with the selected text (and any tags) shown in an edit buffer.  At the beginning of this buffer, add:
   <span style="background-color: yellow;">    (or whatever color you wish)
and at the end of the buffer, add
   </span>
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Component: Message Compose Window → MailNews: Composition
Ever confirmed: true
OS: Windows 2000 → All
Product: Thunderbird → Core
Hardware: PC → All
Summary: Applying background color to a block of text in an HTML compose window applies to page background instead. → Means to apply background color (highlight) to a selection in an HTML composition
Version: unspecified → Trunk
(Reporter)

Comment 2

13 years ago
I've been using Thunderbird for a while now and hadn't noticed this issue because I don't use HTML mail at all.

One of my engineering colleagues at work is trying out Thunderbird in the hope of dumping Outlook.  He noticed this and asked me (webmaster) if it looks broken to me or not.  After testing I concluded "yes."  He's not an HTML-savvy guy, just someone trying to do his email the way he always does.  I'm guessing that Outlook must have a similar function to this for him to have attempted to use Thunderbird this way.

The UI gives the impression that background color applied to a block of text should work.  Perhaps something should be done to the UI so that users don't develop a false expectation and then conclude that Thunderbird is broken.

Possible suggestions that perhaps you can improve on:

1. Currently, hovering over the background-color icon in HTML attributes task bar gives a tooltip that says "Choose color for background."  If a text selection has been made the by user, s/he would expect this action to operate on the selection.

Perhaps tooltip should say something like "Choose background color for this message" so that user should not expect the text selection to be affected.

2. When user clicks on background-color icon in HTML attributes task bar, the color-selection pallette that opens is misleadingly entitled "Block background color."

Since it doesn't affect the "block" of text selected, perhaps change it to something like "Message background color."

Updated

12 years ago
Duplicate of this bug: 369833

Updated

10 years ago
Blocks: 366671

Updated

10 years ago
Assignee: mscott → nobody
QA Contact: composition
(Assignee)

Updated

10 years ago
Product: Core → MailNews Core

Updated

10 years ago
Duplicate of this bug: 458249

Comment 5

10 years ago
Is there anything that prevent to implement in the UI the manual solution proposed in comment#1 in TB3?
I test it and it works well:
 <span style="background-color: yellow;"> 
 My word with yellow background
 </span>

I received the message on gmail with the correct background.
Flags: wanted-thunderbird3?

Comment 6

10 years ago
Also, this bug should be linked to Bug 423488 -  Outlook Express/Outlook parity bugs  because Outlook (or Gmail, ...) has this feature.
Source: http://office.microsoft.com/en-us/outlook/HA101671421033.aspx

Note that Windows Live Mail doesn't have this feature (source: http://email.about.com/od/windowsmailtips/qt/et_highlight.htm ).

Comment 7

10 years ago
Last new, I found an Add-ons that do the job: Highlight Text, available here: https://addons.mozilla.org/fr/thunderbird/addon/6509

However, I think this should be solve in core, not by an Add-on.

Comment 8

9 years ago
I agree - this would be a very useful feature

Comment 9

9 years ago
I've recently switched an organization (+60 computers) from Outlook to Thunderbird and one of the few recurrent complaints afterward was the lack of text highlighter functionality.

This should be considered as a low cost high reward addition for Thunderbird 3.1.

Comment 10

8 years ago
@low cost high reward addition for Thunderbird: 
my thoughts exactly!

Updated

6 years ago
Duplicate of this bug: 748784

Comment 12

6 years ago
Ok, so here is what I don't understand:

(1) In SeaMonkey, if I open the Composer, there is a button "Choose highlight color for text" next to the fore/background color pickers which is exactly doing what's asked for here, i.e., inserting an HTML <span> element with style="background-color: rgb(255, 255, 0);" attribute (that's yellow in this case).

(2) Neither Thunderbird's Mail/News HTML editor nor SeaMonkey's offer that button in the formatting toolbar, though the editor should be the same as composer. This works when using Insert > HTML and manually entering the Composer-generated code as is, and is displayed properly with View > Message Body As > Original HTML.

(3) mail/components/compose/content/editorOverlay.xul has a <toolbarbutton id="HighlightColorButton" ... command="cmd_highlight"> defined, yet it doesn't show up.

Thus, is the highlight button hidden for some specific reason (i.e., won't work in Mail/News as suggested in comment #1, which may no longer apply), or does it "just" need to be made available in the (non-customizable) formatting bar to expose that functionality?

Comment 13

6 years ago
Unfortunately it's not that simple. I've made the button available by adding <toolbarbutton id="HighlightColorButton"/> after "color-buttons-container" in messengercompose.xul and it indeed showed up (except for the missing toolbar button icon). The HTML code inserted was <font bgcolor="..."> however, thus apparently more needs to be updated in the mail/suite branches to follow the editor implementation changes. Anyway, this was worth a try...

Comment 14

6 years ago
(In reply to caméléon from comment #7)
> Last new, I found an Add-ons that do the job: Highlight Text, available
> here: https://addons.mozilla.org/fr/thunderbird/addon/6509

Hi caméléon, this add-on seems to have been removed since, no luck with https://addons.mozilla.org/thunderbird/addon/highlight-text/

Is there some replacement for this which users can be directed to instead?

Updated

6 years ago
Blocks: 423488

Comment 15

6 years ago
@ rsx11m
It can be used add-on Highlighter instead:

https://addons.mozilla.org/de/thunderbird/addon/highlighter-222207/
No longer blocks: 366671
Depends on: 97840
Duplicate of this bug: 121210
See also: SM bug bug 489067, which if I understand bug 489067 comment 7 correctly has an intention of fixing this for SM only.
See Also: → bug 489067
Duplicate of this bug: 205907
Duplicate of this bug: 278498
Summary: Means to apply background color (highlight) to a selection in an HTML composition → Need text highlight feature to apply background color to selected text (inline css <span style="background-color:xxx">) / Page background color picker is misplaced
Duplicate of this bug: 921363
(In reply to Will Pittenger from bug 921363, comment #2)
> While I do a lot of coding, very little is
> Javascript.  I'm rather clumsy there.  Most of what I do these days is C# or
> Java.  And none of that resembles a website.  I'm familiar with XUL, but
> find XBL confusing.

Will, thanks for informative reply on your duplicate bug 921363. With that professional skill set, I'd believe you will be very capable of fixing this. The javascript required here can't be very much and probably obtainable by copy & paste from similar formats like text color (the other half of the color palette button).

I think it's more a matter of finding the right component and the right spot in code where we have to fix this. But Ian Neil could certainly be helpful with that and happily support you here...

(In reply to Ian Neal from bug 489067, comment #4)
> This is probably something in the shared editor/ui code, as you can also see
> it if you go into SeaMonkey Composer and use the formatting toolbar icons. I
> imagine it would be fairly easy to add a format text background color...
> menu item

Ian, could you help us to find the right product/component and a starting point in code where this could be fixed? With such information, we might manage to lure Will (reporter of duplicate bug 921363) into fixing this long-standing popular nuisance as he has a genuine interest in the feature and the general skillset required ;)
Flags: needinfo?(iann_bugzilla)
Some more preliminary info from Ian's in bug 489067 comment 8:
The XUL code itself is forked between TB and SM but the JS code that the XUL needs to use isn't.
http://mxr.mozilla.org/comm-central/search?string=EditorSelectColor&filter=[Ee]ditorSelectColor
Duplicate of this bug: 515029

Comment 24

5 years ago
(In reply to Thomas D. (away till 23rd Oct) from comment #22)
> Some more preliminary info from Ian's in bug 489067 comment 8:
> The XUL code itself is forked between TB and SM but the JS code that the XUL
> needs to use isn't.

It may be easier to fix for SeaMonkey given that the code in question is active already in its composer. Then, modifications in the suite/ tree can be ported to mail/ in this bug. On the other hand, if changing the JS code breaks the respective other application, and if the majority of action is going to happen in editor/ui/composer anyway, it would make sense to fix everything in the same bug (in which case the other bug can be simply closed once done).

Updated

2 years ago
Duplicate of this bug: 97840

Updated

2 years ago
See Also: → bug 1062093

Comment 26

2 years ago
Only 1 problem / Bug report, <https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines#Open_a_new_bug_report_for_each_issue!>!
So may be we should handle the "confusing UI" problem in a separate Bug like "Bug 1062093 - Misleading arrangement of 'text color' <-> 'page background color' chips"?

Comment 27

2 years ago
Same problem in composer!

And what is the difference between this one and "Bug 121210 - Implement text highlight feature to apply background color to selected text (inline css <span style="background-color:xxx">) / Page background color picker is misplaced"?

Comment 28

2 years ago
(In reply to Rainer Bielefeld from comment #26)
> So may be we should handle the "confusing UI" problem in a separate Bug like
> "Bug 1062093 - Misleading arrangement of 'text color' <-> 'page background
> color' chips"?

I think the original report here refers to just a single issue: The background colorpicker applies the change to the document <body> where the expectation is that the change is applied to the selected text only by introducing a <span> element around it (which is what the foreground colorpicker does).

You still want to be able to pick a background color for the whole message, possibly by introducing another icon for the body background color and tweaking the existing ones for the selection background color. Bug 97840 alternatively suggests to keep current overlapping icons but let their behavior vary (body background if no text selected, highlight text is one is selected).

(In reply to Rainer Bielefeld from comment #27)
> And what is the difference between this one and "Bug 121210 - Implement text
> highlight feature to apply background color to selected text (inline css
> <span style="background-color:xxx">) / Page background color picker is
> misplaced"?

Don't see any. In fact, the title appears to be partially copy-pasted from the bug here.

We may consider 3 bugs though for the individual steps: (1) this bug here to establish any backend changes; (2) UI work necessary for Thunderbird's composition window, like new buttons; similarly, SeaMonkey bug 489067 can handle any UI work for SeaMonkey's Mail/News Composition and Composer windows.

Comment 29

2 years ago
There are two surprising things:
1. TB doesn't know this very basic feature
2. Eleven years after the feature request it is still debated what the requested feature was. 

If it counts then I vote for this feature. 

It is very important in corporate environment (as well) to emphasize the point of my thoughts. As a developer, I frequently paste code snippets for the colleagues to compare them. Highlighting the difference with some background color is way much better than applying bold or red characters because less visible differences, for example comma versus semicolon, can stay hidden if the background color is the same.

Please add this feature to TB. Thanks.

Comment 30

2 years ago
We have several Bus in this area (MailNews and SeaMonkey HTML Composer), some cleanup will be required.

The problem also affects SeaMonkey HTML-Webpage-Composer

Bug 121210 - Implement text highlight feature to apply background color to selected text (inline css <span style="background-color:xxx">) / Page background color picker is misplaced (edit)

Bug 489067 - [SM] Allow inline background color for selected text in Message Compose

Bug 1062093 - Misleading arrangement of 'text color' <-> 'page background color' chips
See Also: → bug 121210

Comment 31

a year ago
The foreground/background color selector item on the toolbar should apply *ONLY* to selected text. 

Foreground color works correctly. 
Background color does not work as expected. 
Current (wrongful) behaviour is:
- if cursor in table, change background of current cell
- if cursor outside table, change background for entire page. 

Correct behaviour should be:
- regardless of cursor position, apply only to selected text, set selected text background color (ie highlight)

HTML equivalent is: <span style="color:#112233">highlighted text</span>
You need to log in before you can comment on or make changes to this bug.