<?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>127690</bug_id>
          
          <creation_ts>2014-01-27 11:02:20 -0800</creation_ts>
          <short_desc>execCommand(&apos;insertHTML&apos;, ...) creates nested paragraphs under very specific circumstances</short_desc>
          <delta_ts>2014-01-27 11:15:00 -0800</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>Mac</rep_platform>
          <op_sys>OS X 10.9</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://jsbin.com/OKuXiCA/1/edit</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Molendijk">tim</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>972475</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Molendijk">tim</who>
    <bug_when>2014-01-27 11:02:20 -0800</bug_when>
    <thetext>Steps to reproduce the problem:
1. Open provided URL
2. Click button to execute code as described on its label
3. Notice how a nested paragraph structure has been created (and the first inserted paragraphs ends up last in the created DOM tree - but that&apos;s probably related)

What is the expected behavior?
What Firefox does: create a DOM tree that looks like this:
&lt;p&gt;1st inserted&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;

What went wrong?
Instead it creates a DOM tree that looks like this:
&lt;p&gt;&lt;p&gt;&lt;/p&gt;&lt;/p&gt;
&lt;p&gt;1st inserted&lt;/p&gt;

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? No Safari (verified v7.0.1)

Chrome version: 34.0.1797.2  Channel: dev
OS Version: OS X 10.9.1
Flash Version: Shockwave Flash 12.0 r0

As soon as a layout is applied to all paragraphs, this misbehavior disappears. Or when the br element is removed from the initial contenteditable, this misbehavior disappears. And probably several more subtle requirements that I haven&apos;t discovered.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>972484</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Molendijk">tim</who>
    <bug_when>2014-01-27 11:15:00 -0800</bug_when>
    <thetext>I&apos;m not sure whether &quot;layout is applied&quot; in the last paragraph is correct. I _am_ sure that when you apply min-height to every p (in CSS), the problem goes away.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>