HACKER Q&A
📣 amichail

What tricks do WYSIWYG editors use to keep up with fast typing?


Having the display lag behind what you type is not ideal when you can't see the characters typed.


  👤 skyde Accepted Answer ✓
If you go in développer node in chrome and edit the text of a DOM element, there is no special trick and it’s still fast.

This is because the html renderer don’t need to recompute the whole page layout and reflow rules if the dimension of the text box don’t increase.

This is also why it’s possible to do css animation by changing properties of Html/dom elements.

it’s definitely more expensive than just blotting fix in a 2d image buffer, but modern cpu/gpu are pretty good at compositing rendering layer. so the bottleneck is the css layout algorithm because they are still single thread in popular browser .


👤 eimrine
Do you consider WYSIWIG as just an ability to see some characters? [1] Or you are asking about something like Adobe Dreamviewer (or modern ways of doing a layout of a webpage and seeing a builded result while typing)?

[1] https://danluu.com/input-lag/