diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /dom/base/RadioGroupContainer.cpp | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/RadioGroupContainer.cpp')
-rw-r--r-- | dom/base/RadioGroupContainer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dom/base/RadioGroupContainer.cpp b/dom/base/RadioGroupContainer.cpp index 3bb4d7da20..988c8186f9 100644 --- a/dom/base/RadioGroupContainer.cpp +++ b/dom/base/RadioGroupContainer.cpp @@ -8,6 +8,7 @@ #include "mozilla/dom/RadioGroupContainer.h" #include "mozilla/dom/TreeOrderedArrayInlines.h" #include "mozilla/Assertions.h" +#include "nsIFrame.h" #include "nsIRadioVisitor.h" #include "nsRadioVisitor.h" @@ -125,7 +126,9 @@ nsresult RadioGroupContainer::GetNextRadioButton( index = 0; } radio = radioGroup->mRadioButtons->ElementAt(index); - } while (radio->Disabled() && radio != currentRadio); + } while ((radio->Disabled() || !radio->GetPrimaryFrame() || + !radio->GetPrimaryFrame()->IsVisibleConsideringAncestors()) && + radio != currentRadio); radio.forget(aRadioOut); return NS_OK; @@ -135,7 +138,8 @@ HTMLInputElement* RadioGroupContainer::GetFirstRadioButton( const nsAString& aName) { nsRadioGroupStruct* radioGroup = GetOrCreateRadioGroup(aName); for (HTMLInputElement* radio : radioGroup->mRadioButtons.AsList()) { - if (!radio->Disabled()) { + if (!radio->Disabled() && radio->GetPrimaryFrame() && + radio->GetPrimaryFrame()->IsVisibleConsideringAncestors()) { return radio; } } |