Bug 1249556 - Rename override to disallowOverridingFocusability. r=bz draft
authorTing-Yu Lin <tlin@mozilla.com>
Fri, 18 Mar 2016 13:47:50 +0800
changeset 342458 6cf17cf1771c3f75fb31d1d6f882daffa015ab1c
parent 342457 d737e53a56b4e7b195a691922b688b3dca11e421
child 342459 34598d95f35bf6b5bd927457ee09e42eb6ec0a68
push id13423
push usertlin@mozilla.com
push dateSat, 19 Mar 2016 12:38:16 +0000
reviewersbz
bugs1249556
milestone48.0a1
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
dom/html/nsGenericHTMLElement.cpp
--- 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);