<?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>67203</bug_id>
          
          <creation_ts>2011-08-30 09:13:12 -0700</creation_ts>
          <short_desc>Absolutely positioned div with canvas child does not move with parent div.</short_desc>
          <delta_ts>2014-10-31 20:35:35 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.7</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>madsenat</reporter>
          <assigned_to name="Simon Fraser (smfr)">simon.fraser</assigned_to>
          <cc>aljungberg</cc>
    
    <cc>enne</cc>
    
    <cc>mdelaney7</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>vangelis</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>458942</commentid>
    <comment_count>0</comment_count>
    <who name="">madsenat</who>
    <bug_when>2011-08-30 09:13:12 -0700</bug_when>
    <thetext>The above URL shows a simple process block we use in our online diagramming application. After a few seconds I highlight the divs, remove some extra DOM elements that are not needed for the demo, and add the event handlers for the demo. The final DOM structure is as follows:

&lt;p /&gt; - hidden
&lt;p /&gt;
&lt;div&gt;
    &lt;div&gt;
        &lt;canvas /&gt; (shape canvas)
        &lt;div&gt;
            &lt;canvas /&gt; (text canvas)
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;

If you drag around the element you will see that the canvas the text is rendered on (in blue) stays in place while the div parent of the canvas (green) stays where it should be. You can press the &apos;x&apos; key to toggle the visibility of the text canvas (css display set to &apos;none&apos; and &apos;block&apos; appropriately) and when you show it again it will be in the right place.

Another interesting note is that if you reverse the order of the outer canvas (where the block shape is rendered) and it&apos;s sibling div (the parent of the text canvas) then they stay together just fine. You can use the &apos;y&apos; key to see this in action.

We see the same issues on the beta channel of Chrome and it appears to be a GPU acceleration thing as we can locate a GPU acceleration related process and kill it and everything snaps back to the right place.

To see this issue in our production environment you can visit lucidchart.com/demo and drag a block from the left hand column onto the page then drag it around.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>458944</commentid>
    <comment_count>1</comment_count>
    <who name="">madsenat</who>
    <bug_when>2011-08-30 09:15:15 -0700</bug_when>
    <thetext>Just as a note, I have created the same DOM structure as the example and manually drawn some lines and shapes on the different canvases but it would not reproduce the problem. We are only able to get it to happen when the canvases are drawn from our system.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476777</commentid>
    <comment_count>2</comment_count>
      <attachid>109437</attachid>
    <who name="Brendan Kenny">bckenny</who>
    <bug_when>2011-10-02 22:27:33 -0700</bug_when>
    <thetext>Created attachment 109437
simpler test case

Here is a simpler test case with the same DOM structure but without the Lucid Chart js library. The static HTML and CSS are sufficient to set up the buggy render tree, but js is necessary to move the div to see the child canvas not being repainted.

The key requirements in this example seem to be to have all the elements positioned, and the top-most div be overflow clipped. When the rectangle&apos;s div is moved, layout appears to happen correctly, but the text canvas isn&apos;t repainted until a larger repaint is forced (selecting in dev tools, window resizing, etc).

As the original testcase demonstrated, adding one of several style properties to the rectangle&apos;s div makes it properly repaint the text canvas (opacity and transforms work; overflow:hidden makes both the text canvas and its parent div not repaint).

As noted in the matching Chromium bug (http://crbug.com/95275), painting can also be fixed by making the text canvas not positioned (so it&apos;s not in its own compositing layer).

I&apos;m seeing this bug in
Chrome 16 (103657) but not Safari on Windows 7
Safari 5.1 on OS X 10.7.1 (but not on 10.6.8)

bisecting Chromium puts the problem within
http://build.chromium.org/f/chromium/perf/dashboard/ui/changelog.html?url=/trunk/src&amp;range=86508:86542

but that may be just because accelerated canvas was turned on in 86510</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>477304</commentid>
    <comment_count>3</comment_count>
    <who name="Vangelis Kokkevis">vangelis</who>
    <bug_when>2011-10-03 15:52:35 -0700</bug_when>
    <thetext>My first hunch was that the behavior was unrelated to canvas but had something to do with composited layers and absolute positioning.  Replacing the outer canvas (rect_canvas) by a div with a translateZ(0) webkit transform still reproduces the problem.  Further replacing the inner canvas (text_canvas) by a div makes the issue go away even though we still correctly get two composited layers.

I&apos;m pretty sure that the recent behavior change is a result of the introduction of the accelerated canvas both Safari in 10.7 and Chrome version 15+. 

CC-ing a couple more folks familiar with this part of the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>477674</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2011-10-04 10:11:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/10231214&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>559239</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-02-17 09:07:53 -0800</bug_when>
    <thetext>To work around this you can put z-index: 0 on #fullscreen_div.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>559250</commentid>
    <comment_count>6</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-02-17 09:25:21 -0800</bug_when>
    <thetext>The bug here is that changing the position of #rect_div results in an incremental layout which doesn&apos;t encompass the layer for #text_canvas.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>559252</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2012-02-17 09:26:45 -0800</bug_when>
    <thetext>This is a more subtle version of bug 26430.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1045479</commentid>
    <comment_count>8</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2014-10-31 20:35:35 -0700</bug_when>
    <thetext>No longer reproduces.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>109437</attachid>
            <date>2011-10-02 22:27:33 -0700</date>
            <delta_ts>2011-10-02 22:27:33 -0700</delta_ts>
            <desc>simpler test case</desc>
            <filename>compositing_test.html</filename>
            <type>text/html</type>
            <size>2814</size>
            <attacher name="Brendan Kenny">bckenny</attacher>
            
              <data encoding="base64">77u/PCFkb2N0eXBlIGh0bWw+DQo8aHRtbD4NCjxoZWFkPg0KICA8bWV0YSBjaGFyc2V0PSJ1dGYt
OCI+DQogIDx0aXRsZT5jb21wb3NpdGluZyBsYXllciBidWc8L3RpdGxlPg0KICA8c3R5bGU+DQog
ICAgI2Z1bGxzY3JlZW5fZGl2IHsNCiAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTsNCiAgICAgIG92
ZXJmbG93OiBoaWRkZW47DQogICAgICB3aWR0aDogMTAwMHB4Ow0KICAgICAgaGVpZ2h0OiA4MDBw
eDsNCiAgICB9DQogICAgI3JlY3RfZGl2IHsNCiAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsNCiAg
ICAgIGxlZnQ6IDM1MXB4Ow0KICAgICAgdG9wOiAyMTlweDsNCiAgICAgIHdpZHRoOiAzNTZweDsN
CiAgICAgIGhlaWdodDogMjU2cHg7DQogICAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDI1NSwg
MjU1LCAwLCAwLjI5Njg3NSk7DQogICAgfQ0KICAgICNyZWN0X2NhbnZhcyB7DQogICAgICBsZWZ0
OiAwcHg7DQogICAgICB0b3A6IDBweDsNCiAgICAgIHdpZHRoOiAzNT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