Make sure plugin focus logic only apples for applet, object, and embed elements. Bug 311111, r+sr=bzbarsky, a=mscott.
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@181635 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -177,10 +177,6 @@ nsHTMLObjectElement::GetForm(nsIDOMHTMLFormElement** aForm)
|
||||
PRBool
|
||||
nsHTMLObjectElement::IsFocusable(PRInt32 *aTabIndex)
|
||||
{
|
||||
if (aTabIndex) {
|
||||
GetTabIndex(aTabIndex);
|
||||
}
|
||||
|
||||
nsIFrame* frame = GetPrimaryFrame(PR_FALSE);
|
||||
if (frame) {
|
||||
nsIObjectFrame *objFrame = nsnull;
|
||||
@@ -191,12 +187,16 @@ nsHTMLObjectElement::IsFocusable(PRInt32 *aTabIndex)
|
||||
if (pluginInstance) {
|
||||
// Has a plugin: let the plugin decide what to do in terms of
|
||||
// internal focus from mouse clicks
|
||||
if (aTabIndex) {
|
||||
GetTabIndex(aTabIndex);
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return HasAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex);
|
||||
|
||||
return nsGenericHTMLFormElement::IsFocusable(aTabIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -136,8 +136,7 @@ public:
|
||||
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 IsFocusable(PRInt32 *aTabIndex = nsnull);
|
||||
|
||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
@@ -511,3 +510,17 @@ nsHTMLSharedElement::GetAttributeMappingFunction() const
|
||||
|
||||
return nsGenericHTMLElement::GetAttributeMappingFunction();
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsHTMLSharedElement::IsFocusable(PRInt32 *aTabIndex)
|
||||
{
|
||||
if (mNodeInfo->Equals(nsHTMLAtoms::embed)) {
|
||||
// Let plugin decide whether it wants focus from mouse clicks
|
||||
if (aTabIndex) {
|
||||
GetTabIndex(aTabIndex);
|
||||
}
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::IsFocusable(aTabIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user