[Webkit-unassigned] [Bug 28472] New: webkit can not unformat super- and sub-script containing BR

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 19 13:09:43 PDT 2009


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

           Summary: webkit can not unformat super- and sub-script
                    containing BR
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML Editing
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: ptucker at google.com
                CC: michaelthomas at google.com


The latest version of WebKit (532) fixed a bug where contentEditable could not
unformat SUB and SUPER tags. But it still fails when the text contains a BR.
e.g.,

For this HTML ...

<div id="editor" contenteditable=true>super<sup>script<img></sup></div>

... if I select "script" and execCommand("superscript"), it works correctly, it
simply removes the super tags. But if I change the HTML to this ...

<div id="editor" contenteditable=true>super<sup>script<br></sup></div>

... "script" stays superscripted, and the underlying HTML becomes this ugliness
...

<div id="editor" contenteditable=true>super<sup><span class=Apple-style-span
style="vertical-align: baseline;">script</span><br></sup></div>

Example:

http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20id%3D%22editor%22%20contenteditable%3Dtrue%3Esuper%3Csup%3Escript%3Cbr%3E%3C%2Fsup%3E%3C%2Fdiv%3E%0A&ohh=1&ohj=1&jt=var%20div%20%3D%20document.getElementById('editor')%3B%0A%0A%2F%2F%20Change%20this%20to%20select%20a%20range%0AselectRange(div%2C%201%2C%20div%2C%202)%3B%0A%0A%2F%2F%20Change%20this%20to%20run%20execCommand%0Adocument.execCommand('superscript'%2C%20false%2C%20null)%3B%0A%0Afunction%20selectRange(startNode%2C%20startOffset%2C%20endNode%2C%20endOffset)%20%7B%0A%20%20var%20sel%20%3D%20window.getSelection()%3B%0A%20%20var%20range%20%3D%20null%3B%0A%20%20try%20%7B%0A%20%20%20%20range%20%3D%20sel.getRangeAt(0)%3B%0A%20%20%7D%20catch(ex)%20%7B%0A%20%20%20%20range%20%3D%20document.createRange()%3B%0A%20%20%7D%0A%20%20range.setStart(startNode%2C%20startOffset)%3B%0A%20%20range.setEnd(endNode%2C%20endOffset)%3B%0A%20%20sel.removeAllRanges()%3B%0A%20%20sel.addRange(range)%3B%0A%7D&ojh=1&ojj=1&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