Bug 1451340 - Don't attempt to RegisterUnresolvedElement for native anonymous content;r=smaug

The webconsole UI generates a large number of scrollbars, and considering their children as
potential Custom Elements causes a slowdown when setting innerHTML="" when devtools closes.

MozReview-Commit-ID: 2QCcXCnTHA2

--HG--
extra : rebase_source : 5226e5689195a047ebcb9903b4565df13b6b1aa0
This commit is contained in:
Brian Grinstead 2018-04-05 12:01:18 -07:00
Родитель a63676a8df
Коммит 81b95b0b38
1 изменённых файлов: 6 добавлений и 0 удалений

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

@ -335,6 +335,12 @@ CustomElementRegistry::LookupCustomElementDefinition(JSContext* aCx,
void
CustomElementRegistry::RegisterUnresolvedElement(Element* aElement, nsAtom* aTypeName)
{
// We don't have a use-case for a Custom Element inside NAC, and continuing
// here causes performance issues for NAC + XBL anonymous content.
if (aElement->IsInNativeAnonymousSubtree()) {
return;
}
mozilla::dom::NodeInfo* info = aElement->NodeInfo();
// Candidate may be a custom element through extension,