Phenomenon
When a contenteditable region contains a large amount of content (thousands of DOM nodes), typing becomes noticeably slow. There is a visible lag between pressing keys and seeing characters appear.
Reproduction example
- Create a contenteditable div.
- Insert a large amount of content (e.g., 10,000+ DOM nodes).
- Place the caret at the end of the content.
- Start typing rapidly.
- Observe the delay between keypress and character appearance.
Observed behavior
- In Chrome, typing becomes slow when the contenteditable contains many DOM nodes.
- There is a noticeable lag between keypress and character rendering.
- The browser may become unresponsive during rapid typing.
Expected behavior
- Typing should remain responsive regardless of content size.
- The browser should optimize rendering for large contenteditable regions.
- Performance should degrade gracefully, not abruptly.