<?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>7319</bug_id>
          
          <creation_ts>2006-02-16 20:29:47 -0800</creation_ts>
          <short_desc>Can&apos;t see caret at the end of a contenteditable div with overflow:hidden</short_desc>
          <delta_ts>2006-03-07 11:51:46 -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>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>6986</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adele Peterson">adele</reporter>
          <assigned_to name="Adele Peterson">adele</assigned_to>
          <cc>harrison</cc>
    
    <cc>hyatt</cc>
    
    <cc>justin.garcia</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>33088</commentid>
    <comment_count>0</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-02-16 20:29:47 -0800</bug_when>
    <thetext>See test case.  In the new text fields, the caret stops blinking when you arrow over to the right edge.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33089</commentid>
    <comment_count>1</comment_count>
      <attachid>6555</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-02-16 20:31:58 -0800</bug_when>
    <thetext>Created attachment 6555
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33099</commentid>
    <comment_count>2</comment_count>
      <attachid>6559</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-02-17 01:03:26 -0800</bug_when>
    <thetext>Created attachment 6559
patch

I&apos;m not sure this is the right approach for the long term, but it solves this specific problem.  Maybe we want a render class for any renderer that has an anonymous DOM tree.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33136</commentid>
    <comment_count>3</comment_count>
    <who name="David Harrison">harrison</who>
    <bug_when>2006-02-17 10:51:07 -0800</bug_when>
    <thetext>Agreed that this patch does not seem right.  Reason is that the loop you&apos;re changing is trying to skip what I&apos;d call &quot;intermediate&quot; nodes, but I would not a call a text field intermediate.

Please elaborate on what is going wrong to cause this bug (apparently something to do with anon DOM?), then I&apos;ll try to help with longer term solution.  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33138</commentid>
    <comment_count>4</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-02-17 11:19:23 -0800</bug_when>
    <thetext>When the caret is at the end, and RenderBlock::paintCaret is called for the RenderTextField, the containing block for the text node is its parent div (which is anonymous), and not the RenderTextField, which is preventing paintCaret from actually painting.

At other caret positions, paintCaret isn&apos;t called for the RenderTextField-- only for the div, so the containingBlock matches the caller.  So maybe we should never be getting to the point where the RenderTextField is trying to draw the caret?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34685</commentid>
    <comment_count>5</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-03-01 17:02:34 -0800</bug_when>
    <thetext>&lt;rdar://problem/4463504&gt; caret stops blinking when it reaches the end of the new text field (7319)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35311</commentid>
    <comment_count>6</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-03-06 11:26:50 -0800</bug_when>
    <thetext>justin and i discussed the possibility that the div just needed more padding, but after experimenting, that doesn&apos;t seem to have any effect.

I was also able to reproduce the problem with a normal div.  I&apos;ll attach the test case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35312</commentid>
    <comment_count>7</comment_count>
      <attachid>6900</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-03-06 11:27:30 -0800</bug_when>
    <thetext>Created attachment 6900
test case w/ editable div</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35329</commentid>
    <comment_count>8</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-03-06 14:38:33 -0800</bug_when>
    <thetext>One explanation is that the div&apos;s overflow layer is not large enough for the caret at the end.

RenderLayer::computeScrollDimensions uses the rightmostPosition to compute the scrollWidth.  rightmostPosition will compute a position based on the text nodes in the block.  If we add code to account for the possibility of a cursor, then the rightmostPosition would increase by 1 in this case.

Something like this in RenderBlock::rightmostPosition...

// If this node is a root editable element, then the rightmostPosition should account for a caret at the end.
if (node()-&gt;isContentEditable() &amp;&amp; node() == node()-&gt;rootEditableElement())
    right += 1;

This does the trick, but I&apos;m not sure its the right thing to do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35441</commentid>
    <comment_count>9</comment_count>
      <attachid>6921</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-03-07 11:02:42 -0800</bug_when>
    <thetext>Created attachment 6921
patch

I don&apos;t think this addresses the rtl case- but my testing showed that there are other serious problems with the caret displaying correctly for rtl editable areas, which makes it difficult to test this specific case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35443</commentid>
    <comment_count>10</comment_count>
      <attachid>6921</attachid>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2006-03-07 11:47:20 -0800</bug_when>
    <thetext>Comment on attachment 6921
patch

You should add style()-&gt;direction() == LTR as well.

