<?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>31678</bug_id>
          
          <creation_ts>2009-11-19 12:16:23 -0800</creation_ts>
          <short_desc>contentEditable doesn&apos;t wrap elements around content until after the first line</short_desc>
          <delta_ts>2011-08-19 13:04:34 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://www.mozilla.org/editor/midasdemo/</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 McConnell">timmc</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ayg</cc>
    
    <cc>enrica</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>165052</commentid>
    <comment_count>0</comment_count>
    <who name="Tim McConnell">timmc</who>
    <bug_when>2009-11-19 12:16:23 -0800</bug_when>
    <thetext>For a new contentEditable region, only the second line will be wrapped in a container element (e.g. div or p).

Repro steps:
1) Navigate to http://www.mozilla.org/editor/midasdemo/
2) Click into the CE region and type a line
3) Hit enter and type another line
4) Click &quot;View HTML Source&quot;

Actual: You will see that the first line is not contained in the relevant line element.

Expected: The first line, like the second line, has been wrapped in the editor&apos;s line element.

Problem: Because content is not uniformly wrapped, operations that should apply to the current line/block will fail on the first line. Any attempt to walk the DOM to find the parent will reach the contentEditable root.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453867</commentid>
    <comment_count>1</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2011-08-19 09:08:35 -0700</bug_when>
    <thetext>I specced IE/Opera&apos;s behavior, which is to wrap every line in a &lt;p&gt;, including the current one as soon as the user hits enter:

http://aryeh.name/spec/editing/editing.html#the-insertparagraph-command

The relevant case is &quot;If container is not editable or not in the same editing host as node or is not a single-line container:&quot;.  This basically wraps the current line in a &lt;p&gt;, although admittedly that&apos;s unlikely to be clear on a casual read.

I specced it this way because I agree that it&apos;s useful for every line to have a wrapper, so that they can be handled consistently.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>