зеркало из https://github.com/mozilla/pjs.git
Make sure plugin focus logic only apples for applet, object, and embed elements. Bug 311111, r+sr=bzbarsky.
This commit is contained in:
Родитель
e1c55d69c4
Коммит
89e1b79ade
|
@ -241,17 +241,17 @@ nsHTMLObjectElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||||
|
|
||||||
PRBool nsHTMLObjectElement::IsFocusable(PRInt32 *aTabIndex)
|
PRBool nsHTMLObjectElement::IsFocusable(PRInt32 *aTabIndex)
|
||||||
{
|
{
|
||||||
if (aTabIndex) {
|
|
||||||
GetTabIndex(aTabIndex);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Type() == eType_Plugin) {
|
if (Type() == eType_Plugin) {
|
||||||
// Has plugin content: let the plugin decide what to do in terms of
|
// Has plugin content: let the plugin decide what to do in terms of
|
||||||
// internal focus from mouse clicks
|
// internal focus from mouse clicks
|
||||||
|
if (aTabIndex) {
|
||||||
|
GetTabIndex(aTabIndex);
|
||||||
|
}
|
||||||
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return HasAttr(kNameSpaceID_None, nsHTMLAtoms::tabindex);
|
return nsGenericHTMLFormElement::IsFocusable(aTabIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -130,9 +130,7 @@ public:
|
||||||
// Have to override tabindex for <embed> to act right
|
// Have to override tabindex for <embed> to act right
|
||||||
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
NS_IMETHOD GetTabIndex(PRInt32* aTabIndex);
|
||||||
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
NS_IMETHOD SetTabIndex(PRInt32 aTabIndex);
|
||||||
// Let plugin decide whether it wants focus from mouse clicks
|
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
||||||
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull)
|
|
||||||
{ if (aTabIndex) GetTabIndex(aTabIndex); return PR_TRUE; }
|
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
|
@ -594,3 +592,17 @@ nsHTMLSharedElement::IntrinsicState() const
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче