Bug 1340885 - Null check frame's content when searching for NAC ancestors in GetCorrectedParent. r?xidorn
MozReview-Commit-ID: 7u2yKe8ir1V
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -9100,17 +9100,18 @@ GetCorrectedParent(const nsIFrame* aFram
// This duplication and complexity will go away when we fully switch to the
// Servo style system, where all this can be handled much more naturally.
//
// We need to take special care not to disrupt the style inheritance of frames
// whose content is NAC but who implement a pseudo (like an anonymous
// box, or a non-NAC-backed pseudo like ::first-line) that does not match the
// one that the NAC implements, if any.
nsIContent* content = aFrame->GetContent();
- Element* element = content->IsElement() ? content->AsElement() : nullptr;
+ Element* element =
+ content && content->IsElement() ? content->AsElement() : nullptr;
if (element && element->IsNativeAnonymous() &&
element->GetPseudoElementType() == aFrame->StyleContext()->GetPseudoType()) {
while (parent->GetContent() && parent->GetContent()->IsNativeAnonymous()) {
parent = parent->GetParent();
}
}
return nsFrame::CorrectStyleParentFrame(parent, pseudo);