thorstenb 21 hours ago

> It’s going to be extremely hard to get even decent results without targeting real DOM instead of going pure-canvas, and you can’t get excellent results without doing so.

One of the ZetaOffice (and LibreOffice) hackers here - and I have to disagree.

For something like an office suite, the canvas is literally the only way to achieve the document layout fidelity that users expect. The DOM does not provide enough knobs & dials to get all of MSO (and OOo) bug-for-bug layout compatibility onto the screen (and it's not even close). Don't take my word for it, see e.g. here: https://news.ycombinator.com/item?id=42100660 (and that only deals with the text layout parts).

1
chrismorgan 11 hours ago

Yours is a common sort of objection, but somewhere between largely and completely irrelevant and/or wrong. Somehow I fail to convey my point and what my objections are, and people assume I mean certain things that I don’t mean and didn’t think I necessarily implied.

When I say “targeting real DOM”, that doesn’t mean you have to be subject to the browser’s layout implementations, though preferably you would still use its text shaping. You can still do all the layout yourself, if you want, and position everything absolutely. In practice you’ll tend to want to do at least a little of that, if you want to be able to support editing large documents; and much more if you’re aiming for consistent-across-devices layout. (… which my sister, who actually uses Word for work, reports Microsoft has been hugely slipping on—and Word never was intended as a desktop publishing platform.)

View DOM as more a rendering target; I don’t mind at all. So long as you’re using real DOM for input and output, most of the problems I’m complaining about will go away. Selection, editing, context menus, text rendering, all these things will be done properly.

If you take this approach, it is possible for you to run into some incompatibilities in advanced shaping, if your layout/text shaping engine and the browser’s behave differently, but in practice that will practically never happen any more in shaping, and in other areas you can control it.

I would also clarify what I thought was clear enough from my initial comment’s context: when I speak of “decent results”, I refer to the editing experience, not document layout fidelity.