[Bug 584632]

Mozilla-jorgk 584632 at bugs.launchpad.net
Sat Feb 28 23:31:44 UTC 2015


In nsEditor::InsertTextImpl we find this code:
if (mComposition) {
 ...
} else {
 if (node->IsNodeOfType(nsINode::eTEXT)) {
  ...
 } else {
  // we are inserting text into a non-text node.  first we have to create a
  // textnode (this also populates it with the text)
  node->AsElement()->List(stdout,0,EmptyCString());
  ...

Debugging shows that when the font is lost - after clicking elsewhere and then clicking again at the end of the line - "we are inserting text into a non-text node". Dumping out the 'node' at this point gives:
body at 1197C400 text="#000000" bgcolor="#FFFFFF" _moz_dirty="" state=[40000020004] flags=[00104008] ranges:1 primaryframe=0BFDD498 refcount=62<
  tt at 0DAA42E0 _moz_dirty="" state=[40000020000] flags=[00100000] primaryframe=0D3A5020 refcount=5<
    Text at 0C58D650 flags=[02000008] primaryframe=0D3A5070 refcount=14<one>
  >
  br at 0DCF3D00 _moz_dirty="" state=[40000020000] flags=[00100000] primaryframe=0BFDFA90 refcount=4<>
  br at 0DCF3DC0 _moz_dirty="" state=[40000020000] flags=[00100000] primaryframe=0BFDF968 refcount=2<>
  div at 0DCF3E80 _moz_dirty="" class="moz-cite-prefix" state=[40000020000] flags=[00100400] primaryframe=0BFDFD20 refcount=4<
    Text at 0DCFFD80 flags=[03000008] primaryframe=0BFE0088 refcount=3<On 26/02/2015 20:59, Bugzilla at Mozilla wrote:>
    br at 0DCF3EE0 _moz_dirty="" state=[40000020000] flags=[00100000] primaryframe=0BFDF8F0 refcount=2<>
  >
(Note: In my test I was answering a Bugzilla e-mail and my composition style was "tt". I had typed the word "one" before clicking elsewhere and then clicking again after "one". On the next keystroke the above dump was produced.)

This confirms what Ehsan said in comment #22: The key to this problem is
what happens when clicking at the end of the line to continue typing. By
the looks of it, the click does not identify the correct element where
the user would like to continue typing. Instead a new node is created
which is lacking the font information.

I could use some help to locate the code that translates the click into
identifying the element. Somewhere in ns(HTML)EditorEventListener.cpp, I
suppose.

-- 
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to Mozilla.
https://bugs.launchpad.net/bugs/584632

Title:
  composer changes font mid email

To manage notifications about this bug go to:
https://bugs.launchpad.net/thunderbird/+bug/584632/+subscriptions



More information about the Ubuntu-mozillateam-bugs mailing list