<?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>67009</bug_id>
          
          <creation_ts>2011-08-25 18:12:40 -0700</creation_ts>
          <short_desc>Clicking causes dirty rects that may be unnecessary; this affects future optimizations.</short_desc>
          <delta_ts>2011-08-30 17:29:36 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Shawn Singh">shawnsingh</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>dglazkov</cc>
    
    <cc>fishd</cc>
    
    <cc>mitz</cc>
    
    <cc>vangelis</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>457318</commentid>
    <comment_count>0</comment_count>
    <who name="Shawn Singh">shawnsingh</who>
    <bug_when>2011-08-25 18:12:40 -0700</bug_when>
    <thetext>To reproduce:

  use the --show-paint-rects option with software compositing in chromium.
  click several times in various places on somewhere near text, and small dirty rects will appear in other places.
  eventually the pattern will become clear the dirty rect appears near your previous click, where the invisible caret was probably located.


My guess is that the problem is somewhere related to recomputeCaretRect() in WebCore/editing/FrameSelection.cpp.

So far this problem was probably insignificant, but for upcoming chromium compositor optimizations these arbitrary rects can substantially inflate the area that needs to be redrawn.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458441</commentid>
    <comment_count>1</comment_count>
      <attachid>105520</attachid>
    <who name="Shawn Singh">shawnsingh</who>
    <bug_when>2011-08-29 14:01:19 -0700</bug_when>
    <thetext>Created attachment 105520
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458443</commentid>
    <comment_count>2</comment_count>
    <who name="Shawn Singh">shawnsingh</who>
    <bug_when>2011-08-29 14:04:40 -0700</bug_when>
    <thetext>This patch definitely needs a reviewer who is familiar with WebCore/editing/FrameSelection.cpp

I am not confident this is correct, but the change does work testing manually, and all layout tests still pass (tested on on osx).

This is sort of an internal change, so I don&apos;t think it makes sense to submit a layout test with it?   Is there some other sort of test to include with it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458461</commentid>
    <comment_count>3</comment_count>
      <attachid>105520</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-29 14:33:22 -0700</bug_when>
    <thetext>Comment on attachment 105520
Patch

Attachment 105520 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/9566192

New failing tests:
fast/repaint/japanese-rl-selection-repaint.html
fast/repaint/selection-rl.html
fast/repaint/4776765.html
fast/repaint/4774354.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458527</commentid>
    <comment_count>4</comment_count>
      <attachid>105520</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-08-29 16:17:59 -0700</bug_when>
    <thetext>Comment on attachment 105520
Patch

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

&gt; Source/WebCore/ChangeLog:10
&gt; +        Tests N/A

It’s not true that tests are not applicable to a change like this. We do want to come up with a way to test a change like this.

&gt; Source/WebCore/editing/FrameSelection.cpp:1222
&gt; -    m_absoluteCaretRepaintBounds = caretRepaintRect(m_selection.start().deprecatedNode());
&gt; +    m_absoluteCaretRepaintBounds = m_selection.isNone() ? caretRepaintRect(m_selection.start().deprecatedNode()) : LayoutRect();

This change means that when you are changing the selection to none, we won’t erase the old caret. That’s not correct.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458530</commentid>
    <comment_count>5</comment_count>
      <attachid>105520</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-08-29 16:19:38 -0700</bug_when>
    <thetext>Comment on attachment 105520
Patch

A correct fix for this needs to understand the difference between an old caret that was visible and an old caret that was not visible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458533</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-08-29 16:21:27 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 105520 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=105520&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/ChangeLog:10
&gt; &gt; +        Tests N/A
&gt; 
&gt; It’s not true that tests are not applicable to a change like this. We do want to come up with a way to test a change like this.

We just need some way to detect the effects of repaint. I think others have done some work on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458539</commentid>
    <comment_count>7</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-08-29 16:25:02 -0700</bug_when>
    <thetext>I think a correct fix might be to invalidate the old rect only if m_caretPaint is true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458545</commentid>
    <comment_count>8</comment_count>
    <who name="Shawn Singh">shawnsingh</who>
    <bug_when>2011-08-29 16:32:21 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; I think a correct fix might be to invalidate the old rect only if m_caretPaint is true.


