summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-04-16 16:42:26 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-04-16 16:42:26 -0400
commit32c3ee92b8b9b1640d346761b36c642f9a968ce3 (patch)
treec2e5bb9e3ecbe40c9c02046c21cb1c60c0923405
parent0d149a4c091f856869490b1567d541c91010bc5c (diff)
downloadUXP-32c3ee92b8b9b1640d346761b36c642f9a968ce3.tar
UXP-32c3ee92b8b9b1640d346761b36c642f9a968ce3.tar.gz
UXP-32c3ee92b8b9b1640d346761b36c642f9a968ce3.tar.lz
UXP-32c3ee92b8b9b1640d346761b36c642f9a968ce3.tar.xz
UXP-32c3ee92b8b9b1640d346761b36c642f9a968ce3.zip
Bug 1340885 - Null check frame's content when searching for NAC ancestors in GetCorrectedParent
Tag #1375
-rw-r--r--layout/generic/nsFrame.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index ba1e9567a..2b81ce83b 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -8962,7 +8962,8 @@ GetCorrectedParent(const nsIFrame* aFrame)
// 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()) {