Bug 735251 - make HTMLMediaElement unfocusable by mouse on OS X, r?bz draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 25 Feb 2016 19:55:16 +0000
changeset 334664 31c704a0d7f686dc7bdd6e3371a0568dcc2f570b
parent 334557 1c779b0b8969649dee0a8d48552ca314b36b1d0a
child 514964 eefa876fedcb3cfb632e7ec1f860bd035dc47a9b
push id11603
push usergijskruitbosch@gmail.com
push dateThu, 25 Feb 2016 19:55:44 +0000
reviewersbz
bugs735251
milestone47.0a1
Bug 735251 - make HTMLMediaElement unfocusable by mouse on OS X, r?bz MozReview-Commit-ID: K4xknFdgPW0
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2531,17 +2531,25 @@ void HTMLMediaElement::DoneCreatingEleme
 bool HTMLMediaElement::IsHTMLFocusable(bool aWithMouse,
                                        bool* aIsFocusable,
                                        int32_t* aTabIndex)
 {
   if (nsGenericHTMLElement::IsHTMLFocusable(aWithMouse, aIsFocusable, aTabIndex)) {
     return true;
   }
 
+
+#ifdef XP_MACOSX
+  // NB: this deliberately does not check
+  // nsFocusManager::sMouseFocusesFormControl as this is not a form control.
+  *aIsFocusable = !aWithMouse;
+#else
   *aIsFocusable = true;
+#endif
+
   return false;
 }
 
 int32_t HTMLMediaElement::TabIndexDefault()
 {
   return 0;
 }