Thanks for your comments, I&apos;ll try to submit another patch in a few days.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>459340</commentid>
    <comment_count>9</comment_count>
    <who name="Shawn Singh">shawnsingh</who>
    <bug_when>2011-08-30 17:07:59 -0700</bug_when>
    <thetext>
Darin, can you please suggest exactly how we should add an automated test for this?

The problem is: a correct fix to this problem would not change anything in the final render trees and pixels... would there still exist a layout test for this, or is there some other set of automated tests I should be adding to?

Thanks very much.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>459354</commentid>
    <comment_count>10</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-08-30 17:29:36 -0700</bug_when>
    <thetext>There are tests called “repaint tests” that check to see whether we have proper repaint rectangles. Dan Bernstein knows more about those and might be able to tell you whether we could use one of those to test this.

If not, we could add a DumpRenderTree hook specifically to check if there is repainting queued up, and use that hook to add a test.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>105520</attachid>
            <date>2011-08-29 14:01:19 -0700</date>
            <delta_ts>2011-08-29 16:19:38 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-67009-20110829140118.patch</filename>
            <type>text/plain</type>
            <size>1723</size>
            <attacher name="Shawn Singh">shawnsingh</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTM5NzcKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCA3N2VlNTdlZTFiYTYyOTQ0
NDhlOGYwMWVkNWVhOTdiYjA3NDZlZWJlLi5iYTZjMmM4ZTU2ZjE2ZDdiN2JjMWI4MTRkZDE3ZDk4
YmJjYTFlMDQ3IDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTcgQEAKKzIwMTEtMDgtMjkgIFNoYXdu
IFNpbmdoICA8c2hhd25zaW5naEBjaHJvbWl1bS5vcmc+CisKKyAgICAgICAgV2hlbiBjbGlja2lu
ZyBvbiB0ZXh0LCBhbiB1bm5lY2Vzc2FyeS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b246OnJlY29tcHV0ZUNhcmV0UmVjdCgpCiAg
ICAgICAgIAogICAgIExheW91dFJlY3Qgb2xkQWJzb2x1dGVDYXJldFJlcGFpbnRCb3VuZHMgPSBt
X2Fic29sdXRlQ2FyZXRSZXBhaW50Qm91bmRzOwogICAgIC8vIFdlIGJlbGlldmUgdGhhdCB3ZSBu
ZWVkIHRvIGluZmxhdGUgdGhlIGxvY2FsIHJlY3QgYmVmb3JlIHRyYW5zZm9ybWluZyBpdCB0byBv
YnRhaW4gdGhlIHJlcGFpbnQgYm91bmRzLgotICAgIG1fYWJzb2x1dGVDYXJldFJlcGFpbnRCb3Vu
ZHMgPSBjYXJldFJlcGFpbnRSZWN0KG1fc2VsZWN0aW9uLnN0YXJ0KCkuZGVwcmVjYXRlZE5vZGUo
KSk7CisgICAgbV9hYnNvbHV0ZUNhcmV0UmVwYWludEJvdW5kcyA9IG1fc2VsZWN0aW9uLmlzTm9u
ZSgpID8gY2FyZXRSZXBhaW50UmVjdChtX3NlbGVjdGlvbi5zdGFydCgpLmRlcHJlY2F0ZWROb2Rl
KCkpIDogTGF5b3V0UmVjdCgpOwogCiAjaWYgRU5BQkxFKFRFWFRfQ0FSRVQpICAgIAogICAgIGlm
IChSZW5kZXJWaWV3KiB2aWV3ID0gdG9SZW5kZXJWaWV3KG1fZnJhbWUtPmRvY3VtZW50KCktPnJl
bmRlcmVyKCkpKSB7Cg==
</data>
<flag name="review"
          id="101713"
          type_id="1"
          status="-"
          setter="darin"
    />
    <flag name="commit-queue"
          id="101714"
          type_id="3"
          status="-"
          setter="webkit.review.bot"
    />
          </attachment>
      

    </bug>

</bugzilla>