There's a related article called A Functional Description of TeX's Formula Layout [1] that describes a more modern reimplementation of a part of TeX.
[1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.39....
It's not that CSS is still very far from professional typesetting; what amazes me is that at the same time it's much more complex. Look at all these possible 'display' values and box models! And you still cannot do a run-in header! Or automatic numeration! (You can do the latter natively with XSLT, but it's not cool.) By comparison TeX only has boxes, vertical and horizontal lists, glue, and a few lesser things like kerning. And it produces works of art.
- quality justified paragraphs making use of inter-word spacing and hyphenation
- font ligatures (tex uses quality fonts have special characters for sequences like fi fi fl ffi ffl ft etc)
- good heuristics about where to cut pages (e.g. flexible spacing around heading)I guess that the Web just started simple and evolved from that, and then nobody bothered to remake it for prettier text.
What's interesting is that it could separate the content and the styling information, so you could load the same content into two or more publications with different styles and get two different typesetting from the same source (e.g. one column small page for a book and two or three column large page for an article in a journal). And it was very easy to change the format or paper size: just change it and it would reflow the content accordingly. It didn't even took much time, as far as I can remember, and I'm talking about IBM PC 286 here.
So, truly, it's not a technical obstacle; web could have a much better typesetting engine working at high speed (and I'd say that it would be much better to imitate paged media instead of scrolling; scrolling is really inconvenient for reading). It's just that it grows wildly and in all directions at once; it tries to be a "semantic" storage, a rendering medium, and an application engine at the same time, and is not particularly good at any of this.
It might "simply be" the case (well, in fact it is) that TeX is simply really old and doesn't lend itself well to concepts it predates such as dynamic reflow, etc...
But for just rendering equations, I don't think you can beat TeX for ease of use. And most of the criticisms then don't apply - you can void the insane macro system, it doesn't require multiple passes, etc. I guess lack of CSS support could still be an issue.
Is that due to implementation or the specification?
I used TeX a few times back in the mid-90's and something about it really clicked with me. The documents I made with it are easily the most attractive documents I've made.
Since then, I've wondered why TeX isn't used for ebooks and thanks to your comment, now I know.
If your equations require concurrency to render, you're either a genius or insane. Or both.
TeX doesn't have dynamic reflow, is defined by a macro system that involves essentially monkey patching the parser as it goes, lacks anything resembling a DOM, wasn't designed with Unicode or internationalization in mind, is completely unparallelizable, doesn't interoperate with CSS, has its own concept of block and inline layout that doesn't allow for text wrapping around floats without hacks, requires multiple passes to compute various things like tables of contents, and wasn't designed for interactive-level performance. Something syntactically like TeX may well be the solution, but jamming TeX itself into the Web platform wouldn't end well.