Right now, native extension objects are reused across documents. However, this is asking for trouble for extensions that might maintain state and may not do a good job clearing it when required. This could leak state across documents and corrupt generated HTML.
This would have prevented the id reuse issues reported in T63165 and T93715.