[Webkit-unassigned] [Bug 21843] New: execCommand removeFormat is blowing away text outside the selection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 23 16:55:48 PDT 2008


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

           Summary: execCommand removeFormat is blowing away text outside
                    the selection
           Product: WebKit
           Version: 525.x (Safari 3.1)
          Platform: PC
               URL: http://www.plexode.com/cgi-
                    bin/eval2.py#var%20div%20%3D%20document.createElement(%2
                    2div%22)%3B%0Adiv.contentEditable%20%3D%20true%3B%0Adocu
                    ment.body.appendChild(div)%3B%0Adiv.innerHTML%20%3D%20%2
                    7%3Cul%3E%3Cli%3Eone%3C%2Fli%3E%3Cli%3Etwo%3C%2Fli%3Esel
                    ection%3C%2Ful%3E%27%3B%0A%0A%2F%2F%20Select%20the%20tex
                    t%20%22selection%22%0Avar%20sel%20%3D%20window.getSelect
                    ion()%3B%0Avar%20rng%20%3D%20document.createRange()%3B%0
                    Arng.selectNode(div.firstChild.lastChild)%3B%0Asel.remov
                    eAllRanges()%3B%0Asel.addRange(rng)%3B%0Adiv.focus()%3B%
                    0A%0A%2F%2F%20Call%20remove%20format%0Adocument.execComm
                    and(%22removeFormat%22%2C%20false%2C%20null)%3B%0A%0A%2F
                    %2F%20OMG!%20%20Where%20did%20%22one%22%20and%20%22two%2
                    2%20go%3F%0Adiv.innerHTML%0A
        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
                CC: justin.garcia at apple.com


Given the following (bad) html: <ul><li>one</li><li>two</li>selection</ul>

1. Select the text "selection".
2. execCommand('removeFormat', false, null')

Result: html is "selection" (Where did "one" and "two" go???)
Expected result: <ul><li>one</li><li>two</li>selection</ul> (no change)

Use the provided url for a demo, just click "eval once".
Also seen in Chrome.


-- 
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