Refactored code for detecting textbox or rich edit box editor state to use the
available properties of nsContextMenu
Refactored code for detecting textbox or rich edit box editor state to use the
available properties of nsContextMenu - in function newFromTextbox()