<?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>36037</bug_id>
          
          <creation_ts>2010-03-11 15:46:30 -0800</creation_ts>
          <short_desc>REGRESSION(51522): typing at the end of a line in designMode documents is *very* slow</short_desc>
          <delta_ts>2010-06-05 00:50:22 -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>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>GoogleBug, InRadar, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ojan Vafai">ojan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>adele</cc>
    
    <cc>dglazkov</cc>
    
    <cc>enrica</cc>
    
    <cc>eric</cc>
    
    <cc>jamesr</cc>
    
    <cc>jaroslav.benc</cc>
    
    <cc>justin.garcia</cc>
    
    <cc>mitz</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>198815</commentid>
    <comment_count>0</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-03-11 15:46:30 -0800</bug_when>
    <thetext>This affects the script editor in Google Spreadsheets (which uses http://marijn.haverbeke.nl/codemirror/).

Test case attached. Typing a character at the end of the line takes seconds on my machine. The while loop in previousCandidate(const Position&amp; position) in htmlediting.cpp seems to be where all the time is going. Not sure yet what exactly is going wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198817</commentid>
    <comment_count>1</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2010-03-11 15:55:38 -0800</bug_when>
    <thetext>I think you forgot to attach the test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198819</commentid>
    <comment_count>2</comment_count>
      <attachid>50555</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-03-11 16:00:41 -0800</bug_when>
    <thetext>Created attachment 50555
Test case

I blame bugzilla!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198845</commentid>
    <comment_count>3</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-03-11 16:50:25 -0800</bug_when>
    <thetext>I think the bug is in PositionIterator::isCandidate. Still not sure though. The call to endOfBlock is normally constant-time in the average case, but this is hitting the worst-case where it never finds a candidate, so it loops over every node in the body.

The offending block looks to be:
    if (!m_anchorNode-&gt;hasTagName(htmlTag) &amp;&amp; renderer-&gt;isBlockFlow()) {
        if (toRenderBlock(renderer)-&gt;height() || m_anchorNode-&gt;hasTagName(bodyTag)) {
            if (!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
                return atStartOfNode() &amp;&amp; !Position::nodeIsUserSelectNone(m_anchorNode);
            return m_anchorNode-&gt;isContentEditable() &amp;&amp; !Position::nodeIsUserSelectNone(m_anchorNode) &amp;&amp; Position(*this).atEditingBoundary();
        }
    }

The return statement at the end is wrong I think. This is the case where we&apos;re in the body element and it assumes that a position should only be in the body element if we&apos;re at an editing boundary (i.e. on the end of a node that&apos;s not editable). But this case where all the nodes are children of the body clearly should return true here and doesn&apos;t.

Still not sure what the right fix is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198849</commentid>
    <comment_count>4</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-03-11 16:57:04 -0800</bug_when>
    <thetext>Actually, I take it back. I misread the code. The problem is definitely that endOfBlock is looping through each node in the body element, still not quite sure where the bug is though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198854</commentid>
    <comment_count>5</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-03-11 17:14:00 -0800</bug_when>
    <thetext>Looks this is a recent regression. http://trac.webkit.org/changeset/51522</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198855</commentid>
    <comment_count>6</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-03-11 17:17:06 -0800</bug_when>
    <thetext>I confirmed looking at nightlies that the bug doesn&apos;t happen at r51490 and does happen at r51559.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>198884</commentid>
    <comment_count>7</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-03-11 18:14:44 -0800</bug_when>
    <thetext>So, it turns out that without the extra early return added in r51522, we still loop over every node in the body element, but we do so much much faster. It&apos;s the call to Position(*this).atEditingBoundary() that takes almost all the time. Not sure what&apos;s so slow about it.

Also, it really sucks that we loop over every node in the body element just to find the end of the block. Seems like that should be fixable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>199126</commentid>
    <comment_count>8</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-03-12 10:34:16 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; So, it turns out that without the extra early return added in r51522, we still
&gt; loop over every node in the body element, but we do so much much faster. It&apos;s
&gt; the call to Position(*this).atEditingBoundary() that takes almost all the time.
&gt; Not sure what&apos;s so slow about it.
&gt; 
&gt; Also, it really sucks that we loop over every node in the body element just to
&gt; find the end of the block. Seems like that should be fixable.

I changed the code to support a scenario that was not covered before. There is not much that can be done in that place if we want to be able to support sophisticated mix of editable and non editable elements and be able to place the caret in empty editable elements.

The right fix is to avoid looping through every node.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>216121</commentid>
    <comment_count>9</comment_count>
      <attachid>54101</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-04-22 15:52:29 -0700</bug_when>
    <thetext>Created attachment 54101
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>216124</commentid>
    <comment_count>10</comment_count>
      <attachid>54101</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-04-22 15:54:21 -0700</bug_when>
    <thetext>Comment on attachment 54101
Patch

This is a speculative patch that eseidel and I wrote. It makes iterating over positions more correct. We were skipping many positions before.

This does fix the hang, but it causes a number of layout tests to fail. I haven&apos;t had time to look into whether they are actual regressions and won&apos;t anytime soon. Posting this patch in the hopes that someone else can take it up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230003</commentid>
    <comment_count>11</comment_count>
      <attachid>56949</attachid>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-05-24 17:42:05 -0700</bug_when>
    <thetext>Created attachment 56949
Patch2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230010</commentid>
    <comment_count>12</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-05-24 17:57:28 -0700</bug_when>
    <thetext>Radar bug &lt;rdar://problem/8022887&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230016</commentid>
    <comment_count>13</comment_count>
      <attachid>56949</attachid>
    <who name="">mitz</who>
    <bug_when>2010-05-24 18:06:55 -0700</bug_when>
    <thetext>Comment on attachment 56949
Patch2

Should you also patch the PositionIterator constructor for consistency so that whenever m_anchorNode has child nodes, m_offsetInAnchor is 0?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230330</commentid>
    <comment_count>14</comment_count>
      <attachid>56949</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-05-25 10:11:49 -0700</bug_when>
    <thetext>Comment on attachment 56949
Patch2

&gt; +        m_offsetInAnchor = (m_anchorNode-&gt;hasChildNodes())? 0: lastOffsetForEditing(m_anchorNode);

Formatting nitpick: Please write it like this:

    m_offsetInAnchor = m_anchorNode-&gt;hasChildNodes() ? 0: lastOffsetForEditing(m_anchorNode);

But also, it seems wasteful to call lastOffsetForEditing in a case where we already know the node is non-null and we know that hasChildNodes is false. The special editingIgnoresContent behavior is the main reason we have the lastOffsetForEditing function. If we&apos;re not trying to implement that rule, then I think the code above is equivalent to this:

    m_offsetInAnchor = m_anchorNode-&gt;offsetInCharacters() ? m_anchorNode-&gt;maxCharacterOffset() : 0;

For efficiency we could optimize it like this:

    m_offsetInAnchor = (m_anchorNode-&gt;hasChildNodes() || !m_anchorNode-&gt;offsetInCharacters()) ? 0 : m_anchorNode-&gt;maxCharacterOffset();

I&apos;m not sure which is the best way to write it, but I do think that calling lastOffsetForEditing is a little strange. On the other hand, using it consistently might be clearer from a code readability point of view.

r=me even if you don&apos;t agree with my comments. It&apos;s OK to just fix the formatting nitpick.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230352</commentid>
    <comment_count>15</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-05-25 10:57:47 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; (From update of attachment 56949 [details])
&gt; Should you also patch the PositionIterator constructor for consistency so that whenever m_anchorNode has child nodes, m_offsetInAnchor is 0?

I tried that initially, but a lot of tests fail, some crashing too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230365</commentid>
    <comment_count>16</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-05-25 11:08:22 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; (From update of attachment 56949 [details])
&gt; &gt; +        m_offsetInAnchor = (m_anchorNode-&gt;hasChildNodes())? 0: lastOffsetForEditing(m_anchorNode);
&gt; 
&gt; Formatting nitpick: Please write it like this:
&gt; 
&gt;     m_offsetInAnchor = m_anchorNode-&gt;hasChildNodes() ? 0: lastOffsetForEditing(m_anchorNode);
&gt; 
sure, I&apos;ll fix it.

&gt; But also, it seems wasteful to call lastOffsetForEditing in a case where we already know the node is non-null and we know that hasChildNodes is false. The special editingIgnoresContent behavior is the main reason we have the lastOffsetForEditing function. If we&apos;re not trying to implement that rule, then I think the code above is equivalent to this:
&gt; 
&gt;     m_offsetInAnchor = m_anchorNode-&gt;offsetInCharacters() ? m_anchorNode-&gt;maxCharacterOffset() : 0;
&gt; 
I agree that we don&apos;t need the test on the children, since we know already. but how can we be sure we don&apos;t need the editingIgnoresContent behavior?
If you look at the code above this for the case where m_nodeAfterPositionInAnchor is not null, lastOffsetForEditing is used there too. I don&apos;t have any reason to believe we can ignore editingIgnoresContent. Could you please explain?
I&apos;ll try what you&apos;re suggesting and see if it breaks any of the tests.

&gt; For efficiency we could optimize it like this:
&gt; 
&gt;     m_offsetInAnchor = (m_anchorNode-&gt;hasChildNodes() || !m_anchorNode-&gt;offsetInCharacters()) ? 0 : m_anchorNode-&gt;maxCharacterOffset();
&gt; 
&gt; I&apos;m not sure which is the best way to write it, but I do think that calling lastOffsetForEditing is a little strange. On the other hand, using it consistently might be clearer from a code readability point of view.
&gt; 
&gt; r=me even if you don&apos;t agree with my comments. It&apos;s OK to just fix the formatting nitpick.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230375</commentid>
    <comment_count>17</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-05-25 11:21:53 -0700</bug_when>
    <thetext>Committed revision 60176.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230380</commentid>
    <comment_count>18</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-05-25 11:33:36 -0700</bug_when>
    <thetext>It seems there are more fixes in attachment 54101 which we should eventually make in PositionIterator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230386</commentid>
    <comment_count>19</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-05-25 11:45:27 -0700</bug_when>
    <thetext>(In reply to comment #18)
&gt; It seems there are more fixes in attachment 54101 [details] which we should eventually make in PositionIterator.

I&apos;m not sure I agree. That patch broke a number of tests and some crashed. The behavior of increment is correct, what was wrong was the behavior of decrement that was causing to iterate over the wrong positions.
I don&apos;t think there is anything wrong with the intended behavior of PositionIterator, there was just a bug in the implementation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230390</commentid>
    <comment_count>20</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-05-25 12:00:06 -0700</bug_when>
    <thetext>Perhaps we made a mistake when typing up attachment 54101 then.  I am too far removed from context to really comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230393</commentid>
    <comment_count>21</comment_count>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2010-05-25 12:16:13 -0700</bug_when>
    <thetext>(In reply to comment #19)
&gt; (In reply to comment #18)
&gt; &gt; It seems there are more fixes in attachment 54101 [details] [details] which we should eventually make in PositionIterator.
&gt; 
&gt; I&apos;m not sure I agree. That patch broke a number of tests and some crashed. The behavior of increment is correct, what was wrong was the behavior of decrement that was causing to iterate over the wrong positions.
&gt; I don&apos;t think there is anything wrong with the intended behavior of PositionIterator, there was just a bug in the implementation.

PositionIterator should iterate over all possible Positions, right? I don&apos;t think increment does currently. It just doesn&apos;t happen to hit in this case. The code in attachment 54101 may well have been wrong, but I&apos;m pretty sure the existing increment implementation skips over some positions. Unless you think I&apos;m wrong, I think it deserves a FIXME.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230394</commentid>
    <comment_count>22</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-05-25 12:17:42 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/60176 might have broken Tiger Intel Release</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>230398</commentid>
    <comment_count>23</comment_count>
    <who name="Enrica Casucci">enrica</who>
    <bug_when>2010-05-25 12:29:11 -0700</bug_when>
    <thetext>(In reply to comment #21)
&gt; (In reply to comment #19)
&gt; &gt; (In reply to comment #18)
&gt; &gt; &gt; It seems there are more fixes in attachment 54101 [details] [details] [details] which we should eventually make in PositionIterator.
&gt; &gt; 
&gt; &gt; I&apos;m not sure I agree. That patch broke a number of tests and some crashed. The behavior of increment is correct, what was wrong was the behavior of decrement that was causing to iterate over the wrong positions.
&gt; &gt; I don&apos;t think there is anything wrong with the intended behavior of PositionIterator, there was just a bug in the implementation.
&gt; 
&gt; PositionIterator should iterate over all possible Positions, right? I don&apos;t think increment does currently. It just doesn&apos;t happen to hit in this case. The code in attachment 54101 [details] may well have been wrong, but I&apos;m pretty sure the existing increment implementation skips over some positions. Unless you think I&apos;m wrong, I think it deserves a FIXME.

I&apos;ll be happy to look into this while this is still fresh in my mind. Do you have an example of a case where increment skips positions? Keep in mind that m_anchorNode and m_offsetInAnchor only represent the current iterator position. To get the real position we need to use the Position() operator.
Moreover lastOffsetForEditing calls editingIgnoresContent internally to skip some positions on purpose.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>234566</commentid>
    <comment_count>24</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-06-05 00:50:22 -0700</bug_when>
    <thetext>*** Bug 40165 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>50555</attachid>
            <date>2010-03-11 16:00:41 -0800</date>
            <delta_ts>2010-03-11 16:00:41 -0800</delta_ts>
            <desc>Test case</desc>
            <filename>scratch2.html</filename>
            <type>text/html</type>
            <size>153</size>
            <attacher name="Ojan Vafai">ojan</attacher>
            
              <data encoding="base64">PHNjcmlwdD4KZm9yICh2YXIgaSA9IDA7IGkgPCAyMDAwOyBpKyspIHsKICAgIGRvY3VtZW50Lndy
aXRlKCdUeXBpbmcgYXQgdGhlIGVuZCBvZiB0aGlzIGxpbmUgaXMgdmVyeSBzbG93Ljxicj4nKTsK
fQpkb2N1bWVudC5kZXNpZ25Nb2RlID0gJ29uJzsKPC9zY3JpcHQ+
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>54101</attachid>
            <date>2010-04-22 15:52:29 -0700</date>
            <delta_ts>2010-05-24 17:42:05 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-36037-20100422155228.patch</filename>
            <type>text/plain</type>
            <size>4424</size>
            <attacher name="Ojan Vafai">ojan</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvZG9tL1Bvc2l0aW9uSXRlcmF0b3IuY3BwIGIvV2ViQ29yZS9k
b20vUG9zaXRpb25JdGVyYXRvci5jcHAKaW5kZXggZjViNjVmNS4uODJjMTNmMCAxMDA2NDQKLS0t
IGEvV2ViQ29yZS9kb20vUG9zaXRpb25JdGVyYXRvci5jcHAKKysrIGIvV2ViQ29yZS9kb20vUG9z
aXRpb25JdGVyYXRvci5jcHAKQEAgLTUxLDE5ICs1MSwyNCBAQCB2b2lkIFBvc2l0aW9uSXRlcmF0
b3I6OmluY3JlbWVudCgpCiAgICAgICAgIHJldHVybjsKIAogICAgIGlmIChtX25vZGVBZnRlclBv
c2l0aW9uSW5BbmNob3IpIHsKKyAgICAgICAgQVNTRVJUKCFtX29mZnNldEluQW5jaG9yKTsKICAg
ICAgICAgbV9hbmNob3JOb2RlID0gbV9ub2RlQWZ0ZXJQb3NpdGlvbkluQW5jaG9yOwogICAgICAg
ICBtX25vZGVBZnRlclBvc2l0aW9uSW5BbmNob3IgPSBtX2FuY2hvck5vZGUtPmZpcnN0Q2hpbGQo
KTsKLSAgICAgICAgbV9vZmZzZXRJbkFuY2hvciA9IDA7CiAgICAgICAgIHJldHVybjsKICAgICB9
CiAKLSAgICBpZiAoIW1fYW5jaG9yTm9kZS0+aGFzQ2hpbGROb2RlcygpICYmIG1fb2Zmc2V0SW5B
bmNob3IgPCBsYXN0T2Zmc2V0Rm9yRWRpdGluZyhtX2FuY2hvck5vZGUpKQorICAgIC8vIGtpZHMg
JiYgbGFzdE9mZnNldCAtPiBwb3N0aW9uIGFmdGVyIGFuY2hvcgorICAgIC8vICFraW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WZvcmUgYW5jaG9yCisgICAgLy8ga2lkcyAmJiBub24temVybyAtPiBt
dXN0IGJlIGxhc3QsIGdvIGludG8gcHJldmlvdXMga2lkCisgICAgLy8gIWtpZHMgJiYgbm9uLXpl
cm8gLT4ganVzdCBkZWNyZW1lbnQKKworICAgIGlmICghbV9vZmZzZXRJbkFuY2hvcikgeworICAg
ICAgICBtX25vZGVBZnRlclBvc2l0aW9uSW5BbmNob3IgPSBtX2FuY2hvck5vZGU7CisgICAgICAg
IG1fYW5jaG9yTm9kZSA9IG1fYW5jaG9yTm9kZS0+cGFyZW50Tm9kZSgpOwogICAgIH0gZWxzZSB7
CiAgICAgICAgIGlmIChtX2FuY2hvck5vZGUtPmhhc0NoaWxkTm9kZXMoKSkgeworICAgICAgICAg
ICAgQVNTRVJUKG1fb2Zmc2V0SW5BbmNob3IgPT0gbGFzdE9mZnNldEZvckVkaXRpbmcobV9hbmNo
b3JOb2RlKSk7CiAgICAgICAgICAgICBtX2FuY2hvck5vZGUgPSBtX2FuY2hvck5vZGUtPmxhc3RD
aGlsZCgpOwotICAgICAgICAgICAgaWYgKCFtX2FuY2hvck5vZGUtPmhhc0NoaWxkTm9kZXMoKSkK
LSAgICAgICAgICAgICAgICBtX29mZnNldEluQW5jaG9yID0gbGFzdE9mZnNldEZvckVkaXRpbmco
bV9hbmNob3JOb2RlKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIG1fbm9kZUFmdGVy
UG9zaXRpb25JbkFuY2hvciA9IG1fYW5jaG9yTm9kZTsKLSAgICAgICAgICAgIG1fYW5jaG9yTm9k
ZSA9IG1fYW5jaG9yTm9kZS0+cGFyZW50Tm9kZSgpOwotICAgICAgICB9CisgICAgICAgICAgICBt
X29mZnNldEluQW5jaG9yID0gbGFzdE9mZnNldEZvckVkaXRpbmcobV9hbmNob3JOb2RlKTsKKyAg
ICAgICAgfSBlbHNlCisgICAgICAgICAgICBtX29mZnNldEluQW5jaG9yID0gUG9zaXRpb246OnV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IC8vIC0gbV9vZmZz
ZXRJbkFuY2hvciA9PSBsYXN0T2Zmc2V0Rm9yRWRpdGluZyhtX2FuY2hvck5vZGUpCiAgICAgTm9k
ZSogbV9ub2RlQWZ0ZXJQb3NpdGlvbkluQW5jaG9yOyAvLyBJZiB0aGlzIGlzIG5vbi1udWxsLCBt
X25vZGVBZnRlclBvc2l0aW9uSW5BbmNob3ItPnBhcmVudE5vZGUoKSA9PSBtX2FuY2hvck5vZGU7
CisgICAgLy8gbV9vZmZzZXRJbkFuY2hvciBpcyAwIHdoZW46CisgICAgLy8gLSBtX25vZGVBZnRl
clBvc2l0aW9uSW5BbmNob3IgaXMgbm9uLXplcm8gT1IKKyAgICAvLyAtIFBvc2l0aW9uIGlzIGZp
cnN0IHBvc2l0aW9uIG9mIHRoZSBhbmNob3IgYW5kICFtX2FuY2hvck5vZGUtPmhhc0NoaWxkTm9k
ZXMoKQogICAgIGludCBtX29mZnNldEluQW5jaG9yOworICAgIC8vIFRoaXMgYWx3YXlzIGhvbGRz
OiBBU1NFUlQoIShtX25vZGVBZnRlclBvc2l0aW9uSW5BbmNob3IgJiYgbV9vZmZzZXRJbkFuY2hv
cikpOwogfTsKIAogfSAvLyBuYW1lc3BhY2UgV2ViQ29yZQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>56949</attachid>
            <date>2010-05-24 17:42:05 -0700</date>
            <delta_ts>2010-05-25 10:11:48 -0700</delta_ts>
            <desc>Patch2</desc>
            <filename>bug8022887.txt</filename>
            <type>text/plain</type>
            <size>2677</size>
            <attacher name="Enrica Casucci">enrica</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA2MDEwMCkKKysrIFdlYkNvc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ICAgICAgICAg
IG1fbm9kZUFmdGVyUG9zaXRpb25JbkFuY2hvciA9IG1fYW5jaG9yTm9kZTsKICAgICAgICAgICAg
IG1fYW5jaG9yTm9kZSA9IG1fYW5jaG9yTm9kZS0+cGFyZW50Tm9kZSgpOwogICAgICAgICB9Cg==
</data>
<flag name="review"
          id="41452"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>