<?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>18423</bug_id>
          
          <creation_ts>2008-04-10 23:33:55 -0700</creation_ts>
          <short_desc>InsertHtml command is adding &lt;span class=&quot;Apple-style-span&quot;&gt; tags by itself</short_desc>
          <delta_ts>2008-04-17 13:16:56 -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>525.x (Safari 3.1)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>12248</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Martin Kou">martin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77249</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Kou">martin</who>
    <bug_when>2008-04-10 23:33:55 -0700</bug_when>
    <thetext>Steps to reproduce the bug:

 1. Create an editable document with some contents wrapped in an &lt;h3&gt; tag.
 2. Put the caret inside the &lt;h3&gt; tag.
 3. Try to run document.execCommand(&apos;inserthtml&apos;, false, $some_html) to insert some simple text into the current caret position.
 4. Notice the inserted text looks different to the rest of the &lt;h3&gt; tag.
 5. Print the HTML contents of the editable document to find some extra &lt;span&gt; tags have been inserted unintentionally by the InsertHtml command.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77250</commentid>
    <comment_count>1</comment_count>
      <attachid>20471</attachid>
    <who name="Martin Kou">martin</who>
    <bug_when>2008-04-10 23:35:07 -0700</bug_when>
    <thetext>Created attachment 20471
Test case with an editable iframe prepared.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77251</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Kou">martin</who>
    <bug_when>2008-04-10 23:35:51 -0700</bug_when>
    <thetext>This bug is causing the bug https://dev.fckeditor.net/ticket/2113 in FCKeditor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77331</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-04-11 16:54:55 -0700</bug_when>
    <thetext>This is probably the same as bug 12248.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77674</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Kou">martin</who>
    <bug_when>2008-04-15 02:17:52 -0700</bug_when>
    <thetext>I&apos;ve found that in addition to adding unnecessary &lt;span&gt; tags, the bug is also manipulating the DOM structure of the editable document in unexpected ways.

For example, if I had this HTML inside the editable frame:
&lt;h3 style=&quot;color:red;&quot;&gt;Hello &lt;span id=&quot;abc&quot; style=&quot;color:green;&quot;&gt;Wor&lt;/span&gt;ld!&lt;/h3&gt;

.. and inside the green text &quot;Wor&quot;, insert the &quot;&lt;&quot; symbol, then we&apos;ll have:
&lt;h3 style=&quot;color:red;&quot;&gt;Hello &lt;span id=&quot;abc&quot; style=&quot;color:green;&quot;&gt;W&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-size: 16px; font-weight: normal; &quot;&gt;&amp;lt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(255, 0, 0); font-size: 19px; font-weight: bold; &quot;&gt;&lt;span id=&quot;abc&quot; style=&quot;color:green;&quot;&gt;or&lt;/span&gt;ld!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;

Notice that now we have two &lt;span&gt; tags with the id &quot;abc&quot;. This is clearly wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77982</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-04-17 13:16:56 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 12248 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>20471</attachid>
            <date>2008-04-10 23:35:07 -0700</date>
            <delta_ts>2008-04-10 23:35:07 -0700</delta_ts>
            <desc>Test case with an editable iframe prepared.</desc>
            <filename>applespan.html</filename>
            <type>text/html</type>
            <size>919</size>
            <attacher name="Martin Kou">martin</attacher>
            
              <data encoding="base64">PGh0bWw+Cgk8aGVhZD4KCQk8dGl0bGU+PC90aXRsZT4KCQk8c2NyaXB0IHR5cGU9InRleHQvamF2
YXNjcmlwdCI+CndpbmRvdy5vbmxvYWQgPSBmdW5jdGlvbigpCnsKCWZyYW1lc1swXS5kb2N1bWVu
dC5ib2R5LmlubmVySFRNTCA9ICc8aDMgc3R5bGU9ImNvbG9yOnJlZDsiPkhlbGxvIFdvcmxkITwv
aDM+JzsKCWZyYW1lc1swXS5kb2N1bWVudC5kZXNpZ25Nb2RlID0gJ29uJzsKCglkb2N1bWVudC5n
ZXRFbGVtZW50QnlJZCgnYXgnKS5vbmNsaWNrID0gZnVuY3Rpb24oZXZ0KQoJewoJCWZyYW1lc1sw
XS5kb2N1bWVudC5leGVjQ29tbWFuZCgnaW5zZXJ0aHRtbCcsIGZhbHNlLCAnJmx0OycpOwoJCWlm
IChldnQucHJldmVudERlZmF1bHQpCgkJCWV2dC5wcmV2ZW50RGVmYXVsdCgpOwoJCWVsc2UKCQkJ
ZXZ0LnJldHVyblZhbHVlID0gZmFsc2U7Cgl9Cn0KCgkJPC9zY3JpcHQ+Cgk8L2hlYWQ+Cgk8Ym9k
eT4KCQlD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