[Webkit-unassigned] [Bug 9507] New: Empty style spans created in applyInlineStyle

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Mon Jun 19 07:42:35 PDT 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=9507

           Summary: Empty style spans created in applyInlineStyle
           Product: WebKit
           Version: 420+ (nightly)
          Platform: Macintosh
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML Editing
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: Graham.Dennis at gmail.com


applyInlineStyle moves the start position of the selection forward if the
offset in the start node is greater than the caretMaxOffset() for that node.
This can cause the start position to be beyond the end position for an empty
element. And in this case, because applyInlineStyle doesn't modify the start
position in this case, the inline style is applied to the element following the
empty element in addInlineStyleIfNeeded(style, node, node);

Steps to reproduce, examine the innerHTML of an editable div after pasting the
entire contents of the webpage http://nowataballpark.org/contact.html into the
div. In ToT, the first <td> element has the following code (after
applyInlineStyle):
<td width="88" height="12"><font class="Apple-style-span"
color="#FF0000"></font><p align="CENTER"><font class="Apple-style-span"
color="#FF0000"><b>Name</b></font></p></td> 
With this patch, the empty <font></font> tag is removed.

This patch modifies the layout of two LayoutTests. The modification is caused
by removing unnecessary tags in the HTML. The two layout tests with problems
are editing/pasteboard/paste-4039777-fix and
editing/unsupported-content/table-delete-001.
WebKit r14810 gives the following innerHTML for the root editable element in
paste-4039777:
<ul style="text-align: right;"><font class="Apple-style-span"
size="6"></font><span class="Apple-style-span" style="font-size:
24px;"></span><li style=""><font class="Apple-style-span" size="6"><span
class="Apple-style-span" style="font-size: 24px;">A</span></font></li></ul><div
style=""><font class="Apple-style-span" size="6"></font><span
class="Apple-style-span" style="font-size: 24px;"></span><ul style=""><font
class="Apple-style-span" size="6"></font><span class="Apple-style-span"
style="font-size: 24px;"></span><li style=""><a href=""><font
class="Apple-style-span" size="6"><span class="Apple-style-span"
style="font-size: 24px;">B</span></font></a><font class="Apple-style-span"
size="6"><span class="Apple-style-span" style="font-size: 24px;">
</span></font><font class="Apple-style-span" size="6"><span
class="Apple-style-span" style="font-size: 24px;"><br
style=""></span></font><font class="Apple-style-span" size="6"><span
class="Apple-style-span" style="font-size:
24px;">C</span></font></li></ul></div><div id="test" class="editing"
style="text-align: right;"><br><div> </div> </div>
With this patch, this becomes:
<div id="test" class="editing"><ul style="text-align: right;"><li
style="">A</li></ul><div style=""><ul style=""><li style=""><a href="">B</a>
<br style="">C</li></ul></div><br><div> </div> </div>

WebKit r14810 gives the following innerHTML for the root editable element in
table-delete-001:
<div id="test" class="editing"> before<font class="Apple-style-span"
size="4"><span class="Apple-style-span" style="border-spacing: 2px 2px;
font-size: 16px;"><br></span></font>after </div>
With this patch, this becomes:
<div id="test" class="editing"> before<br>after </div>


-- 
Configure bugmail: http://bugzilla.opendarwin.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