mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Issue #1592 - Part 9: Post a restyle event after changing the slot of a slottable
This commit is contained in:
parent
4cd0de04d0
commit
9a071f3b7a
1 changed files with 11 additions and 0 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include "mozilla/dom/DocumentFragment.h"
|
||||
#include "ChildIterator.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIStyleSheetLinkingElement.h"
|
||||
|
|
@ -162,6 +163,16 @@ ShadowRoot::AddSlot(HTMLSlotElement* aSlot)
|
|||
|
||||
oldSlot->RemoveAssignedNode(assignedNode);
|
||||
currentSlot->AppendAssignedNode(assignedNode);
|
||||
Element* restyleElement;
|
||||
if (assignedNode->IsElement()) {
|
||||
restyleElement = assignedNode->AsElement();
|
||||
} else {
|
||||
// This is likely a text node. Use the host instead.
|
||||
restyleElement = GetHost();
|
||||
}
|
||||
nsLayoutUtils::PostRestyleEvent(
|
||||
restyleElement, eRestyle_Subtree, nsChangeHint(0));
|
||||
|
||||
doEnqueueSlotChange = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue