diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 3b2448b2a7e..84cd59d4ee6 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -8558,13 +8558,7 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, // Get the geometric parent. Use the prev sibling if we have it; // otherwise use the next sibling - if (prevSibling) { - prevSibling->GetParent(&parentFrame); - } - else if (nextSibling) { - nextSibling->GetParent(&parentFrame); - } - else { + if (!prevSibling && !nextSibling) { // No previous or next sibling so treat this like an appended frame. isAppend = PR_TRUE; diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 3b2448b2a7e..84cd59d4ee6 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -8558,13 +8558,7 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext, // Get the geometric parent. Use the prev sibling if we have it; // otherwise use the next sibling - if (prevSibling) { - prevSibling->GetParent(&parentFrame); - } - else if (nextSibling) { - nextSibling->GetParent(&parentFrame); - } - else { + if (!prevSibling && !nextSibling) { // No previous or next sibling so treat this like an appended frame. isAppend = PR_TRUE;