mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 09:18:42 +09:00
Issue #1592 - Follow-up: Don't post a restyle event if restyleElement is null
This fixes a potential crash caused if restyleElement is null.
This commit is contained in:
parent
bc12e05bd3
commit
b29522749a
1 changed files with 5 additions and 2 deletions
|
|
@ -163,6 +163,7 @@ ShadowRoot::AddSlot(HTMLSlotElement* aSlot)
|
|||
|
||||
oldSlot->RemoveAssignedNode(assignedNode);
|
||||
currentSlot->AppendAssignedNode(assignedNode);
|
||||
|
||||
Element* restyleElement;
|
||||
if (assignedNode->IsElement()) {
|
||||
restyleElement = assignedNode->AsElement();
|
||||
|
|
@ -170,8 +171,10 @@ ShadowRoot::AddSlot(HTMLSlotElement* aSlot)
|
|||
// This is likely a text node. Use the host instead.
|
||||
restyleElement = GetHost();
|
||||
}
|
||||
nsLayoutUtils::PostRestyleEvent(
|
||||
restyleElement, eRestyle_Subtree, nsChangeHint(0));
|
||||
if (restyleElement) {
|
||||
nsLayoutUtils::PostRestyleEvent(
|
||||
restyleElement, eRestyle_Subtree, nsChangeHint(0));
|
||||
}
|
||||
|
||||
doEnqueueSlotChange = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue