Bug 1518121 - Part 1: Check isFocusable from frame first if content has frame; r=smaug
authorEdgar Chen <echen@mozilla.com>
Wed, 13 Feb 2019 19:11:43 +0000
changeset 459019 dfeedf1391264cf677aa2e275ae02abd2d25483d
parent 459018 2045ba64df59a540532ca92c769d701264b96961
child 459020 db9ccc4f8c6ee8c425dfe4a234dbd6c30cac1c47
push id35554
push userrgurzau@mozilla.com
push dateThu, 14 Feb 2019 17:00:27 +0000
treeherdermozilla-central@db6bcdbe4040 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1518121
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518121 - Part 1: Check isFocusable from frame first if content has frame; r=smaug This is for the scrollable frame, because nsIFrame::IsFocusable of a scrollable frame returns true with tabIndex = 0 even if the content has no tabIndex attribute. Differential Revision: https://phabricator.services.mozilla.com/D19646
dom/base/nsFocusManager.cpp
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -3141,16 +3141,18 @@ nsIContent* nsFocusManager::GetNextTabba
   MOZ_ASSERT(IsHostOrSlot(aStartOwner), "scope owner should be host or slot");
 
   nsIContent* owner = aStartOwner;
   nsIContent* startContent = *aStartContent;
   while (IsHostOrSlot(owner)) {
     int32_t tabIndex = 0;
     if (IsHostOrSlot(startContent)) {
       tabIndex = HostOrSlotTabIndexValue(startContent);
+    } else if (nsIFrame* frame = startContent->GetPrimaryFrame()) {
+      frame->IsFocusable(&tabIndex);
     } else {
       startContent->IsFocusable(&tabIndex);
     }
     nsIContent* contentToFocus = GetNextTabbableContentInScope(
         owner, startContent, aOriginalStartContent, aForward, tabIndex,
         aIgnoreTabIndex, aForDocumentNavigation, false /* aSkipOwner */);
     if (contentToFocus) {
       return contentToFocus;