<?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>23993</bug_id>
          
          <creation_ts>2009-02-17 14:00:19 -0800</creation_ts>
          <short_desc>Underline formatting bleeds into other formatting during delete/backspace</short_desc>
          <delta_ts>2010-03-09 21:35:22 -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>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>21840</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Julie Parent">jparent</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>eric</cc>
    
    <cc>justin.garcia</cc>
    
    <cc>rniwa</cc>
    
    <cc>tony</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>110004</commentid>
    <comment_count>0</comment_count>
    <who name="Julie Parent">jparent</who>
    <bug_when>2009-02-17 14:00:19 -0800</bug_when>
    <thetext>Steps to reproduce:
1. Go to your favorite contentEditable based rich text editor (like http://www.mozilla.org/editor/midasdemo/)
2. Type &quot;Foo Bar&quot; on the first line (without quotes). Press Enter.
3. Type &quot;Baz&quot; on the second line.  (html is Foo &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;Bar&lt;/span&gt;&lt;div&gt;Baz&lt;/div&gt;)
4. Double-click on &quot;Bar&quot; to highlight it.
5. Press underline from the toolbar.
6. Go to the beginning of the second line.
7. Press Backspace.

Result:
Everything moved from the second line to the first is underlined (html is Foo &lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;BarBaz&lt;/span&gt;

Expected:
Just &quot;Bar&quot; to be underlined.

Notes:
I&apos;ve repro&apos;ed on Chrome 1.0 Windows and a webkit nightly on Mac.  This also repros if you use delete at the end of the first line, rather than backspace at the beginning of the second line.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110030</commentid>
    <comment_count>1</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2009-02-17 16:14:27 -0800</bug_when>
    <thetext>*** Bug 23994 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110031</commentid>
    <comment_count>2</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2009-02-17 16:15:20 -0800</bug_when>
    <thetext>Minor thing: in step 3 you write that the &quot;html is ...&quot; but it isn&apos;t in that state until after step 5.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110039</commentid>
    <comment_count>3</comment_count>
    <who name="Justin Garcia">justin.garcia</who>
    <bug_when>2009-02-17 17:09:05 -0800</bug_when>
    <thetext>Also notice that pasting text that isn&apos;t underlined anywhere inside, just before or just after underlined content will incorrectly underline the pasted content.  This is because the pasted content goes into an element with text-decoration: underline, and every descendant of such an element, no matter what, will be underlined.

In the bold case, pasted content goes into a bold tag, but the pasted content is surrounded by a span with font-weight: normal, which negates the boldness.

We need a function positionAvoidingTextDecoration or the like in ReplaceSelectionCommand to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131462</commentid>
    <comment_count>4</comment_count>
      <attachid>32692</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2009-07-13 18:18:28 -0700</bug_when>
    <thetext>Created attachment 32692
demonstrates the bug: underline extends to the next line when adjoint lines are merged with deletion</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>131805</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2009-07-14 21:13:32 -0700</bug_when>
    <thetext>I noticed that there is -webkit-text-decorations-in-effect property is added in the result.  Does anyone know what this property is for?

&lt;span class=&quot;Apple-style-span&quot; style=&quot;text-decoration: underline;&quot;&gt;hello&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-text-decorations-in-effect: none; &quot;&gt;world&lt;/span&gt;&lt;/span&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>137115</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2009-08-04 13:53:41 -0700</bug_when>
    <thetext>This is another bug with ReplaceSelectionCommand as Justin suggested, we need to adjust where we insert the fragment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>137157</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2009-08-04 15:36:29 -0700</bug_when>
    <thetext>Around the line 865, we have
insertNodeAtAndUpdateNodesInserted(refNode, insertionPos);

And refNode-&gt;showTreeForThis() results in:
SPAN	0x1af7ee50 CLASS=Apple-style-span STYLE=border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; 
	#text	0x1af7f170 &quot;world&quot;

Is it even correct to have &quot;-webkit-text-decoration: none&quot; here?  If so, when are you taking care of it?  handleStyleSpans?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>137191</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2009-08-04 17:07:10 -0700</bug_when>
    <thetext>Justin and I talked on IRC, and it&apos;s maybe sensible to delete all style-spans and reapply ApplyStyleCommand because we need to push down text decoration and other styles and apply them again.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>185364</commentid>
    <comment_count>9</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-01-28 00:05:32 -0800</bug_when>
    <thetext>I have a fix for this in bug 21840.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>197882</commentid>
    <comment_count>10</comment_count>
    <who name="Tony Chang">tony</who>
    <bug_when>2010-03-09 21:35:22 -0800</bug_when>
    <thetext>Fixed in r55762, which included a layout test for this case.

*** This bug has been marked as a duplicate of bug 21840 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>32692</attachid>
            <date>2009-07-13 18:18:28 -0700</date>
            <delta_ts>2009-07-13 18:18:28 -0700</delta_ts>
            <desc>demonstrates the bug: underline extends to the next line when adjoint lines are merged with deletion</desc>
            <filename>23993.html</filename>
            <type>text/html</type>
            <size>656</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">PGh0bWw+Cjxib2R5Pgo8ZGl2IGlkPSJ0ZXN0IiBjb250ZW50ZWRpdGFibGU9InRydWUiPgo8c3Bh
biBzdHlsZT0idGV4dC1kZWNvcmF0aW9uOiB1bmRlcmxpbmU7Ij5oZWxsbzwvc3Bhbj48ZGl2Pgp3
b3JsZAo8L2Rpdj48L2Rpdj4KPGRpdiBpZD0iY29uc29sZSI+PC9kaXY+Cgo8c2NyaXB0IHR5cGU9
InRleHQvamF2YXNjcmlwdCI+CgppZiAod2luZG93LmxheW91dFRlc3RDb250cm9sbGVyKQogICAg
bGF5b3V0VGVzdENvbnRyb2xsZXIuZHVtcEFzVGV4dCgpOwoKZG9jdW1lbnQuZGVzaWduTW9kZT0n
b24nOwoKdmFyIGUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgndGVzdCcpOwp2YXIgcyA9IHdp
bmRvdy5nZXRTZWxlY3Rpb24oKTsKCnIgPSBkb2N1bWVudC5jcmVhdGVSYW5nZSgpOwoKci5zZXRT
dGFydChlLmNoaWxkTm9kZXNbMl0uZmlyc3RDaGlsZCwxKTsKci5zZXRFbmQoZS5jaGlsZE5vZGVz
WzJdLmZpcnN0Q2hpbGQsMSk7CgpzLnJlbW92ZUFsbFJhbmdlcygpOwpzLmFkZFJhbmdlKHIpOwoK
ZG9jdW1lbnQuZXhlY0NvbW1hbmQoIkRlbGV0ZSIsIGZhbHNlLCBudWxsKTsKCmRvY3VtZW50Lmdl
dEVsZW1lbnRCeUlkKCdjb25zb2xlJykuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5v
ZGUoZS5pbm5lckhUTUwpKTsKCjwvc2NyaXB0Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>