Bug 1675349: Forbid elements representing blocked plugins from accepting focus r=jmathies
As part of the fallback for unsupported plugin elements, we deny them focus. Since elements can be programmatically changed, and object/embed elements can change internal "type" by updating their data/src attributes, and because that type is decided asynchronously, we may need to give up focus if our element has it. Differential Revision: https://phabricator.services.mozilla.com/D95903
This commit is contained in:
@@ -289,6 +289,17 @@ bool HTMLObjectElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we have decided that this is a blocked plugin then do not allow focus.
|
||||
if ((Type() == eType_Null) &&
|
||||
(PluginFallbackType() == eFallbackBlockAllPlugins)) {
|
||||
if (aTabIndex) {
|
||||
*aTabIndex = -1;
|
||||
}
|
||||
|
||||
*aIsFocusable = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
const nsAttrValue* attrVal = mAttrs.GetAttr(nsGkAtoms::tabindex);
|
||||
bool isFocusable = attrVal && attrVal->Type() == nsAttrValue::eInteger;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user