Open Bug 1718779 Opened 3 years ago Updated 2 years ago

Inconsistent ability to set font within Fixed Width Test Style (tt)

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 91
defect

Tracking

(Not tracked)

People

(Reporter: henry-x, Unassigned)

Details

Steps to reproduce

  1. Open a new HTML message composition
  2. Select a style that implies a fixed with. i.e. from Format -> Text Styles select either "Fixed Width", "Code" or "Variable". The easiest way to do this is use Ctrl-T to choose the "Fixed Width".
  3. Type "abcd".
  4. Either
    (A) select "bc"; or
    (B) select "bc" and toggle the style off and then on again; or
    (C) select "abcd".
  5. Select the "Helvetica, Arial" font.

Result

For (A), the middle region has the font changed. For (B) and (C), the UI shows the font as "Helvetica, Arial" for a brief moment, and then switches to "Fixed Width", the font still appears as Fixed Width.

Expect

The results to match up. Especially since at the end of step 4, the UI information is identical to a user for cases (A) and (B). When we are in such a styling that implies a (Fixed Width) font, either:

  • we should always be able to set the font, and it takes precedence over the implied font; or
  • setting the font is disabled or ignored (in particular, the UI should not switch back and forth, and the underlying HTML should not have any <font family="..."> added; or
  • setting the font implicitly removes the styling. Similar to how setting the "Variable Width" font will break the <tt> styling (although it doesn't do this for <code> or <var>).

Message HTML

The HTML for the paragraph produced in case (A) is

<tt>
  a
  <font face="Helvetica, Arial, sans-serif">bc</font>
  d
</tt>

In case (B)

<tt>a</tt>
<font face="Helvetica, Arial, sans-serif">
  <!-- Middle tt was created by toggling the style -->
  <tt>bc</tt>
</font>
<tt>d</tt>

In case (C)

<font face="Helvetica, Arial, sans-serif">
  <tt>abcd</tt>
</font>

So the difference between case (A) and cases (B) and (C), is the ordering of <font> with respect to <tt>.

We really shouldn't be using <tt> to begin with...

NOTE: There are commented out test lines that can be uncommented when this is fixed https://searchfox.org/comm-central/search?q=1718779&path=&case=true&regexp=false

You need to log in before you can comment on or make changes to this bug.