This changes semantics that are not inherent to the bug itself. Why not do

`if (element.attachedCallback || element.detachedCallback || (element.__upgraded__ && logFlags.dom))`

?