summaryrefslogtreecommitdiffstats
path: root/dom/html/HTMLImageElement.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /dom/html/HTMLImageElement.cpp
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/html/HTMLImageElement.cpp')
-rw-r--r--dom/html/HTMLImageElement.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/dom/html/HTMLImageElement.cpp b/dom/html/HTMLImageElement.cpp
index 691216d152..597d7f4b22 100644
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -6,6 +6,7 @@
#include "mozilla/dom/HTMLImageElement.h"
#include "mozilla/PresShell.h"
+#include "mozilla/FocusModel.h"
#include "mozilla/dom/BindContext.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/HTMLImageElementBinding.h"
@@ -488,13 +489,13 @@ nsINode* HTMLImageElement::GetScopeChainParent() const {
return nsGenericHTMLElement::GetScopeChainParent();
}
-bool HTMLImageElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
- int32_t* aTabIndex) {
+bool HTMLImageElement::IsHTMLFocusable(IsFocusableFlags aFlags,
+ bool* aIsFocusable, int32_t* aTabIndex) {
int32_t tabIndex = TabIndex();
if (IsInComposedDoc() && FindImageMap()) {
// Use tab index on individual map areas.
- *aTabIndex = (sTabFocusModel & eTabFocus_linksMask) ? 0 : -1;
+ *aTabIndex = FocusModel::IsTabFocusable(TabFocusableType::Links) ? 0 : -1;
// Image map is not focusable itself, but flag as tabbable
// so that image map areas get walked into.
*aIsFocusable = false;
@@ -502,8 +503,10 @@ bool HTMLImageElement::IsHTMLFocusable(bool aWithMouse, bool* aIsFocusable,
}
// Can be in tab order if tabindex >=0 and form controls are tabbable.
- *aTabIndex = (sTabFocusModel & eTabFocus_formElementsMask) ? tabIndex : -1;
- *aIsFocusable = IsFormControlDefaultFocusable(aWithMouse) &&
+ *aTabIndex = FocusModel::IsTabFocusable(TabFocusableType::FormElements)
+ ? tabIndex
+ : -1;
+ *aIsFocusable = IsFormControlDefaultFocusable(aFlags) &&
(tabIndex >= 0 || GetTabIndexAttrValue().isSome());
return false;