Bug 1249556 - Rename override to disallowOverridingFocusability. r=bz
Rename 'override' to 'disallowOverridingFocusability' in
nsGenericHTMLElement::IsHTMLFocusable() to make the implementation
reflect the semantic that the subclass is disallow to override the value
returned in aIsFocusable described in nsGenericHTMLElement.h.
Also 'override' is a new specifier since C++11. Rename it make the
syntax highlight looks right.
MozReview-Commit-ID: CShdChjBv7j
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -2717,49 +2717,50 @@ nsGenericHTMLElement::IsHTMLFocusable(bo
}
*aIsFocusable = false;
return true;
}
int32_t tabIndex = TabIndex();
-
- bool override, disabled = false;
+ bool disabled = false;
+ bool disallowOverridingFocusability = true;
+
if (IsEditableRoot()) {
// Editable roots should always be focusable.
- override = true;
+ disallowOverridingFocusability = true;
// Ignore the disabled attribute in editable contentEditable/designMode
// roots.
if (!HasAttr(kNameSpaceID_None, nsGkAtoms::tabindex)) {
// The default value for tabindex should be 0 for editable
// contentEditable roots.
tabIndex = 0;
}
}
else {
- override = false;
+ disallowOverridingFocusability = false;
// Just check for disabled attribute on form controls
disabled = IsDisabled();
if (disabled) {
tabIndex = -1;
}
}
if (aTabIndex) {
*aTabIndex = tabIndex;
}
// If a tabindex is specified at all, or the default tabindex is 0, we're focusable
- *aIsFocusable =
+ *aIsFocusable =
(tabIndex >= 0 || (!disabled && HasAttr(kNameSpaceID_None, nsGkAtoms::tabindex)));
- return override;
+ return disallowOverridingFocusability;
}
void
nsGenericHTMLElement::RegUnRegAccessKey(bool aDoReg)
{
// first check to see if we have an access key
nsAutoString accessKey;
GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accessKey);