Issue #1990 - Part 5 - Common up the skippability implementations that are basically copy/pastes of the DOMEventTargetHelper one. Mozilla Bug Bug 1333540. Skipped the renamed of various functions, but otherwise a direct port.

This commit is contained in:
Brian Smith 2022-08-25 21:59:08 -05:00 committed by roytam1
commit 5fd53649bd
7 changed files with 30 additions and 84 deletions

View file

@ -52,11 +52,12 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(DOMEventTargetHelper)
if (tmp->IsBlack() || tmp->IsCertainlyAliveForCC()) {
bool isBlack = tmp->IsBlack();
if (isBlack || tmp->IsCertainlyAliveForCC()) {
if (tmp->mListenerManager) {
tmp->mListenerManager->MarkForCC();
}
if (!tmp->IsBlack() && tmp->PreservingWrapper()) {
if (!isBlack && tmp->PreservingWrapper()) {
// This marks the wrapper black.
tmp->GetWrapper();
}