Bug 88831 Support new IME API "Text Services Framework" from Office XP and Windows XP r=masayuki+peterv, sr=roc

This commit is contained in:
Jim Chen
2009-02-07 18:52:59 +09:00
parent a79da437b8
commit 30f63309c9
22 changed files with 4305 additions and 159 deletions

View File

@@ -118,7 +118,7 @@
#include "nsIDOMNSFeatureFactory.h"
#include "nsIDOMDocumentType.h"
#include "nsIDOMUserDataHandler.h"
#include "nsIDOMNSEditableElement.h"
#include "nsGenericHTMLElement.h"
#include "nsIEditor.h"
#include "nsIEditorDocShell.h"
#include "nsEventDispatcher.h"
@@ -343,13 +343,15 @@ nsINode::GetTextEditorRootContent(nsIEditor** aEditor)
if (aEditor)
*aEditor = nsnull;
for (nsINode* node = this; node; node = node->GetNodeParent()) {
nsCOMPtr<nsIDOMNSEditableElement> editableElement(do_QueryInterface(node));
if (!editableElement)
if (!node->IsNodeOfType(eHTML))
continue;
nsCOMPtr<nsIEditor> editor;
editableElement->GetEditor(getter_AddRefs(editor));
NS_ENSURE_TRUE(editor, nsnull);
static_cast<nsGenericHTMLElement*>(node)->
GetEditorInternal(getter_AddRefs(editor));
if (!editor)
continue;
nsIContent* rootContent = GetEditorRootContent(editor);
if (aEditor)
editor.swap(*aEditor);