Bug 42850 - Copy-paste inside list inside bold tag is incorrect
Summary: Copy-paste inside list inside bold tag is incorrect
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 34564
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-22 14:28 PDT by Julie Parent
Modified: 2023-02-06 15:39 PST (History)
5 users (show)

See Also:


Attachments
Test case (183 bytes, text/html)
2010-07-22 14:28 PDT, Julie Parent
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julie Parent 2010-07-22 14:28:55 PDT
Created attachment 62340 [details]
Test case

Repro steps:
1. Start with two lists, wrapped by a bold tag (or use attached test case):
<div contentEditable><b>
<ul>
<li>level0</li>
<ul><li>level1</li><li>copy me</li></ul>
</ul>
<ul>
<li>level0</li>
<ul><li>level1</li><li>paste here</li></ul>
</ul>
</b></div>
2. Select "copy" and copy.
3. Put cursor after "here" and paste.

Result:
"copy" is inside a new list, the HTML for the last LI is:
<li>paste here<span class="Apple-style-span" style="font-weight: normal; "><b><ul><ul><li>copy</li></ul></ul></b></span></li>

Expected Result:
"copy" is after "here", aka, the HTML for last LI is: <li>paste herecopy</li>

Notes:
* May be related to https://bugs.webkit.org/show_bug.cgi?id=42849
* Also happens with <i> or <u> in place of <b>
Comment 1 Ahmad Saleem 2022-12-01 12:44:35 PST
I am having different result compared to expected here:

*** Chrome Canary 110 & Safari 16.1 ***

Paste here copy <---------- Note - Webkit & Blink are adding "space" automatically while selection while copying was showing no space being selected.

*** Firefox Nightly 109 ***

Paste herecopy <----------- no space between here and copy as in expected result.