From bc12e05bd3a13d2db5614dc9675d02cfaf33ef6c Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Mon, 20 Mar 2023 03:00:11 +0800 Subject: [PATCH] Issue #1592 - Part 10: Slot elements should restyle their parent on attribute changes --- dom/html/HTMLSlotElement.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom/html/HTMLSlotElement.cpp b/dom/html/HTMLSlotElement.cpp index 4d4b137dd5..9286ff9591 100644 --- a/dom/html/HTMLSlotElement.cpp +++ b/dom/html/HTMLSlotElement.cpp @@ -110,6 +110,13 @@ HTMLSlotElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName, } } + if (nsIContent* parent = GetParent()) { + if (parent->IsElement()) { + nsLayoutUtils::PostRestyleEvent( + parent->AsElement(), eRestyle_Subtree, nsChangeHint(0)); + } + } + return nsGenericHTMLElement::AfterSetAttr(aNameSpaceID, aName, aValue, aOldValue, aNotify); }