<?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>30966</bug_id>
          
          <creation_ts>2009-10-30 15:18:53 -0700</creation_ts>
          <short_desc>Pressing backspace merges normal text into header but style still looks normal</short_desc>
          <delta_ts>2012-05-01 22:16:49 -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>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>0</everconfirmed>
          <reporter name="Marcos Almeida">marcosalmeida</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>enrica</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>159473</commentid>
    <comment_count>0</comment_count>
    <who name="Marcos Almeida">marcosalmeida</who>
    <bug_when>2009-10-30 15:18:53 -0700</bug_when>
    <thetext>1. Go to http://www.mozilla.org/editor/midasdemo/
2. Type &quot;Foo&quot;+&lt;enter&gt;+&quot;Bar&quot;
3. Double-click &quot;Foo&quot; and choose Heading 1 from the first dropdown in the second toolbar
 --&gt; &quot;Foo&quot; is a header and &quot;Bar is normal text.
     Current html is: &lt;h1&gt;Foo&lt;/h1&gt;&lt;div&gt;Bar&lt;/div&gt;
4. Place cursor in front of &quot;Bar&quot; and press backspace
 --&gt; &quot;Bar&quot; moves up to the same line as &quot;Foo&quot;; visibly both words still have the same font size and weight.
     Current html is: &lt;h1&gt;Foo&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium; font-weight: normal; &quot;&gt;Bar&lt;/span&gt;&lt;/h1&gt;
5. Press enter.
 --&gt; The line is split into two and looks just like after step 3.
     Current html is: &lt;h1&gt;Foo&lt;/h1&gt;&lt;h1&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium; font-weight: normal; &quot;&gt;Bar&lt;/span&gt;&lt;/h1&gt;

Visibly this looks fine, but the bad side effect is that &quot;Bar&quot; is inside an &lt;h1&gt; even though to the user it looks like normal text. I understand that &quot;Bar&quot; is placed inside the &lt;h1&gt; when you press backspace because &lt;h1&gt; is a block level element so you put the text inside it so that it can be on the same line. But you&apos;re changing the semantics of &quot;Bar&quot; -- it&apos;s now a header since it&apos;s inside the &lt;h1&gt;, not normal text -- and the user has no visual cue that that happened. So when they press enter and &quot;Bar&quot; shows up on its own line, they don&apos;t expect it to be a header. But if any application is examining the html to determine the semantics of the content, it will determine that &quot;Bar&quot; is a header.

A possible solution is to not put &quot;Bar&quot; inside the &lt;h1&gt; on backspace, but rather set the &lt;h1&gt; to display:inline to allow &quot;Bar&quot; to be on the same line. However, this has a side effect: after you hit enter again, the display:inline remains, making the spacing between the two lines smaller than before. Also, it might break any apps that assume that &lt;h1&gt; is always display:block.

Another possibility is to do what other browsers and even MSWord do: don&apos;t attempt to keep the font size and weight of &quot;Bar&quot; when you insert it into the &lt;h1&gt;. That way the user knows that &quot;Bar&quot; became a header, and if they press enter and don&apos;t want it to be a header any more, they will remove the formatting on it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>613970</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-05-01 22:16:49 -0700</bug_when>
    <thetext>Fixed in http://trac.webkit.org/changeset/96870.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>