Bug #23028

Changing the text color does not work in Firefox

Added by Chris topher almost 3 years ago. Updated over 1 year ago.

Status:Accepted Start date:2010-06-28
Priority:Should have Due date:
Assignee:Stanislas Rolland % Done:

0%

Category:rtehtmlarea
Target version:-
TYPO3 Version:4.4 Complexity:
PHP Version:
Votes: 0

Description

I use the dialogue SelectColor to choose a predefined color.

The first time, the text I marked gets the color as it should:
<p>I am <span style="color: rgb(255, 0, 0);">colored</span>.</p>

But when I then click the same text again (double click on the word) and give it a new color, this does not work correctly. The old span tag stays and a new one is added. I still see the old (wrong) color.
<p>I am <span style="color: rgb(45, 70, 152);"><span style="color: rgb(255, 0, 0);">colored</span></span>.</p>

In Internet Explorer (can't believe it) I get the right result: Only one span tag with the new color.

(issue imported from #M14906)

History

Updated by Chris topher almost 3 years ago

Basically the same also happens when changing the font family or the font size.

Updated by Stanislas Rolland almost 3 years ago

The problem arises when selecting with the mouse or keyboard and the mouse or keybord selection is moved betond the intended selection boundary and brought back at either end of the selection.

The attached patch should fix the issue in trunk and 4.4. Needs to be tested with various mouse gestures. More work to fix this in 4.3...

Still need to test in Opera, Safari and Chrome.

Updated by Stanislas Rolland almost 3 years ago

Oops! Need to backtrack on this. The problem is correctly described, but the solution would need to be much more elaborate. Need to think about this....

However, there is a easy workaround. If you simply put the cursor in any inline element (including a span created by applying color), then if you select a different color, or a font size or font style, or a text style, or a language, than any of these is applied to the inline element. This is consistent with the way inline element buttons work: if you put the cusor in an inline element, clicking on its button, removes the markup, clicking on another one converts the markup.

What do you think?

Updated by Chris topher almost 3 years ago

The workaround works.
But I don't know how I can help on that; if I knew a solution to the issue, I would have posted it... :-(

Updated by Stanislas Rolland over 1 year ago

  • Category set to rtehtmlarea
  • Target version deleted (0)
  • TYPO3 Version set to 4.4

Also available in: Atom PDF