r=me</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>6555</attachid>
            <date>2006-02-16 20:31:58 -0800</date>
            <delta_ts>2006-02-16 20:31:58 -0800</delta_ts>
            <desc>test case</desc>
            <filename>scroll2.html</filename>
            <type>text/html</type>
            <size>121</size>
            <attacher name="Adele Peterson">adele</attacher>
            
              <data encoding="base64">PGlucHV0IHN0eWxlPSIta2h0bWwtYXBwZWFyYW5jZTp0ZXh0ZmllbGQiIHZhbHVlPSJNb3ZlIGN1
cnNvciB0byB0aGUgcmlnaHQuLi4uc2VlIGl0IHN0b3AgYmxpbmtpbmcgYXQgdGhlIGVkZ2UiPjwv
aW5wdXQ+Cg==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>6559</attachid>
            <date>2006-02-17 01:03:26 -0800</date>
            <delta_ts>2006-03-07 11:02:42 -0800</delta_ts>
            <desc>patch</desc>
            <filename>caret.txt</filename>
            <type>text/plain</type>
            <size>1702</size>
            <attacher name="Adele Peterson">adele</attacher>
            
              <data encoding="base64">SW5kZXg6IHJlbmRlcmluZy9SZW5kZXJUZXh0RmllbGQuaAo9PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSByZW5kZXJp
bmcvUmVuZGVyVGV4dEZpZWxkLmgJKHJldmlzaW9uIDEyODY1KQorKysgcmVuZGVyaW5nL1JlbmRl
clRleHRGaWVsZC5oCSh3b3JraW5nIGNvcHkpCkBAIC01NCw2ICs1NCw3IEBACiAgICAgdmlydHVh
bCB2b2lkIHJlbW92ZUxlZnRvdmVyQW5vbnltb3VzQm94ZXMoKSB7fTsKICAgICB2aXJ0dWFsIHZv
aWQgc2V0U3R5bGUoUmVuZGVyU3R5bGUqIHN0eWxlKTsKICAgICB2aXJ0dWFsIHZvaWQgdXBkYXRl
RnJvbUVsZW1lbnQoKTsKKyAgICB2aXJ0dWFsIGJvb2wgaXNSZW5kZXJUZXh0RmllbGQoKSBjb25z
dCB7IHJldHVybiB0cnVlOyB9CiAgICAgCiAgICAgUmVuZGVyU3R5bGUqIGNyZWF0ZURpdlN0eWxl
KFJlbmRlclN0eWxlKiBzdGFydFN0eWxlK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QCAtNzMyLDcgKzczMiw3IEBACiAgICAgICAgIH0KICAgICB9IGVsc2UgewogICAgICAgICB3aGls
ZSAobyAmJiAoKG8tPmlzSW5saW5lKCkgJiYgIW8tPmlzUmVwbGFjZWQoKSkgfHwgby0+aXNUYWJs
ZVJvdygpIHx8IG8tPmlzVGFibGVTZWN0aW9uKCkKLSAgICAgICAgICAgICAgICAgICAgIHx8IG8t
PmlzVGFibGVDb2woKSB8fCBvLT5pc0ZyYW1lU2V0KCkKKyAgICAgICAgICAgICAgICAgICAgIHx8
IG8tPmlzVGFibGVDb2woKSB8fCBvLT5pc0ZyYW1lU2V0KCkgfHwgKG8tPnBhcmVudCgpICYmIG8t
PnBhcmVudCgpLT5pc1JlbmRlclRleHRGaWVsZCgpKQogI2lmIFNWR19TVVBQT1JUCiAgICAgICAg
ICAgICAgICAgICAgICB8fCBvLT5pc0tDYW52YXNDb250YWluZXIoKQogI2VuZGlmCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>6900</attachid>
            <date>2006-03-06 11:27:30 -0800</date>
            <delta_ts>2006-03-06 11:27:30 -0800</delta_ts>
            <desc>test case w/ editable div</desc>
            <filename>cursor.html</filename>
            <type>text/html</type>
            <size>123</size>
            <attacher name="Adele Peterson">adele</attacher>
            
              <data encoding="base64">PGRpdiBzdHlsZT0id2lkdGg6MTAwcHg7IGRpc3BsYXk6YmxvY2s7IHdoaXRlLXNwYWNlOm5vd3Jh
