From be138568230e44d1b863360b869677ea7cbd478e Mon Sep 17 00:00:00 2001 From: "masayuki%d-toybox.com" Date: Thu, 17 Nov 2005 03:36:38 +0000 Subject: [PATCH] Bug 316715 should enable IME on applet and embed elements r+sr=roc --- content/html/content/src/nsHTMLAppletElement.cpp | 10 ++++++++++ content/html/content/src/nsHTMLSharedElement.cpp | 12 +++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/content/html/content/src/nsHTMLAppletElement.cpp b/content/html/content/src/nsHTMLAppletElement.cpp index ea5f4c997a1b..91f9891b8e38 100644 --- a/content/html/content/src/nsHTMLAppletElement.cpp +++ b/content/html/content/src/nsHTMLAppletElement.cpp @@ -85,6 +85,7 @@ public: NS_IMETHOD SetTabIndex(PRInt32 aTabIndex); // Let applet decide whether it wants focus from mouse clicks virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull); + virtual PRUint32 GetDesiredIMEState(); virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, @@ -325,3 +326,12 @@ nsHTMLAppletElement::IsFocusable(PRInt32 *aTabIndex) return nsGenericHTMLElement::IsFocusable(aTabIndex); } + +PRUint32 +nsHTMLAppletElement::GetDesiredIMEState() +{ + if (nsObjectLoadingContent::Type() == eType_Plugin) + return nsIContent::IME_STATUS_ENABLE; + return nsIContent::GetDesiredIMEState(); +} + diff --git a/content/html/content/src/nsHTMLSharedElement.cpp b/content/html/content/src/nsHTMLSharedElement.cpp index 94f01759cfad..6c701339b192 100644 --- a/content/html/content/src/nsHTMLSharedElement.cpp +++ b/content/html/content/src/nsHTMLSharedElement.cpp @@ -131,7 +131,8 @@ public: NS_IMETHOD GetTabIndex(PRInt32* aTabIndex); NS_IMETHOD SetTabIndex(PRInt32 aTabIndex); virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull); - + virtual PRUint32 GetDesiredIMEState(); + virtual PRBool ParseAttribute(nsIAtom* aAttribute, const nsAString& aValue, nsAttrValue& aResult); @@ -604,3 +605,12 @@ nsHTMLSharedElement::IsFocusable(PRInt32 *aTabIndex) return nsGenericHTMLElement::IsFocusable(aTabIndex); } + +PRUint32 +nsHTMLSharedElement::GetDesiredIMEState() +{ + if (mNodeInfo->Equals(nsHTMLAtoms::embed) && + nsObjectLoadingContent::Type() == eType_Plugin) + return nsIContent::IME_STATUS_ENABLE; + return nsIContent::GetDesiredIMEState(); +}