From a0516ce321cce8d903eb6025a793cbb6dd702fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 11 Jun 2019 17:42:00 +0000 Subject: [PATCH] Bug 1505489 - Invalidate the style of the element when the part attribute changes. r=heycam I think that, given ::part() right now (without forwarding) cannot affect descendants (and eager pseudo-elements are handled as part of the normal element restyling process), it is not worth the effort to add more complex invalidation. But we can always re-evaluate. Depends on D32642 Differential Revision: https://phabricator.services.mozilla.com/D32643 --HG-- extra : moz-landing-system : lando --- layout/base/RestyleManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index ad59b02c5957..ed70475ec23c 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -3387,6 +3387,10 @@ void RestyleManager::AttributeChanged(Element* aElement, int32_t aNameSpaceID, } else if (aElement->IsAttributeMapped(aAttribute)) { // FIXME(emilio): Does this really need to re-selector-match? restyleHint |= StyleRestyleHint_RESTYLE_SELF; + } else if (aElement->IsInShadowTree() && aAttribute == nsGkAtoms::part) { + // TODO(emilio): Maybe finer-grained invalidation for part attribute + // changes? + restyleHint |= StyleRestyleHint_RESTYLE_SELF; } if (nsIFrame* primaryFrame = aElement->GetPrimaryFrame()) {