Bug 1249556 - Rename override to disallowOverridingFocusability. r=bz
authorTing-Yu Lin <tlin@mozilla.com>
Fri, 18 Mar 2016 13:47:50 +0800
changeset 289552 1e26562f4f3673214e34c4733bcce3e342c81dbc
parent 289525 f14898695ee0dd14615914f3e1401f17df57fdd7
child 289553 a2fe8535e63bcddaa25f838b8f7de41a7ad2a0cb
push id18283
push usercbook@mozilla.com
push dateMon, 21 Mar 2016 15:02:44 +0000
treeherderfx-team@af22a2e633c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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);