Patch parentNode/parentElement flexibility
Sorry if this is not the right avenue to post this, it is a feature request but I do not mind putting a PR against it myself.
My curiosity is behind the patching of parentNode/parentElement. How crucial is it to the behavior of shadyDom? My usecase is to optionally disable such patching, however I'm unsure of the potential consequences of doing so. I would like an option to disable the patching so that I can use ShadyDom on shadowDom browsers to replace shadowDom while libraries and tools catch up to support it. There are a number of tools that don't work with shadowDom, primarily ones which are used for automated testing. The support for shadowDom is far off in the road map for many utilities which makes shadyDom a very attractive stand in so that we can integrate with these tools in the meantime. However some tools require knowledge of elements parents to be able to traverse up the tree and do calculations about said elements. This effectively can break integration with tools that do this, so it would be awesome if there was a way to change the behavior safely
This is a complicate usecase to support, as shadydom is intended to mimic shadow dom. Breaking that promise by deliberately not adhering to the specification feels weird to me. I am also not sure how big the benefits are. It might be better to, instead of updating the polyfill, use that time to update the tools accordingly. I know most tools are working on shadow dom compatibility.
@timvdlippe yes I totally get that perspective. I will try to see if the tools can be updated but there's a lot of issues with shadowDom support. I thought this could be an option because shadyDom renders shadowDom as regular Dom elements, which make it 90% accessible from these tools because they can use this polyfill to use shadowDom almost like normal. But I understand that's not the intent behind the polyfill and more of a side effect