Bug 1230918 - remove useless null-pointer check on aChild that only caused a Coverity - Dereference before null check. r?dbaron
MozReview-Commit-ID: JzpMNHYEpgu
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -4279,24 +4279,22 @@ PresShell::ContentRemoved(nsIDocument *a
if (mPointerEventTarget) {
if (nsContentUtils::ContentIsDescendantOf(mPointerEventTarget, aChild)) {
mPointerEventTarget = aContainer;
}
}
// We should check that aChild does not contain pointer capturing elements.
// If it does we should release the pointer capture for the elements.
- if (aChild) {
- for (auto iter = gPointerCaptureList->Iter(); !iter.Done(); iter.Next()) {
- nsIPresShell::PointerCaptureInfo* data = iter.UserData();
- if (data && data->mOverrideContent &&
- nsContentUtils::ContentIsDescendantOf(data->mOverrideContent,
- aChild)) {
- nsIPresShell::ReleasePointerCapturingContent(iter.Key());
- }
+ for (auto iter = gPointerCaptureList->Iter(); !iter.Done(); iter.Next()) {
+ nsIPresShell::PointerCaptureInfo* data = iter.UserData();
+ if (data && data->mOverrideContent &&
+ nsContentUtils::ContentIsDescendantOf(data->mOverrideContent,
+ aChild)) {
+ nsIPresShell::ReleasePointerCapturingContent(iter.Key());
}
}
bool didReconstruct;
mFrameConstructor->ContentRemoved(aContainer, aChild, oldNextSibling,
nsCSSFrameConstructor::REMOVE_CONTENT,
&didReconstruct);