Steps to reproduce the problem: 1. Create 2 elements in a contenteditable wrapper 2. Add formatting on the element using CSS variables. This doesn't have to be on the elements themselves -- you can also style a common ancestor 3. At runtime, join the 2 elements by removing the gap between them Reproduction link: https://codesandbox.io/s/reproduction-contenteditable-bug-t07we What is the expected behavior? The elements are merged together without unwanted artifacts What went wrong? The second element now contains a unexpected <span> with the formatting applied as inline styling. Here are some related issues. However I think they are separate because those are not directly related to CSS variables: https://bugs.webkit.org/show_bug.cgi?id=106110 https://bugs.webkit.org/show_bug.cgi?id=127242 I filed this same issue with Blink: https://bugs.chromium.org/p/chromium/issues/detail?id=1064358
<rdar://problem/60898548>