Phenomenon
When a contenteditable element has CSS will-change property set, performance may be affected. In some cases, it may improve performance by hinting the browser about upcoming changes. In other cases, it may degrade performance by creating unnecessary layers.
Reproduction example
- Create a contenteditable div with
will-change: contentsorwill-change: transform. - Type text rapidly and measure performance.
- Try different will-change values.
- Compare performance with and without will-change.
- Check memory usage.
Observed behavior
- In Chrome on macOS, will-change may have mixed effects on performance.
- Some values may improve performance.
- Other values may degrade performance.
- Memory usage may increase.
Expected behavior
- will-change should provide consistent performance benefits.
- Or, the behavior should be clearly documented.
- Memory usage should remain reasonable.