Bug 29752 - Copying and pasting into contenteditable div with font-family+span causes selection to be misplaced
Summary: Copying and pasting into contenteditable div with font-family+span causes sel...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows Vista
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-25 15:24 PDT by chase
Modified: 2017-07-18 08:27 PDT (History)
4 users (show)

See Also:


Attachments
testcase reproducing the bug (927 bytes, text/html)
2009-09-25 15:27 PDT, chase
no flags Details
testcase doesn't reproduce the bug (897 bytes, text/html)
2009-09-25 15:28 PDT, chase
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description chase 2009-09-25 15:24:44 PDT
STEPS TO REPRODUCE:
1. Create a web page and enter the following HTML:
    <div style="font-family: times new roman;"
         contentEditable>
      <span>
        <div>foo</div>
        <div>bar</div>
        <div>baz</div>
      </span>
    </div>
2. Select the line bar from the content editable section, copy with CTRL-C, and paste with CTRL-V.
4. The line bar is appended to the content editable section rather than pasted in at the cursor's position.

If the HTML in step 1 has either the font-family style or the <span> removed, the process works as expected, eg:
    <div contentEditable>
      <span>
        <div>foo</div>
        <div>bar</div>
        <div>baz</div>
      </span>
    </div>

Verified with WebKit nightly r48454 and Chromium dev channel 4.0.213.1.
Comment 1 chase 2009-09-25 15:27:00 PDT
Created attachment 40152 [details]
testcase reproducing the bug
Comment 2 chase 2009-09-25 15:28:57 PDT
Created attachment 40153 [details]
testcase doesn't reproduce the bug

Similar to the previous testcase, with font-family removed.
Comment 3 Ojan Vafai 2009-09-28 11:57:54 PDT
To be clear, the innerHTML matches what you would expect, but the actual rendering does not match the innerHTML. Also, you can try moving your cursor around, it moves around as if the line pasted into the right place.