Bug 1330843 - Allow JS to create NAC pseudo-elements

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 05:01:17 -04:00 committed by Roy Tam
commit c37b4d0c63
8 changed files with 115 additions and 4 deletions

View file

@ -9871,3 +9871,16 @@ nsContentUtils::IsLocalRefURL(const nsString& aString)
return false;
}
/* static */ Element*
nsContentUtils::GetClosestNonNativeAnonymousAncestor(Element* aElement)
{
MOZ_ASSERT(aElement);
MOZ_ASSERT(aElement->IsNativeAnonymous());
Element* e = aElement;
while (e && e->IsNativeAnonymous()) {
e = e->GetParentElement();
}
return e;
}