If I write Math.max(el.scrollHeight, el.offsetHeight, el.clientHeight) will this always equal el.scrollHeight?
Generally, clientHeight <= offsetHeight <= scrollHeight. There are rare cases where clientHeight > offsetHeight for the html element, but I'm not sure if scrollHeight can ever be smaller than the other two.