<?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>50854</bug_id>
          
          <creation_ts>2010-12-10 16:01:11 -0800</creation_ts>
          <short_desc>REGRESSION(r73799): editing/execCommand/4920488.html fails</short_desc>
          <delta_ts>2011-01-15 12:45:47 -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>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>52512</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>abarth</cc>
    
    <cc>bweinstein</cc>
    
    <cc>darin</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>eae</cc>
    
    <cc>enrica</cc>
    
    <cc>eric</cc>
    
    <cc>inferno</cc>
    
    <cc>jberlin</cc>
    
    <cc>pkasting</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>320473</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-12-10 16:01:11 -0800</bug_when>
    <thetext>editing/execCommand/4920488.html fails on all platforms after http://trac.webkit.org/changeset/73799.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320476</commentid>
    <comment_count>1</comment_count>
      <attachid>76277</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-12-10 16:05:20 -0800</bug_when>
    <thetext>Created attachment 76277
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320477</commentid>
    <comment_count>2</comment_count>
      <attachid>76278</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-12-10 16:06:01 -0800</bug_when>
    <thetext>Created attachment 76278
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320483</commentid>
    <comment_count>3</comment_count>
      <attachid>76278</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-12-10 16:10:14 -0800</bug_when>
    <thetext>Comment on attachment 76278
Patch

It would be *much* better if we had a regression test that was using Range directly rather than seeing this only as a side effect of the editing test. I worry that this rewrite of processContents broke other Range operations but we don’t have sufficient test coverage.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320487</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-12-10 16:14:22 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 76278 [details])
&gt; It would be *much* better if we had a regression test that was using Range directly rather than seeing this only as a side effect of the editing test. I worry that this rewrite of processContents broke other Range operations but we don’t have sufficient test coverage.

Actually, the editing test directly called extractContents.  Good thing I converted to a dump as text some time ago, and I was very familiar with the test.  We might have missed otherwise.

Anyway, thanks for the review.  Will be landing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320490</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-12-10 16:18:12 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Actually, the editing test directly called extractContents.