cDsgb3ZlcmZsb3c6aGlkZGVuOyIgY29udGVudGVkaXRhYmxlPjEyMzQ1IDY3ODkgYWJjZGUgZmdo
aWprPC9kaXY+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>6921</attachid>
            <date>2006-03-07 11:02:42 -0800</date>
            <delta_ts>2006-03-07 11:47:20 -0800</delta_ts>
            <desc>patch</desc>
            <filename>cursor.txt</filename>
            <type>text/plain</type>
            <size>1408</size>
            <attacher name="Adele Peterson">adele</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDEzMTkx
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTYgQEAKKzIwMDYtMDMt
MDcgIEFkZWxlIFBldGVyc29uICA8YWRlbGVAYXBwbGUuY29tPgorCisgICAgICAgIFJldmlld2Vk
IGJ5IE5PQk9EWSAoT09QUyEpCisKKyAgICAgICAgLSBGaXggZm9yIGh0dHA6Ly9idWd6aWxsYS5v
cGVuZGFyd2luLm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NzMxOQorICAgICAgICBDYW4ndCBzZWUgY2Fy
ZXQgYXQgdGhlIGVuZCBvZiBhIGNvbnRlbnRlZGl0YWJsZSBkaXYgd2l0aCBvdmVyZmxvdzpoaWRk
ZW4KKworICAgICAgICBObyB0ZXN0cyBhZGRlZCBzaW5jZSBJIGRvbid0IHRoaW5rIHRoZSBibGlu
a2luZyBjYXJldCB3aWxsIHNob3cgdXAgaW4gb3VyIHRlc3RzLgorCisgICAgICAgICogcmVuZGVy
aW5nL1JlbmRlckJsb2NrLmNwcDoKKyAgICAgICAgKFdlYkNvcmU6OlJlbmRlckJsb2NrOjpyaWdo
dG1vc3RQb3NpdGlvbik6IFdoZW4gY2FsY3VsYXRpbmcgdGhlIHJpZ2h0bW9zdFBvc2l0aW9uIGZv
ciBlZGl0YWJsZSBibG9ja3MsIAorICAgICAgICB3ZSBuZWVkIHRvIGFjY291bnQgZm9yIHRoZSBj
YXJldCB0aGF0IGNhbiBiZSBkcmF3biAxIHB4IHBhc3QgdGhlIGxhc3QgY2hpbGQgaW5saW5lIGJv
eC4KKwogMjAwNi0wMy0wNyAgRGF2aWQgS2lsemVyICA8ZGRraWx6ZXJAa2lsemVyLm5ldD4KIAog
ICAgICAgICBSZXZpZXdlZCBieSBEYXJpbi4KSW5kZXg6IHJlbmRlcmluZy9SZW5kZXJCbG9jay5j
cHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PQotLS0gcmVuZGVyaW5nL1JlbmRlckJsb2NrLmNwcAkocmV2aXNpb24gMTMx
ODIpCisrKyByZW5kZXJpbmcvUmVuZGVyQmxvY2suY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0yMTYx
LDYgKzIxNjEsOSBAQAogICAgICAgICAgICAgaW50IHJwID0gY3VyckJveC0+eFBvcygpICsgY3Vy
ckJveC0+d2lkdGgoKTsKICAgICAgICAgICAgIHJpZ2h0ID0ga01heChyaWdodCwgcnApOwogICAg
ICAgICB9CisgICAgICAgIC8vIElmIHRoaXMgbm9kZSBpcyBhIHJvb3QgZWRpdGFibGUgZWxlbWVu
dCwgdGhlbiB0aGUgcmlnaHRtb3N0UG9zaXRpb24gc2hvdWxkIGFjY291bnQgZm9yIGEgY2FyZXQg
YXQgdGhlIGVuZC4KKyAgICAgICAgaWYgKG5vZGUoKS0+aXNDb250ZW50RWRpdGFibGUoKSAmJiBu
b2RlKCkgPT0gbm9kZSgpLT5yb290RWRpdGFibGVFbGVtZW50KCkpCisgICAgICAgICAgICByaWdo
dCArPSAxOwogICAgIH0KICAgICAKICAgICByZXR1cm4gcmlnaHQ7Cg==
</data>
<flag name="review"
          id="1786"
          type_id="1"
          status="+"
          setter="hyatt"
    />
          </attachment>
      

    </bug>

</bugzilla>