Making this at startup for all headers makes me a bit uncomfortable at the autoResizeElement may trigger an unexpected reflow if there is still some other work ongoing. But I don't have a good idea here so I guess I will have to live with that for now. :/