Bug 209535 - Joining elements in contenteditable with CSS variables formatting creates unexpected span elements
Summary: Joining elements in contenteditable with CSS variables formatting creates une...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 13
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-03-25 01:49 PDT by Floris Bernard
Modified: 2020-03-26 03:31 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Floris Bernard 2020-03-25 01:49:48 PDT
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
Comment 1 Radar WebKit Bug Importer 2020-03-25 18:14:27 PDT
<rdar://problem/60898548>