Enter with non-collapsed selection in contenteditable may lose format which is in the non-collapsed selection
Categories
(Core :: DOM: Editor, defect, P3)
Tracking
()
People
(Reporter: jisong, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
908 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Steps to reproduce:
Open the attached test file, follow the instruction below:
Step 1: Click the button in the file
Step 2: Press Enter
Step 3: Type some text
Actual results:
text from step 3 is in black
Expected results:
text from step 3 should be in red
Updated•4 years ago
|
Hmm, I feel the behavior of Chrome is odd because the selected range starts from and ends by outer of elements whose forecolor is red. So, deleting the inner style must be reasonable in this case. But this is a web-compat issue with Blink...
jisong: Did you find this bug on existing web apps?
Masayuki:
The repro step I added was a simplified one, in order make sure everyone can repro it.
The original repro step is like this:
- Use the code below.
- Put cursor at the end of "Line 1"
- Press Enter twice, to generate two new empty line
- Press "Up" arrow twice, then everything should be selected
- Press Enter again
- Type something, see that is becomes black now.
<html>
<body>
<div contenteditable id="div1" style="border: solid 1px black; height: 200px">
<div style="color:red">line 1</div>
</div>
</body>
</html>
Description
•