<?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>50012</bug_id>
          
          <creation_ts>2010-11-24 04:05:43 -0800</creation_ts>
          <short_desc>Moving cursor down in table cycles at the end of a row</short_desc>
          <delta_ts>2011-02-03 11:33:28 -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>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jochen</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>enrica</cc>
    
    <cc>kalman</cc>
    
    <cc>leviw</cc>
    
    <cc>leviw</cc>
    
    <cc>mitz</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>313209</commentid>
    <comment_count>0</comment_count>
    <who name="">jochen</who>
    <bug_when>2010-11-24 04:05:43 -0800</bug_when>
    <thetext>When you try to move with the cursor through an editable table, the cursor jumps to the beginning at the end of a row. See attached layout test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>313217</commentid>
    <comment_count>1</comment_count>
      <attachid>74745</attachid>
    <who name="">jochen</who>
    <bug_when>2010-11-24 04:14:52 -0800</bug_when>
    <thetext>Created attachment 74745
layout test demonstrating the problem

If you try to go with e.g. page down over a part of html that contains a table, webkit will go into an endless loop in SelectionController::modify (in the for loop around line 777)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>313220</commentid>
    <comment_count>2</comment_count>
    <who name="">jochen</who>
    <bug_when>2010-11-24 04:23:49 -0800</bug_when>
    <thetext>Adding a few interested parties (according to svn blame on the files I suspect to be affected). Apologies if I&apos;m mistaken</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>313226</commentid>
    <comment_count>3</comment_count>
    <who name="">jochen</who>
    <bug_when>2010-11-24 04:30:17 -0800</bug_when>
    <thetext>note that the test doesn&apos;t work outside of LayoutTests/editing/selection/

However, you can just place the cursor on the beginning of the last line and repeatedly hit cursor down to see the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343512</commentid>
    <comment_count>4</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-02-01 13:54:37 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Created an attachment (id=74745) [details]
&gt; layout test demonstrating the problem
&gt; 
&gt; If you try to go with e.g. page down over a part of html that contains a table, webkit will go into an endless loop in SelectionController::modify (in the for loop around line 777)

I don&apos;t understand what you mean by the endless loop.  Do you mean that pressing down key will keep moving cursor between two positions?  Or that WebKit falls into an infinite loop and does not respond?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343521</commentid>
    <comment_count>5</comment_count>
    <who name="Levi Weintraub">leviw</who>
    <bug_when>2011-02-01 14:02:36 -0800</bug_when>
    <thetext>It actually returns to whichever position you start it in on that line. Placing the caret in the middle will jump between the middle and end.

I was just taking a look at this code for 25757 so I&apos;m happy to find the root cause.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343523</commentid>
    <comment_count>6</comment_count>
    <who name="">jochen</who>
    <bug_when>2011-02-01 14:04:39 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #1)
&gt; &gt; Created an attachment (id=74745) [details] [details]
&gt; &gt; layout test demonstrating the problem
&gt; &gt; 
&gt; &gt; If you try to go with e.g. page down over a part of html that contains a table, webkit will go into an endless loop in SelectionController::modify (in the for loop around line 777)
&gt; 
&gt; I don&apos;t understand what you mean by the endless loop.  Do you mean that pressing down key will keep moving cursor between two positions?  Or that WebKit falls into an infinite loop and does not respond?

I discovered the issue while using page-down to scroll through an reply to an html mail in gmail. In that case, WebKit falls into an infinite loop and does not respond.

