[Webkit-unassigned] [Bug 29164] New: execCommand('removeFormat') adds extra styles inside tables

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 10 17:17:26 PDT 2009


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

           Summary: execCommand('removeFormat') adds extra styles inside
                    tables
           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: jparent at google.com


1. Create a simple table, with a style inside a cell, for example:
"<table><tr><td><b>foo</b></td></tr><tr><td>bar</td></tr></table>"
2. Select some styled text, for example: select "foo"
3. document.execCommand('removeFormat', false, null)

Result: Extra apple-style-span added with border-spacing styles, for example:
<table><tbody><tr><td><span class="Apple-style-span"
style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing:
0px;">foo</span></td></tr><tr><td>bar</td></tr></tbody></table>
Expected Result: Just the b tag is removed, for example:
<table><tbody><tr><td>foo</td></tr><tr><td>bar</td></tr></tbody></table>

Demo:
http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20contentEditable%20id%3D'editable'%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cb%20id%3D'foo'%3Efoo%3C%2Fb%3E%3C%2Ftd%3E%3C%2Ftr%3E%3Ctr%3E%3Ctd%3Ebar%3C%2Ftd%3E%3C%2Ftr%3E%3C%2Ftable%3E%3C%2Fdiv%3E&ohh=1&ohj=1&jt=%2F%2F%20Select%20%22foo%22%0Avar%20rng%20%3D%20document.createRange()%3B%0Arng.setStart(foo.firstChild%2C%200)%3B%0Arng.setEnd(foo.firstChild%2C%20foo.firstChild.length)%3B%0Adocument.getSelection().addRange(rng)%3B%0A%0Adocument.execCommand('removeFormat'%2C%20false%2C%20null)%3B%0Aalert(editable.innerHTML)%3B%0A&ojh=0&ojj=0&ms=100&oth=0&otj=0&cex=1

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



More information about the webkit-unassigned mailing list