I'm working on a Rich Text Editor for IE, and I would like to ask a question about getting "fontname" value at the current insertion point.
The issue is with empty lines, let's say in the editor the user has typed in:
line 1
line 2
The empty line is between "line 1" and "line 2", the html source of the empty line in this example is (generated by IE when the user press "enter"):
<P><FONT size=5 face="Courier New"></FONT> </P>
and the problem is this: document.queryCommandValue("fontname")
gives me different values in case of mouse click the empty line, and in case of moving cursor to the empty line using keyboard.
In case of mouse click, it gives me the default font name of the browser, while in the other case (move cursor using keyboard) it gives me the correct fontname ("Courier New").
Actually in these two cases, document.selection
has different "type" values: "text" when mouse click and "none" when keyboard.
Any help will be much appreciated!
Please kindly let me know if my question is not clear.