After adding some debug output, I figured out that the current editing position was inside a table and WebKit got stuck in SelectionController::modify (the for loop in line 845-860.

The layout test demonstrates the underlying issue. When you press down at the end of the table, you should stay at the end. Instead, you jump again to the beginning of the table. That&apos;s what&apos;s causing the endless loop IMO.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>343532</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-02-01 14:15:43 -0800</bug_when>
    <thetext>This is a bug in nextLinePosition in visible_units.cpp.  It&apos;s a hard bug to fix though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344316</commentid>
    <comment_count>8</comment_count>
      <attachid>80981</attachid>
    <who name="Levi Weintraub">leviw</who>
    <bug_when>2011-02-02 15:35:23 -0800</bug_when>
    <thetext>Created attachment 80981
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344319</commentid>
    <comment_count>9</comment_count>
    <who name="Levi Weintraub">leviw</who>
    <bug_when>2011-02-02 15:41:28 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; Created an attachment (id=80981) [details]
&gt; Patch

The code improperly descended back into the same leaf node because the anchor node the last position used wasn&apos;t in a leaf position.

In nextLeafWithSameEditability, when there&apos;s no child node at the provided offset, it should traverse to the last descendant before finding the next leaf node, or it can regress like in this example.

Also, I had to update the offset in your layout test to correspond with the actual final offset.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344333</commentid>
    <comment_count>10</comment_count>
      <attachid>80981</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-02-02 15:53:12 -0800</bug_when>
    <thetext>Comment on attachment 80981
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=80981&amp;action=review

Ah great!  I had imagined this would have been much harder to fix.  Good job fixing it.  r- for stylistic issues.

&gt; Source/WebCore/ChangeLog:7
&gt; +

Please explain what caused the bug and how you fixed it. You can almost copy &amp; paste your comment #c9.

&gt; Source/WebCore/editing/visible_units.cpp:589
&gt;      while (n) {
&gt;          if (editable == n-&gt;isContentEditable())
&gt;              return n;

It&apos;s sad that this while loop is identical to that of the function below yet we don&apos;t share code.  Is there anyway we can share code?

&gt; LayoutTests/ChangeLog:7
&gt; +

Please explain what kind of test you&apos;re adding, etc...

&gt; LayoutTests/ChangeLog:9
&gt; +        * editing/selection/move-by-line-006-expected.txt: Added.
&gt; +        * editing/selection/move-by-line-006.html: Added.

It would be nice if the test name reflected what the test is about rather than just having a number 006.

&gt; LayoutTests/editing/selection/move-by-line-006.html:1
&gt; +&lt;html&gt;

Missing &lt;!DOCTYPE html&gt;

&gt; LayoutTests/editing/selection/move-by-line-006.html:17
&gt; +    &lt;script src=../editing.js language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot; &gt;&lt;/script&gt;
&gt; +    &lt;script&gt;
&gt; +        function test()
&gt; +        {
&gt; +            if (window.layoutTestController)
&gt; +                layoutTestController.dumpAsText();
&gt; +
&gt; +            var target = document.getElementById(&quot;target&quot;);
&gt; +            getSelection().setBaseAndExtent(target.firstChild, 0, target.firstChild, 0);
&gt; +            for (var i=0; i&lt;2; i++)
&gt; +                moveSelectionForwardByLineCommand();
&gt; +
&gt; +            document.getElementById(&quot;result&quot;).innerText = getSelection().baseOffset == 6 ? &quot;PASS&quot; : &quot;FAIL&quot;;
&gt; +        }
&gt; +    &lt;/script&gt;

We don&apos;t normally indent tags like this.  And I don&apos;t think we need to wait until load event.  You can just run all of them when the parser inserts the script element into the document if you moved the script element after table.  If you do that, then you can just use document.write to print PASS/FAIL instead of having a #result paragraph.

Also, no space between i and 2, and no need to specify type and language in the script tag.

&gt; LayoutTests/editing/selection/move-by-line-006.html:21
&gt; +    &lt;p&gt;
&gt; +        Test for &lt;i&gt;&lt;a href=&quot;http://bugs.webkit.org/show_bug.cgi?id=50012&quot;&gt;http://bugs.webkit.org/show_bug.cgi?id=50012&lt;/a&gt;

Ditto about indentation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344343</commentid>
    <comment_count>11</comment_count>
    <who name="Levi Weintraub">leviw</who>
    <bug_when>2011-02-02 15:57:29 -0800</bug_when>
    <thetext>&gt; Please explain what caused the bug and how you fixed it. You can almost copy &amp; paste your comment #c9.

I put the short description after the function name but I can throw in more if you&apos;d like ;)

+        * editing/visible_units.cpp:
+        (WebCore::nextLeafWithSameEditability):
+        Properly avoid descending back into the original leaf node.

I&apos;ll clean up the layout test. I simply grabbed it from the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344353</commentid>
    <comment_count>12</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-02-02 16:04:58 -0800</bug_when>
    <thetext>(In reply to comment #11)
&gt; I put the short description after the function name but I can throw in more if you&apos;d like ;)
&gt; 
&gt; +        * editing/visible_units.cpp:
&gt; +        (WebCore::nextLeafWithSameEditability):
&gt; +        Properly avoid descending back into the original leaf node.

I think we normally start the comment immediately after : and a space as in:

        (WebCore::nextLeafWithSameEditability): Properly avoid descending back into
        the original leaf node.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344412</commentid>
    <comment_count>13</comment_count>
      <attachid>81005</attachid>
    <who name="Levi Weintraub">leviw</who>
    <bug_when>2011-02-02 16:51:48 -0800</bug_when>
    <thetext>Created attachment 81005
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344421</commentid>
    <comment_count>14</comment_count>
      <attachid>81005</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-02-02 16:56:57 -0800</bug_when>
    <thetext>Comment on attachment 81005
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=81005&amp;action=review

I&apos;d say r+ but please address the following comments before landing this patch.

&gt; Source/WebCore/ChangeLog:11
&gt; +        Avoids a caret cycling issue with certain content (e.g. tables) found at the very
&gt; +        end of a document due to a bug in nextLeafWithSameEditability.

Description should appear before tests.

&gt; LayoutTests/editing/selection/move-by-line-cycles-in-table.html:1
&gt; +&lt;html&gt;

Please put &lt;!DOCTYPE html&gt;

&gt; LayoutTests/editing/selection/move-by-line-cycles-in-table.html:3
&gt; +  &lt;script src=../editing.js language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot; &gt;&lt;/script&gt;

Please remove the indentation, and language/type attributes.  They just clutter the test.

Also, you can move this into body right before another script element.  That way, you can get rid of head.

&gt; LayoutTests/editing/selection/move-by-line-cycles-in-table.html:12
&gt; +&lt;script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;&gt;

Ditto about language and type attributes.

&gt; LayoutTests/editing/selection/move-by-line-cycles-in-table.html:14
&gt; + layoutTestController.dumpAsText();

We should probably give two or four spaces instead of one to be consistent with the rest of tests.

&gt; LayoutTests/editing/selection/move-by-line-cycles-in-table.html:19
&gt; + moveSelectionForwardByLineCommand();

Ditto about the spaces.

&gt; LayoutTests/editing/selection/move-by-line-cycles-in-table.html:21
&gt; +document.write(getSelection().baseOffset == 4 ? &quot;PASS&quot; : &quot;FAIL&quot;);

It&apos;ll be nice if you printed getSelection().baseOffset in the case of FAIL so that it&apos;s easier to diagnose the problem if the test failed on bots.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>344879</commentid>
    <comment_count>15</comment_count>
    <who name="Levi Weintraub">leviw</who>
    <bug_when>2011-02-03 11:33:28 -0800</bug_when>
    <thetext>Committed r77521: &lt;http://trac.webkit.org/changeset/77521&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>74745</attachid>
            <date>2010-11-24 04:14:52 -0800</date>
            <delta_ts>2010-11-24 04:14:52 -0800</delta_ts>
            <desc>layout test demonstrating the problem</desc>
            <filename>move-by-line-006.html</filename>
            <type>text/html</type>
            <size>1041</size>
            <attacher>jochen</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgogICAgPHNjcmlwdCBzcmM9Li4vZWRpdGluZy5qcyBsYW5ndWFnZT0iSmF2
YVNjcmlwdCIgdHlwZT0idGV4dC9KYXZhU2NyaXB0IiA+PC9zY3JpcHQ+CiAgICA8c2NyaXB0Pgog
ICAgICAgIGZ1bmN0aW9uIHRlc3QoKQogICAgICAgIHsKICAgICAgICAgICAgaWYgKHdpbmRvdy5s
YXlvdXRUZXN0Q29udHJvbGxlcikKICAgICAgICAgICAgICAgIGxheW91dFRlc3RDb250cm9sbGVy
LmR1bXBBc1RleHQoKTsKCiAgICAgICAgICAgIHZhciB0YXJnZXQgPSBkb2N1bWVudC5nZXRFbGVt
ZW50QnlJZCgidGFyZ2V0Iik7CiAgICAgICAgICAgIGdldFNlbGVjdGlvbigpLnNldEJhc2VBbmRF
eHRlbnQodGFyZ2V0LmZpcnN0Q2hpbGQsIDAsIHRhcmdldC5maXJzdENoaWxkLCAwKTsKICAgICAg
ICAgICAgZm9yICh2YXIgaT0wOyBpPDI7IGkrKykKICAgICAgICAgICAgICAgIG1vdmVTZWxlY3Rp
b25Gb3J3YXJkQnlMaW5lQ29tbWFuZCgpOwoKICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVu
dEJ5SWQoInJlc3VsdCIpLmlubmVyVGV4dCA9IGdldFNlbGVjdGlvbigpLmJhc2VPZmZzZXQgPT0g
NCA/ICJQQVNTIiA6ICJGQUlMIjsKICAgICAgICB9CiAgICA8L3NjcmlwdD4KPC9oZWFkPgo8Ym9k
eSBvbmxvYWQ9InRlc3QoKSIgc3R5bGU9Ii13ZWJraXQtdXNlci1tb2RpZnk6IHJlYWQtd3JpdGUi
PgogICAgPHA+CiAgICAgICAgVGVzdCBmb3IgPGk+PGEgaHJlZj0iaHR0cDovL2J1Z3Mud2Via2l0
Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NTAwMTIiPmh0dHA6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19i
dWcuY2dpP2lkPTUwMDEyPC9hPgogICAgICAgIE1vdmluZyBjdXJzb3IgZG93biBpbiB0YWJsZSBj
eWNsZXMgYXQgdGhlIGVuZCBvZiBhIHJvdzwvaT4KICAgIDwvcD4KICAgIDxwIGlkPSJyZXN1bHQi
PgogICAgICAgIFRlc3QgZGlkIG5vdCBydW4KICAgIDwvcD4KICAgIDx0YWJsZT48dHI+PHRkIGlk
PSJ0YXJnZXQiPkN1cnNvciBzaG91bGQgYmUgYXQgdGhlIGVuZDwvdGQ+PC90cj48L3RhYmxlPgo8
L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>80981</attachid>
            <date>2011-02-02 15:35:23 -0800</date>
            <delta_ts>2011-02-02 16:51:45 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-50012-20110202153522.patch</filename>
            <type>text/plain</type>
            <size>3825</size>
            <attacher name="Levi Weintraub">leviw</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc3NDE0KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTEtMDItMDIgIExldmkgV2Vp
bnRyYXViICA8bGV2aXdAY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIE1vdmluZyBjdXJzb3IgZG93biBpbiB0YWJsZSB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c29yIGRvd24gaW4gdGFibGUgY3ljbGVzIGF0IHRoZSBlbmQgb2YgYSByb3c8L2k+
CisgICAgPC9wPgorICAgIDxwIGlkPSJyZXN1bHQiPgorICAgICAgICBUZXN0IGRpZCBub3QgcnVu
CisgICAgPC9wPgorICAgIDx0YWJsZSBpZD0idGFibGUiPjx0cj48dGQgaWQ9InRhcmdldCI+Q3Vy
c29yIHNob3VsZCBiZSBhdCB0aGUgZW5kPC90ZD48L3RyPjwvdGFibGU+Cis8L2JvZHk+Cis8L2h0
bWw+CisK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>81005</attachid>
            <date>2011-02-02 16:51:48 -0800</date>
            <delta_ts>2011-02-02 16:56:57 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-50012-20110202165147.patch</filename>
            <type>text/plain</type>
            <size>4009</size>
            <attacher name="Levi Weintraub">leviw</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDc3NDE0KQorKysgU291cmNlL1dlYkNvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTkgQEAKKzIwMTEtMDItMDIgIExldmkgV2Vp
bnRyYXViICA8bGV2aXdAY2hyb21pdW0ub3JnPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIE1vdmluZyBjdXJzb3IgZG93biBpbiB0YWJsZSBjeWNsZXMg
YXQgdGhlIGVuZCBvZiBhIHJvdworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93
X2J1Zy5jZ2k/aWQ9NTAwMTIKKworICAgICAgICBUZX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RUZXN0Q29udHJvbGxlci5kdW1wQXNUZXh0KCk7
CisKK3ZhciB0YXJnZXQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgidGFyZ2V0Iik7CitnZXRT
ZWxlY3Rpb24oKS5zZXRCYXNlQW5kRXh0ZW50KHRhcmdldC5maXJzdENoaWxkLCAwLCB0YXJnZXQu
Zmlyc3RDaGlsZCwgMCk7Citmb3IgKHZhciBpPTA7IGkgPCAyOyBpKyspCisgbW92ZVNlbGVjdGlv
bkZvcndhcmRCeUxpbmVDb21tYW5kKCk7CisKK2RvY3VtZW50LndyaXRlKGdldFNlbGVjdGlvbigp
LmJhc2VPZmZzZXQgPT0gNCA/ICJQQVNTIiA6ICJGQUlMIik7Cis8L3NjcmlwdD4KKzwvZGl2Pgor
PC9ib2R5PgorPC9odG1sPgorCg==
</data>
<flag name="review"
          id="72533"
          type_id="1"
          status="+"
          setter="rniwa"
    />
          </attachment>
      

    </bug>

</bugzilla>