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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Edgar Chen 2019-02-13 19:11:43 +00:00
Родитель e8d5e8fa11
Коммит d2d97dd768
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -3146,6 +3146,8 @@ nsIContent* nsFocusManager::GetNextTabbableContentInAncestorScopes(
int32_t tabIndex = 0;
if (IsHostOrSlot(startContent)) {
tabIndex = HostOrSlotTabIndexValue(startContent);
} else if (nsIFrame* frame = startContent->GetPrimaryFrame()) {
frame->IsFocusable(&tabIndex);
} else {
startContent->IsFocusable(&tabIndex);
}