Dear Khy,
thanks for your feedback, I have better documented the behavior of the proc in https://cvs.openacs.org/changelog/OpenACS?cs=MAIN%3Aantoniop%3A20250207102955
If the change works for you, given that it is simple enough, I would prefer it to going after the various tag_attributes fiddlings we have in the code.
I agree that consuming element(html) is controversial from a logical standpoint, as this is a property of the widget itself and not some volatile value. A different approach could be to flip the merging logics, so that we do not return a new dict, but set the result of the merge into element(html) and use that instead...
If you come up with a better approach, feel free to provide a patch 😊
Ciao
Antonio