<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>29164</bug_id>
          
          <creation_ts>2009-09-10 17:17:26 -0700</creation_ts>
          <short_desc>execCommand(&apos;removeFormat&apos;) adds extra styles inside tables</short_desc>
          <delta_ts>2010-10-25 17:07:15 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>43017</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Julie Parent">jparent</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>hdn</cc>
    
    <cc>michael.vm</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>146410</commentid>
    <comment_count>0</comment_count>
    <who name="Julie Parent">jparent</who>
    <bug_when>2009-09-10 17:17:26 -0700</bug_when>
    <thetext>1. Create a simple table, with a style inside a cell, for example: &quot;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;foo&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;bar&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;
2. Select some styled text, for example: select &quot;foo&quot;
3. document.execCommand(&apos;removeFormat&apos;, false, null)

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

Demo: http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20contentEditable%20id%3D&apos;editable&apos;%3E%3Ctable%3E%3Ctr%3E%3Ctd%3E%3Cb%20id%3D&apos;foo&apos;%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&amp;ohh=1&amp;ohj=1&amp;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(&apos;removeFormat&apos;%2C%20false%2C%20null)%3B%0Aalert(editable.innerHTML)%3B%0A&amp;ojh=0&amp;ojj=0&amp;ms=100&amp;oth=0&amp;otj=0&amp;cex=1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>299107</commentid>
    <comment_count>1</comment_count>
      <attachid>71795</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-10-25 14:29:19 -0700</bug_when>
    <thetext>Created attachment 71795
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>299124</commentid>
    <comment_count>2</comment_count>
      <attachid>71795</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-10-25 15:14:05 -0700</bug_when>
    <thetext>Comment on attachment 71795
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=71795&amp;action=review

&gt; LayoutTests/editing/execCommand/remove-format-in-table-cell.html:8
&gt; +Markup.description(&apos;This tests RemoveFormant command &quot;hello&quot;. &quot;hello&quot; should be the immediate child of td below and there should be no style attribute.&apos;);

Nit: I&apos;m not sure what &apos;This tests RemoveFormant command &quot;hello&quot;.&apos; means.  Can you rewrite it?  Something like:
This tests that RemoveFormat doesn&apos;t add extra span tags when inside a table cell.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>299193</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-10-25 17:03:29 -0700</bug_when>
    <thetext>Thanks for the review!

(In reply to comment #2)
&gt; (From update of attachment 71795 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=71795&amp;action=review
&gt; 
&gt; &gt; LayoutTests/editing/execCommand/remove-format-in-table-cell.html:8
&gt; &gt; +Markup.description(&apos;This tests RemoveFormant command &quot;hello&quot;. &quot;hello&quot; should be the immediate child of td below and there should be no style attribute.&apos;);
&gt; 
&gt; Nit: I&apos;m not sure what &apos;This tests RemoveFormant command &quot;hello&quot;.&apos; means.  Can you rewrite it?  Something like:
&gt; This tests that RemoveFormat doesn&apos;t add extra span tags when inside a table cell.

This wasn&apos;t intended.  Thanks for catching that.  Will fix and land.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>299198</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-10-25 17:07:15 -0700</bug_when>
    <thetext>Committed r70507: &lt;http://trac.webkit.org/changeset/70507&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>71795</attachid>
            <date>2010-10-25 14:29:19 -0700</date>
            <delta_ts>2010-10-25 15:14:05 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-29164-20101025142918.patch</filename>
            <type>text/plain</type>
            <size>2312</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IExheW91dFRlc3RzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBMYXlvdXRUZXN0cy9D
aGFuZ2VMb2cJKHJldmlzaW9uIDcwNDkwKQorKysgTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCSh3b3Jr
aW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTAtMTAtMjUgIFJ5b3N1a2UgTml3YSAgPHJu
aXdhQHdlYmtpdC5vcmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisK
KyAgICAgICAgZXhlY0NvbW1hbmQoJ3JlbW92ZUZvcm1hdCcpIGFkZHMgZXh0cmEgc3R5bGVzIGlu
c2lkZSB0YWJsZXMKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dp
P2lkPTI5MTY0CisKKyAgICAgICAgQWRkZWQgYSB0ZXN0IHRvIGVuc3VyZSBSZW1vdmVGb3JtYXQg
Y29tbWFuZCBkb2VzIG5vdCBhZGQgZXJyb25lb3VzIHN0eWxlIGF0dHJpYnV0ZQorICAgICAgICB3
aGVuIHJlbW92aW5nIHN0eWxlcyBpbnNpZGUgYSB0YWJsZSBjZWxsLgorCisgICAgICAgICogZWRp
dGluZy9leGVjQ29tbWFuZC9yZW1vdmUtZm9ybWF0LWluLXRhYmxlLWNlbGwtZXhwZWN0ZWQudHh0
OiBBZGRlZC4KKyAgICAgICAgKiBlZGl0aW5nL2V4ZWNDb21tY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d0ZXN0Jyk7
CisKKzwvc2NyaXB0PgorPC9ib2R5PgorPC9odG1sPgo=
</data>
<flag name="review"
          id="61916"
          type_id="1"
          status="+"
          setter="tony"
    />
          </attachment>
      

    </bug>

</bugzilla>