diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 5740ac03c5d8..07ec9286d7b7 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -4315,7 +4315,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, (void**)getter_AddRefs(selectElement)); if (NS_SUCCEEDED(res) && selectElement) { nsCOMPtr childContent; - aContainer->ChildAt(i, *getter_AddRefs(childContent)); + aContainer->ChildAt(aNewIndexInContainer, *getter_AddRefs(childContent)); if (childContent) { RemoveDummyFrameFromSelect(aPresContext, shell, aContainer, childContent, selectElement); } diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 5740ac03c5d8..07ec9286d7b7 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -4315,7 +4315,7 @@ nsCSSFrameConstructor::ContentAppended(nsIPresContext* aPresContext, (void**)getter_AddRefs(selectElement)); if (NS_SUCCEEDED(res) && selectElement) { nsCOMPtr childContent; - aContainer->ChildAt(i, *getter_AddRefs(childContent)); + aContainer->ChildAt(aNewIndexInContainer, *getter_AddRefs(childContent)); if (childContent) { RemoveDummyFrameFromSelect(aPresContext, shell, aContainer, childContent, selectElement); }