Bug 1425440 - Get rid of GetChildAt_Deprecated in nsMenuItemX, r=catalinb
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 09 Jan 2018 11:44:54 +0100
changeset 452660 90492852dfc9021f4b34b77f24b07e335b1629db
parent 452659 30b995a49772ed07790ea802c8501bf2cee444fa
child 452661 8011797b1542dc75f3522437055087520baec71e
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatalinb
bugs1425440
milestone59.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 1425440 - Get rid of GetChildAt_Deprecated in nsMenuItemX, r=catalinb
widget/cocoa/nsMenuItemX.mm
--- a/widget/cocoa/nsMenuItemX.mm
+++ b/widget/cocoa/nsMenuItemX.mm
@@ -217,21 +217,19 @@ void nsMenuItemX::UncheckRadioSiblings(n
   if (!myGroupName.Length()) // no groupname, nothing to do
     return;
 
   nsCOMPtr<nsIContent> parent = inCheckedContent->GetParent();
   if (!parent)
     return;
 
   // loop over siblings
-  uint32_t count = parent->GetChildCount();
-  for (uint32_t i = 0; i < count; i++) {
-    nsIContent *sibling = parent->GetChildAt_Deprecated(i);
-    if (sibling &&
-        sibling != inCheckedContent &&
+  for (nsIContent* sibling = parent->GetFirstChild();
+       sibling; sibling = sibling->GetNextSibling()) {
+    if (sibling != inCheckedContent &&
         sibling->IsElement()) { // skip this node
       // if the current sibling is in the same group, clear it
       if (sibling->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
                                             myGroupName, eCaseMatters)) {
         sibling->AsElement()->SetAttr(kNameSpaceID_None, nsGkAtoms::checked, NS_LITERAL_STRING("false"), true);
       }
     }
   }