Sure, but how much other coverage do we have for this Range function and the closely related functions that share the same back end code. I think we lucked out this time, but I fear we may have other bugs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320495</commentid>
    <comment_count>6</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2010-12-10 16:26:57 -0800</bug_when>
    <thetext>Sorry, that was my fault.  I should have spotted the &quot;n&quot; shadowing in my review.  :(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320498</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-12-10 16:30:29 -0800</bug_when>
    <thetext>Committed r73818: &lt;http://trac.webkit.org/changeset/73818&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>320499</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-12-10 16:31:48 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; Sorry, that was my fault.  I should have spotted the &quot;n&quot; shadowing in my review.  :(

Shadowing was okay.  The problem was that it stopped adding the first child (m_end.container()-&gt;firstChild()) when i + 1 &gt;= m_end.offset().</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>334912</commentid>
    <comment_count>9</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-01-15 11:39:54 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; (In reply to comment #6)
&gt; &gt; Sorry, that was my fault.  I should have spotted the &quot;n&quot; shadowing in my review.  :(
&gt; 
&gt; Shadowing was okay.  The problem was that it stopped adding the first child (m_end.container()-&gt;firstChild()) when i + 1 &gt;= m_end.offset().

This fix does not increment the loop variable (i) in the do-while loop, so it ignores the end offset of the range and iterates through all children of the endContainer.

Follow-up fix in Bug 52512.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>334927</commentid>
    <comment_count>10</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2011-01-15 12:45:47 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; Follow-up fix in Bug 52512.

Committed r75882: &lt;http://trac.webkit.org/changeset/75882&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>76277</attachid>
            <date>2010-12-10 16:05:20 -0800</date>
            <delta_ts>2010-12-10 16:05:58 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-50854-20101210160519.patch</filename>
            <type>text/plain</type>
            <size>1866</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA3MzgxNikKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTYgQEAKKzIwMTAtMTItMTAgIFJ5b3N1a2UgTml3YSAgPHJuaXdhQHdlYmtpdC5v
cmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgUkVH
UkVTU0lPTihyNzM3OTkpOiBlZGl0aW5nL2V4ZWNDb21tYW5kLzQ5MjA0ODguaHRtbCBmYWlscwor
ICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NTA4NTQKKwor
ICAgICAgICBUaGUgcmVncmVzc2lvbiB3YXMgY2F1c2VkIGJ5IHRoZSBjaGFuZ2UgaW4gUmFuZ2U6
OnByb2Nlc3NDb250ZW50cydzIG5vdCBleHRyYWN0aW5nCisgICAgICAgIG1fZW5kLmNvbnRhaW5l
cigpLT5maXJzdENoaWxkKCkuIEZpeGVkIHRoZSBidWcgYnkgYWx3YXlzIGFkZGluZyB0aGUgZmly
c3QgY2hpbGQuCisKKyAgICAgICAgKiBkb20vUmFuZ2UuY3BwOgorICAgICAgICAoV2ViQ29yZTo6
UmFuZ2U6OnByb2Nlc3NDb250ZW50cyk6CisKIDIwMTAtMTItMTAgIEJyaWFuIFdlaW5zdGVpbiAg
PGJ3ZWluc3RlaW5AYXBwbGUuY29tPgogCiAgICAgICAgIFJldmlld2VkIGJ5IEFkYSBDaGFuLgpJ
bmRleDogV2ViQ29yZS9kb20vUmFuZ2UuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvZG9tL1Jh
bmdlLmNwcAkocmV2aXNpb24gNzM4MDUpCisrKyBXZWJDb3JlL2RvbS9SYW5nZS5jcHAJKHdvcmtp
bmcgY29weSkKQEAgLTc5NCwxMSArNzk0LDE1IEBAIFBhc3NSZWZQdHI8RG9jdW1lbnRGcmFnbWVu
dD4gUmFuZ2U6OnByb2MKICAgICAgICAgICAgIE5vZGUqIG4gPSBtX2VuZC5jb250YWluZXIoKS0+
Zmlyc3RDaGlsZCgpOwogICAgICAgICAgICAgaWYgKG4gJiYgbV9lbmQub2Zmc2V0KCkpIHsKICAg
ICAgICAgICAgICAgICBOb2RlVmVjdG9yIG5vZGVzOwotICAgICAgICAgICAgICAgIGZvciAoaW50
IGkgPSAwOyBpICsgMSA8IG1fZW5kLm9mZnNldCgpICYmIG47IGkrKywgbiA9IG4tPm5leHRTaWJs
aW5nKCkpIHsKKyAgICAgICAgICAgICAgICBpbnQgaSA9IDA7CisgICAgICAgICAgICAgICAgZG8g
ewogICAgICAgICAgICAgICAgICAgICBub2Rlcy5hcHBlbmQobik7Ci0gICAgICAgICAgICAgICAg
fQorICAgICAgICAgICAgICAgICAgICBpZiAoIW4tPm5leHRTaWJsaW5nKCkpCisgICAgICAgICAg
ICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgbiA9IG4tPm5leHRTaWJs
aW5nKCk7CisgICAgICAgICAgICAgICAgfSB3aGlsZSAoaSArIDEgPCBtX2VuZC5vZmZzZXQoKSk7
CiAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IG5vZGVzLnNpemUoKSAtIDE7IGkgPj0gMDsg
aS0tKSB7Ci0gICAgICAgICAgICAgICAgICAgIE5vZGUqIG4gPSBub2Rlc1tpXS5nZXQoKTsKKyAg
ICAgICAgICAgICAgICAgICAgbiA9IG5vZGVzW2ldLmdldCgpOwogICAgICAgICAgICAgICAgICAg
ICBpZiAoYWN0aW9uID09IEVYVFJBQ1RfQ09OVEVOVFMpCiAgICAgICAgICAgICAgICAgICAgICAg
ICByaWdodENvbnRlbnRzLT5pbnNlcnRCZWZvcmUobiwgcmlnaHRDb250ZW50cy0+Zmlyc3RDaGls
ZCgpLCBlYyk7IC8vIHdpbGwgcmVtb3ZlIG4gZnJvbSBpdHMgcGFyZW50CiAgICAgICAgICAgICAg
ICAgICAgIGVsc2UgaWYgKGFjdGlvbiA9PSBDTE9ORV9DT05URU5UUykK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>76278</attachid>
            <date>2010-12-10 16:06:01 -0800</date>
            <delta_ts>2010-12-10 16:10:14 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-50854-20101210160600.patch</filename>
            <type>text/plain</type>
            <size>1852</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA3MzgxNikKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTYgQEAKKzIwMTAtMTItMTAgIFJ5b3N1a2UgTml3YSAgPHJuaXdhQHdlYmtpdC5v
cmc+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgUkVH
UkVTU0lPTihyNzM3OTkpOiBlZGl0aW5nL2V4ZWN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PCBtX2VuZC5vZmZzZXQoKSAmJiBuOyBpKyssIG4gPSBuLT5uZXh0U2libGluZygpKSB7CisgICAg
ICAgICAgICAgICAgaW50IGkgPSAwOworICAgICAgICAgICAgICAgIGRvIHsKICAgICAgICAgICAg
ICAgICAgICAgbm9kZXMuYXBwZW5kKG4pOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAg
ICAgICAgICAgaWYgKCFuLT5uZXh0U2libGluZygpKQorICAgICAgICAgICAgICAgICAgICAgICAg
YnJlYWs7CisgICAgICAgICAgICAgICAgICAgIG4gPSBuLT5uZXh0U2libGluZygpOworICAgICAg
ICAgICAgICAgIH0gd2hpbGUgKGkgKyAxIDwgbV9lbmQub2Zmc2V0KCkpOwogICAgICAgICAgICAg
ICAgIGZvciAoaW50IGkgPSBub2Rlcy5zaXplKCkgLSAxOyBpID49IDA7IGktLSkgewotICAgICAg
ICAgICAgICAgICAgICBOb2RlKiBuID0gbm9kZXNbaV0uZ2V0KCk7CisgICAgICAgICAgICAgICAg
ICAgIG4gPSBub2Rlc1tpXS5nZXQoKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGlvbiA9
PSBFWFRSQUNUX0NPTlRFTlRTKQogICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHRDb250ZW50
cy0+aW5zZXJ0QmVmb3JlKG4sIHJpZ2h0Q29udGVudHMtPmZpcnN0Q2hpbGQoKSwgZWMpOyAvLyB3
aWxsIHJlbW92ZSBuIGZyb20gaXRzIHBhcmVudAogICAgICAgICAgICAgICAgICAgICBlbHNlIGlm
IChhY3Rpb24gPT0gQ0xPTkVfQ09OVEVOVFMpCg==
</data>
<flag name="review"
          id="67202"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>