Bug 310626. Flash text input broken. r+sr=bryner

This commit is contained in:
aaronleventhal%moonset.net 2005-10-03 19:29:52 +00:00
parent dc67d85812
commit 36778b8ea0
4 changed files with 29 additions and 0 deletions

View File

@ -83,6 +83,9 @@ public:
// Have to override tabindex for <embed> to act right
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
// Let applet decide whether it wants focus from mouse clicks
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull)
{ if (aTabIndex) GetTabIndex(aTabIndex); return PR_TRUE; }
virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
nsIContent* aBindingParent,

View File

@ -84,6 +84,7 @@ public:
nsIAtom* aPrefix, const nsAString& aValue,
PRBool aNotify);
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
// Overriden nsIFormControl methods
NS_IMETHOD_(PRInt32) GetType() const { return NS_FORM_OBJECT; }
@ -180,6 +181,8 @@ nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
return nsGenericHTMLFormElement::GetForm(aForm);
}
// nsIContent
nsresult
nsHTMLObjectElement::BindToTree(nsIDocument* aDocument,
nsIContent* aParent,
@ -236,6 +239,21 @@ nsHTMLObjectElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
aValue, aNotify);
}
PRBool nsHTMLObjectElement::IsFocusable(PRInt32 *aTabIndex)
{
if (aTabIndex) {
GetTabIndex(aTabIndex);
}
if (Type() == eType_Plugin) {
// Has plugin content: let the plugin decide what to do in terms of
// internal focus from mouse clicks
return PR_TRUE;
}
return HasAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex);
}
// nsIFormControl

View File

@ -130,6 +130,9 @@ public:
// Have to override tabindex for <embed> to act right
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
// Let plugin decide whether it wants focus from mouse clicks
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull)
{ if (aTabIndex) GetTabIndex(aTabIndex); return PR_TRUE; }
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
const nsAString& aValue,

View File

@ -73,6 +73,11 @@ public:
// nsIDOMHTMLObjectElement
NS_DECL_NSIDOMHTMLOBJECTELEMENT
// nsIContent
// Let plugin decide whether it wants focus from mouse clicks
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull)
{ if (aTabIndex) GetTabIndex(aTabIndex); return PR_TRUE; }
// Overriden nsIFormControl methods
NS_IMETHOD_(PRInt32) GetType()