diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index df20ec233485..5463396cfddc 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -796,6 +796,8 @@ ContainerLayer::RepositionChild(Layer* aChild, Layer* aAfter) (aAfter->Manager() == Manager() && aAfter->GetParent() == this), "aAfter is not our child"); + NS_ASSERTION(aChild != aAfter, + "aChild cannot be the same as aAfter"); Layer* prev = aChild->GetPrevSibling(); Layer* next = aChild->GetNextSibling();