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
This commit is contained in:
Emilio Cobos Álvarez 2019-06-11 17:42:00 +00:00
Родитель 103cf22ede
Коммит a0516ce321
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -3387,6 +3387,10 @@ void RestyleManager::AttributeChanged(Element* aElement, int32_t aNameSpaceID,
} else if (aElement->IsAttributeMapped(aAttribute)) { } else if (aElement->IsAttributeMapped(aAttribute)) {
// FIXME(emilio): Does this really need to re-selector-match? // FIXME(emilio): Does this really need to re-selector-match?
restyleHint |= StyleRestyleHint_RESTYLE_SELF; 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()) { if (nsIFrame* primaryFrame = aElement->GetPrimaryFrame()) {