<?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>125263</bug_id>
          
          <creation_ts>2013-12-04 15:43:59 -0800</creation_ts>
          <short_desc>Bad repaints on Twitter when the tile cache has a margin</short_desc>
          <delta_ts>2013-12-05 09:54:48 -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>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Beth Dakin">bdakin</reporter>
          <assigned_to name="Beth Dakin">bdakin</assigned_to>
          <cc>bdakin</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>thorton</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>956674</commentid>
    <comment_count>0</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-12-04 15:43:59 -0800</bug_when>
    <thetext>With the new backgroundShouldExtendBeyondPage() Setting, there are painting artifacts on Twitter and other webpages that grow their contents size.

&lt;rdar://problem/15576884&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>956676</commentid>
    <comment_count>1</comment_count>
      <attachid>218468</attachid>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-12-04 15:46:32 -0800</bug_when>
    <thetext>Created attachment 218468
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>956693</commentid>
    <comment_count>2</comment_count>
      <attachid>218468</attachid>
    <who name="Tim Horton">thorton</who>
    <bug_when>2013-12-04 16:22:24 -0800</bug_when>
    <thetext>Comment on attachment 218468
Patch

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

&gt; Source/WebCore/platform/graphics/ca/mac/TileController.mm:755
&gt; +        // If there are magin tiles and the bounds have grown taller or wider, then the tiles that used to

margin

&gt; Source/WebCore/platform/graphics/ca/mac/TileController.mm:761
&gt; +                IntRect boundsWithoutMargin = IntRect(IntPoint(), expandedIntSize(m_tileCacheLayer-&gt;bounds().size()));
&gt; +                IntRect oldBoundsWithoutMargin = IntRect(IntPoint(), m_boundsAtLastRevalidate.size());
&gt; +                oldBoundsWithoutMargin.contract(IntSize(leftMarginWidth() + rightMarginWidth(), topMarginHeight() + bottomMarginHeight()));

it might be nice if these things were factored out, especially the things that are done elsewhere

&gt; Source/WebCore/platform/graphics/ca/mac/TileController.mm:763
&gt; +                if (bounds.height() &gt; m_boundsAtLastRevalidate.height()) {

smfr mentioned when things get shorter/skinnier, and you said that it didn&apos;t seem to be an issue, but I wonder why? what is invalidating the layer in that case? why doesn&apos;t it have stale content? would be nice to have a clear understanding.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>956936</commentid>
    <comment_count>3</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-12-05 09:50:42 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 218468 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=218468&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/platform/graphics/ca/mac/TileController.mm:755
&gt; &gt; +        // If there are magin tiles and the bounds have grown taller or wider, then the tiles that used to
&gt; 
&gt; margin
&gt; 

Hehe

&gt; &gt; Source/WebCore/platform/graphics/ca/mac/TileController.mm:761
&gt; &gt; +                IntRect boundsWithoutMargin = IntRect(IntPoint(), expandedIntSize(m_tileCacheLayer-&gt;bounds().size()));
&gt; &gt; +                IntRect oldBoundsWithoutMargin = IntRect(IntPoint(), m_boundsAtLastRevalidate.size());
&gt; &gt; +                oldBoundsWithoutMargin.contract(IntSize(leftMarginWidth() + rightMarginWidth(), topMarginHeight() + bottomMarginHeight()));
&gt; 
&gt; it might be nice if these things were factored out, especially the things that are done elsewhere
&gt; 

Will do.

&gt; &gt; Source/WebCore/platform/graphics/ca/mac/TileController.mm:763
&gt; &gt; +                if (bounds.height() &gt; m_boundsAtLastRevalidate.height()) {
&gt; 
&gt; smfr mentioned when things get shorter/skinnier, and you said that it didn&apos;t seem to be an issue, but I wonder why? what is invalidating the layer in that case? why doesn&apos;t it have stale content? would be nice to have a clear understanding.

I did some debugging here and Tim and I talked about it in person. Basically it seems like the cached repaint rects in the GraphicsLayerCA class always seem to have a repaint rect equivalent to the &quot;old&quot; size in changing-content-size test cases. So when the content goes from small to large, there is a small repaint rect that doesn&apos;t cover everything. Normal content ends up being fine due to other normal-content invalidations. When the page goes from large to small there is a large repaint rect that is big enough to cover the margin.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>956939</commentid>
    <comment_count>4</comment_count>
    <who name="Beth Dakin">bdakin</who>
    <bug_when>2013-12-05 09:54:48 -0800</bug_when>
    <thetext>Thanks Tim! http://trac.webkit.org/changeset/160179</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>218468</attachid>
            <date>2013-12-04 15:46:32 -0800</date>
            <delta_ts>2013-12-04 16:22:24 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>for-review.txt</filename>
            <type>text/plain</type>
            <size>2907</size>
            <attacher name="Beth Dakin">bdakin</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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y
Z2luLndpZHRoKCkgLSBvbGRCb3VuZHNXaXRob3V0TWFyZ2luLndpZHRoKCksIG9sZEJvdW5kc1dp
dGhvdXRNYXJnaW4uaGVpZ2h0KCkpOworICAgICAgICAgICAgICAgICAgICBzZXROZWVkc0Rpc3Bs
YXlJblJlY3QoZm9ybWVyUmlnaHRNYXJnaW5SZWN0KTsKKyAgICAgICAgICAgICAgICB9CisgICAg
ICAgICAgICB9CisgICAgICAgIH0KKwogICAgICAgICBGbG9hdFJlY3Qgc2NhbGVkQm91bmRzKGJv
dW5kcyk7CiAgICAgICAgIHNjYWxlZEJvdW5kcy5zY2FsZShtX3NjYWxlKTsKICAgICAgICAgSW50
UmVjdCBib3VuZHNJblRpbGVDb29yZHMoZW5jbG9zaW5nSW50UmVjdChzY2FsZWRCb3VuZHMpKTsK
</data>
<flag name="review"
          id="241895"
          type_id="1"
          status="+"
          setter="thorton"
    />
          </attachment>
      

    </bug>

</bugzilla>