From ed7faf3fde0000b139414648269d2ff82846bac1 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 06:41:00 -0400 Subject: Bug 1404789 - Stop reconstructing frames for the whole shadow root each time content is inserted in a shadow tree * Cleanup a bit the ShadowRoot code * Privatize ShadowRoot methods * When the shadow tree distribution changes, post a restyle + reframe * Simplify ShadowRoot::IsPooledNode * Be a bit better at detecting distribution changes Tag #1375 --- dom/html/HTMLContentElement.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'dom/html/HTMLContentElement.cpp') diff --git a/dom/html/HTMLContentElement.cpp b/dom/html/HTMLContentElement.cpp index 158f8d0ce..15d79c761 100644 --- a/dom/html/HTMLContentElement.cpp +++ b/dom/html/HTMLContentElement.cpp @@ -248,8 +248,7 @@ HTMLContentElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, } } - ShadowRoot* containingShadow = GetContainingShadow(); - if (containingShadow) { + if (ShadowRoot* containingShadow = GetContainingShadow()) { containingShadow->DistributeAllNodes(); } } else { @@ -258,8 +257,7 @@ HTMLContentElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName, mValidSelector = true; mSelectorList = nullptr; - ShadowRoot* containingShadow = GetContainingShadow(); - if (containingShadow) { + if (ShadowRoot* containingShadow = GetContainingShadow()) { containingShadow->DistributeAllNodes(); } } -- cgit v1.2.3