Bug 1878753 - Fix focus gets incorrectly cleared by PresShell::FixUpFocus if the focus is on area element r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D200950
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "mozilla/dom/ElementBinding.h"
|
||||
#include "mozilla/dom/LargestContentfulPaint.h"
|
||||
#include "mozilla/dom/PerformanceMainThread.h"
|
||||
#include "mozilla/dom/HTMLAreaElement.h"
|
||||
#include "mozilla/ArrayUtils.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
@@ -1483,6 +1484,14 @@ bool PresShell::FixUpFocus() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If focus target is an area element with one or more shapes that are
|
||||
// focusable areas.
|
||||
if (auto* area = HTMLAreaElement::FromNode(currentFocus)) {
|
||||
if (nsFocusManager::IsAreaElementFocusable(*area)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame* f = currentFocus->GetPrimaryFrame();
|
||||
if (f && f->IsFocusable()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user