Considering it still needs javascript, this trick seems massively overcomplicated compared to the following:
<textarea oninput="this.style.height = 0; this.style.height = this.scrollHeight + 'px'"></textarea>
(Yes this forces an extra reflow but it likely won't matter)