1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Issue #1592 - Part 1a: Prevent crashing if a slot element was selected via DOM Inspector

This commit is contained in:
FranklinDM
2023-03-18 12:44:56 +08:00
committed by roytam1
parent f09d2bba0f
commit 0232bcdfa4
+7 -2
View File
@@ -3839,8 +3839,13 @@ RestyleManager::ComputeAndProcessStyleChange(nsStyleContext* aNewContext,
MOZ_ASSERT(mReframingStyleContexts, "should have rsc");
MOZ_ASSERT(aNewContext->StyleDisplay()->mDisplay == StyleDisplay::Contents);
nsIFrame* frame = GetNearestAncestorFrame(aElement);
MOZ_ASSERT(frame, "display:contents node in map although it's a "
"display:none descendant?");
// Return early if we don't have a frame.
if (!frame) {
NS_ASSERTION(frame,
"display:contents node in map although it's a "
"display:none descendant?");
return;
}
TreeMatchContext treeMatchContext(true,
nsRuleWalker::eRelevantLinkUnvisited,
frame->PresContext()->Document());