[Webkit-unassigned] [Bug 26937] New: Copying and pasting into a contenteditable area can create <div>s surrounded by <span>s

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 2 15:24:47 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=26937

           Summary: Copying and pasting into a contenteditable area can
                    create <div>s surrounded by <span>s
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML Editing
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: sullivan at google.com
                CC: eric at webkit.org, jparent at google.com


STEPS TO REPRODUCE:
1. Create a web page and enter the following HTML:
<style>div{font-family:Courier; font-size:small;}</style>
<div>one</div>
<div>two</div>
2. Copy the text "one two" from the page and paste it into a contenteditable
area on another page (e.g. midas demo)
3. HTML that is pasted into the contenteditable area:
<span class="Apple-style-span" style="font-family: Courier; font-size: small;
"><div style="font-family: Courier; font-size: small; ">one</div><div
style="font-family: Courier; font-size: small; ">two</div></span>

This creates redundant styles, which can be difficult for other browser rich
text editors to remove, and also block-level tags (divs) which are children of
inline tags (spans), which is invalid HTML. 

The styles should be applied to the copied text in the same way they would be
applied if the contentedtable area contaied the HTML
"<div>one</div><div>two</div>" in the contenteditable area, it was selected,
and the font and text size were changed with execCommand:
<div><font class="Apple-style-span" face="Courier"><span
class="Apple-style-span" style="font-size: small;">one</span></font></div>
<div><font class="Apple-style-span" face="Courier"><span
class="Apple-style-span" style="font-size: small;">two</span></font></div>


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list