Changeset 225092 in webkit


Ignore:
Timestamp:
Nov 21, 2017 11:17:09 PM (6 years ago)
Author:
fred.wang@free.fr
Message:

Async frame scrolling: handle fixed root backgrounds in frames
https://bugs.webkit.org/show_bug.cgi?id=176261

Source/WebCore:

Based on patch by Simon Fraser <Simon Fraser>
Patch by Frederic Wang <fwang@igalia.com> on 2017-11-21
Reviewed by Antonio Gomes.

For frames with tiled backing, we register a slow-repaint object because we hit
RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
called. It also removes the opaque background of non-main frames with tiled backing.
This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.

Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
(WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
repaint object previously registered for this frame. Also add an ASSERT to ensure that a
fixed root background is only set for frames with async scrolling.
(WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
of background and opaqueness to the main frame.

LayoutTests:

Patch by Frederic Wang <fwang@igalia.com> on 2017-11-21
Reviewed by Antonio Gomes.

Extend tiled-drawing-async-frame-scrolling with new test cases and update expectations.

  • compositing/tiling/tiled-drawing-async-frame-scrolling.html: Add two test cases with

non-white and fixed gradient background. The latter exhibits a crash fixed by that commit.

  • compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Adjust expectation due

to spacing changes.

  • platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.

Update expectation for the first case to remove the white background and add expectations for
the two new cases.

  • platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r225090 r225092  
     12017-11-21  Frederic Wang  <fwang@igalia.com>
     2
     3        Async frame scrolling: handle fixed root backgrounds in frames
     4        https://bugs.webkit.org/show_bug.cgi?id=176261
     5
     6        Reviewed by Antonio Gomes.
     7
     8        Extend tiled-drawing-async-frame-scrolling with new test cases and update expectations.
     9
     10        * compositing/tiling/tiled-drawing-async-frame-scrolling.html: Add two test cases with
     11        non-white and fixed gradient background. The latter exhibits a crash fixed by that commit.
     12        * compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Adjust expectation due
     13        to spacing changes.
     14        * platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.
     15        Update expectation for the first case to remove the white background and add expectations for
     16        the two new cases.
     17        * platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt: Ditto.
     18
    1192017-11-21  Commit Queue  <commit-queue@webkit.org>
    220
  • trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt

    r225090 r225092  
     1   
    12
    2 
  • trunk/LayoutTests/compositing/tiling/tiled-drawing-async-frame-scrolling.html

    r225090 r225092  
    1919            }
    2020        }
     21
     22        var frameToLoadCount = 3;
     23        function newFrameLoaded() {
     24            frameToLoadCount--;
     25            if (frameToLoadCount === 0)
     26                doTest();
     27        }
    2128    </script>
     29    <style>
     30        frame {
     31            width: 200px;
     32            height: 100px;
     33        }
     34    </style>
    2235  </head>
    2336  <body>
    24     <iframe onload="setTimeout(doTest, 0)" id="frame" style="height: 100px; width: 200px;" scrolling="yes" srcdoc="&lt;div style='height: 300px; width: 400px;'&gt;&lt;/div&gt;"></iframe>
    25     <pre id="layers">Layer tree goes here</p>
     37    <iframe onload="newFrameLoaded()" scrolling="yes" srcdoc="<html style='
     38            background: transparent;
     39            height: 300px; width: 400px;'></html>"></iframe>
     40    <iframe onload="newFrameLoaded()" scrolling="yes" srcdoc="<html style='
     41            background: #ABCDEF;
     42            height: 300px; width: 400px;'></html>"></iframe>
     43    <iframe onload="newFrameLoaded()" scrolling="yes" srcdoc="<html style='
     44            background-image: linear-gradient(45deg, black, white);
     45            background-attachment: fixed;
     46            height: 300px; width: 400px;'></html>"></iframe>
     47    <pre id="layers">Layer tree goes here</pre>
    2648  </body>
    2749</html>
  • trunk/LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt

    r225090 r225092  
    1 
     1   
    22(GraphicsLayer
    33  (anchor 0.00 0.00)
     
    2121      (top left tile 0, 0 tiles grid 1 x 1)
    2222      (in window 1)
    23       (children 1
     23      (children 3
    2424        (GraphicsLayer
    2525          (position 8.00 8.00)
    26           (bounds 204.00 104.00)
     26          (bounds 304.00 154.00)
    2727          (drawsContent 1)
    2828          (backingStoreAttached 1)
    29           (visible rect 0.00, 0.00 204.00 x 104.00)
     29          (visible rect 0.00, 0.00 304.00 x 154.00)
    3030          (coverage rect -8.00, -8.00 800.00 x 600.00)
    3131          (intersects coverage rect 1)
     
    4242                (GraphicsLayer
    4343                  (anchor 0.00 0.00)
    44                   (bounds 200.00 100.00)
     44                  (bounds 300.00 150.00)
    4545                  (backingStoreAttached 1)
    46                   (visible rect 0.00, 0.00 200.00 x 100.00)
    47                   (coverage rect 0.00, 0.00 200.00 x 100.00)
     46                  (visible rect 0.00, 0.00 300.00 x 150.00)
     47                  (coverage rect 0.00, 0.00 300.00 x 150.00)
    4848                  (intersects coverage rect 1)
    4949                  (contentsScale 2.00)
     
    5252                      (backingStoreAttached 0)
    5353                      (visible rect 0.00, 0.00 0.00 x 0.00)
    54                       (coverage rect 0.00, 0.00 200.00 x 100.00)
     54                      (coverage rect 0.00, 0.00 300.00 x 150.00)
    5555                      (intersects coverage rect 0)
    5656                      (contentsScale 2.00)
     
    5858                        (GraphicsLayer
    5959                          (anchor 0.00 0.00)
    60                           (bounds 408.00 316.00)
     60                          (bounds 400.00 300.00)
    6161                          (backingStoreAttached 1)
    62                           (visible rect 0.00, 0.00 200.00 x 100.00)
    63                           (coverage rect 0.00, 0.00 200.00 x 100.00)
     62                          (visible rect 0.00, 0.00 300.00 x 150.00)
     63                          (coverage rect 0.00, 0.00 300.00 x 150.00)
    6464                          (intersects coverage rect 1)
    6565                          (contentsScale 2.00)
    6666                          (children 1
    6767                            (GraphicsLayer
    68                               (bounds 408.00 316.00)
     68                              (bounds 400.00 300.00)
    6969                              (drawsContent 1)
    70                               (backgroundColor #FFFFFF)
    7170                              (backingStoreAttached 1)
    72                               (visible rect 0.00, 0.00 200.00 x 100.00)
    73                               (coverage rect 0.00, 0.00 200.00 x 100.00)
     71                              (visible rect 0.00, 0.00 300.00 x 150.00)
     72                              (coverage rect 0.00, 0.00 300.00 x 150.00)
    7473                              (intersects coverage rect 1)
    7574                              (contentsScale 2.00)
    76                               (tile cache coverage 0, 0 408 x 316)
     75                              (tile cache coverage 0, 0 400 x 300)
    7776                              (tile size 512 x 512)
    7877                              (top left tile 0, 0 tiles grid 1 x 1)
     
    8281                                  (backingStoreAttached 0)
    8382                                  (visible rect 0.00, 0.00 0.00 x 0.00)
    84                                   (coverage rect 0.00, 0.00 200.00 x 100.00)
     83                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
     84                                  (intersects coverage rect 0)
     85                                  (contentsScale 2.00)
     86                                )
     87                              )
     88                            )
     89                          )
     90                        )
     91                      )
     92                    )
     93                  )
     94                )
     95              )
     96            )
     97          )
     98        )
     99        (GraphicsLayer
     100          (position 316.00 8.00)
     101          (bounds 304.00 154.00)
     102          (drawsContent 1)
     103          (backingStoreAttached 1)
     104          (visible rect 0.00, 0.00 304.00 x 154.00)
     105          (coverage rect -316.00, -8.00 800.00 x 600.00)
     106          (intersects coverage rect 1)
     107          (contentsScale 2.00)
     108          (children 1
     109            (GraphicsLayer
     110              (position 2.00 2.00)
     111              (backingStoreAttached 0)
     112              (visible rect 0.00, 0.00 0.00 x 0.00)
     113              (coverage rect -318.00, -10.00 800.00 x 600.00)
     114              (intersects coverage rect 0)
     115              (contentsScale 2.00)
     116              (children 1
     117                (GraphicsLayer
     118                  (anchor 0.00 0.00)
     119                  (bounds 300.00 150.00)
     120                  (backingStoreAttached 1)
     121                  (visible rect 0.00, 0.00 300.00 x 150.00)
     122                  (coverage rect 0.00, 0.00 300.00 x 150.00)
     123                  (intersects coverage rect 1)
     124                  (contentsScale 2.00)
     125                  (children 1
     126                    (GraphicsLayer
     127                      (backingStoreAttached 0)
     128                      (visible rect 0.00, 0.00 0.00 x 0.00)
     129                      (coverage rect 0.00, 0.00 300.00 x 150.00)
     130                      (intersects coverage rect 0)
     131                      (contentsScale 2.00)
     132                      (children 1
     133                        (GraphicsLayer
     134                          (anchor 0.00 0.00)
     135                          (bounds 400.00 300.00)
     136                          (backingStoreAttached 1)
     137                          (visible rect 0.00, 0.00 300.00 x 150.00)
     138                          (coverage rect 0.00, 0.00 300.00 x 150.00)
     139                          (intersects coverage rect 1)
     140                          (contentsScale 2.00)
     141                          (children 1
     142                            (GraphicsLayer
     143                              (bounds 400.00 300.00)
     144                              (drawsContent 1)
     145                              (backingStoreAttached 1)
     146                              (visible rect 0.00, 0.00 300.00 x 150.00)
     147                              (coverage rect 0.00, 0.00 300.00 x 150.00)
     148                              (intersects coverage rect 1)
     149                              (contentsScale 2.00)
     150                              (tile cache coverage 0, 0 400 x 300)
     151                              (tile size 512 x 512)
     152                              (top left tile 0, 0 tiles grid 1 x 1)
     153                              (in window 1)
     154                              (children 1
     155                                (GraphicsLayer
     156                                  (backingStoreAttached 0)
     157                                  (visible rect 0.00, 0.00 0.00 x 0.00)
     158                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
     159                                  (intersects coverage rect 0)
     160                                  (contentsScale 2.00)
     161                                )
     162                              )
     163                            )
     164                          )
     165                        )
     166                      )
     167                    )
     168                  )
     169                )
     170              )
     171            )
     172          )
     173        )
     174        (GraphicsLayer
     175          (position 8.00 167.00)
     176          (bounds 304.00 154.00)
     177          (drawsContent 1)
     178          (backingStoreAttached 1)
     179          (visible rect 0.00, 0.00 304.00 x 154.00)
     180          (coverage rect -8.00, -167.00 800.00 x 600.00)
     181          (intersects coverage rect 1)
     182          (contentsScale 2.00)
     183          (children 1
     184            (GraphicsLayer
     185              (position 2.00 2.00)
     186              (backingStoreAttached 0)
     187              (visible rect 0.00, 0.00 0.00 x 0.00)
     188              (coverage rect -10.00, -169.00 800.00 x 600.00)
     189              (intersects coverage rect 0)
     190              (contentsScale 2.00)
     191              (children 1
     192                (GraphicsLayer
     193                  (anchor 0.00 0.00)
     194                  (bounds 300.00 150.00)
     195                  (backingStoreAttached 1)
     196                  (visible rect 0.00, 0.00 300.00 x 150.00)
     197                  (coverage rect 0.00, 0.00 300.00 x 150.00)
     198                  (intersects coverage rect 1)
     199                  (contentsScale 2.00)
     200                  (children 1
     201                    (GraphicsLayer
     202                      (backingStoreAttached 0)
     203                      (visible rect 0.00, 0.00 0.00 x 0.00)
     204                      (coverage rect 0.00, 0.00 300.00 x 150.00)
     205                      (intersects coverage rect 0)
     206                      (contentsScale 2.00)
     207                      (children 1
     208                        (GraphicsLayer
     209                          (anchor 0.00 0.00)
     210                          (bounds 400.00 300.00)
     211                          (backingStoreAttached 1)
     212                          (visible rect 0.00, 0.00 300.00 x 150.00)
     213                          (coverage rect 0.00, 0.00 300.00 x 150.00)
     214                          (intersects coverage rect 1)
     215                          (contentsScale 2.00)
     216                          (children 1
     217                            (GraphicsLayer
     218                              (bounds 400.00 300.00)
     219                              (drawsContent 1)
     220                              (backingStoreAttached 1)
     221                              (visible rect 0.00, 0.00 300.00 x 150.00)
     222                              (coverage rect 0.00, 0.00 300.00 x 150.00)
     223                              (intersects coverage rect 1)
     224                              (contentsScale 2.00)
     225                              (tile cache coverage 0, 0 400 x 300)
     226                              (tile size 512 x 512)
     227                              (top left tile 0, 0 tiles grid 1 x 1)
     228                              (in window 1)
     229                              (children 1
     230                                (GraphicsLayer
     231                                  (backingStoreAttached 0)
     232                                  (visible rect 0.00, 0.00 0.00 x 0.00)
     233                                  (coverage rect 0.00, 0.00 300.00 x 150.00)
    85234                                  (intersects coverage rect 0)
    86235                                  (contentsScale 2.00)
  • trunk/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt

    r225090 r225092  
    1 
     1   
    22(GraphicsLayer
    33  (anchor 0.00 0.00)
     
    2121      (top left tile 0, 0 tiles grid 1 x 1)
    2222      (in window 1)
    23       (children 1
     23      (children 3
    2424        (GraphicsLayer
    2525          (position 8.00 8.00)
    26           (bounds 204.00 104.00)
     26          (bounds 304.00 154.00)
    2727          (drawsContent 1)
    2828          (backingStoreAttached 1)
    29           (visible rect 0.00, 0.00 204.00 x 104.00)
     29          (visible rect 0.00, 0.00 304.00 x 154.00)
    3030          (coverage rect -8.00, -8.00 800.00 x 600.00)
    3131          (intersects coverage rect 1)
     
    4242                (GraphicsLayer
    4343                  (anchor 0.00 0.00)
    44                   (bounds 185.00 85.00)
    45                   (backingStoreAttached 1)
    46                   (visible rect 0.00, 0.00 185.00 x 85.00)
    47                   (coverage rect 0.00, 0.00 185.00 x 85.00)
     44                  (bounds 285.00 135.00)
     45                  (backingStoreAttached 1)
     46                  (visible rect 0.00, 0.00 285.00 x 135.00)
     47                  (coverage rect 0.00, 0.00 285.00 x 135.00)
    4848                  (intersects coverage rect 1)
    4949                  (contentsScale 1.00)
     
    5252                      (backingStoreAttached 0)
    5353                      (visible rect 0.00, 0.00 0.00 x 0.00)
    54                       (coverage rect 0.00, 0.00 185.00 x 85.00)
     54                      (coverage rect 0.00, 0.00 285.00 x 135.00)
    5555                      (intersects coverage rect 0)
    5656                      (contentsScale 1.00)
     
    5858                        (GraphicsLayer
    5959                          (anchor 0.00 0.00)
    60                           (bounds 408.00 316.00)
     60                          (bounds 400.00 300.00)
    6161                          (backingStoreAttached 1)
    62                           (visible rect 0.00, 0.00 185.00 x 85.00)
    63                           (coverage rect 0.00, 0.00 185.00 x 85.00)
     62                          (visible rect 0.00, 0.00 285.00 x 135.00)
     63                          (coverage rect 0.00, 0.00 285.00 x 135.00)
    6464                          (intersects coverage rect 1)
    6565                          (contentsScale 1.00)
    6666                          (children 1
    6767                            (GraphicsLayer
    68                               (bounds 408.00 316.00)
     68                              (bounds 400.00 300.00)
    6969                              (drawsContent 1)
    70                               (backgroundColor #FFFFFF)
    7170                              (backingStoreAttached 1)
    72                               (visible rect 0.00, 0.00 185.00 x 85.00)
    73                               (coverage rect 0.00, 0.00 185.00 x 85.00)
     71                              (visible rect 0.00, 0.00 285.00 x 135.00)
     72                              (coverage rect 0.00, 0.00 285.00 x 135.00)
    7473                              (intersects coverage rect 1)
    7574                              (contentsScale 1.00)
    76                               (tile cache coverage 0, 0 408 x 316)
     75                              (tile cache coverage 0, 0 400 x 300)
    7776                              (tile size 512 x 512)
    7877                              (top left tile 0, 0 tiles grid 1 x 1)
     
    8281                                  (backingStoreAttached 0)
    8382                                  (visible rect 0.00, 0.00 0.00 x 0.00)
    84                                   (coverage rect 0.00, 0.00 185.00 x 85.00)
     83                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
    8584                                  (intersects coverage rect 0)
    8685                                  (contentsScale 1.00)
     
    9594                )
    9695                (GraphicsLayer
    97                   (position 0.00 85.00)
    98                   (bounds 185.00 15.00)
    99                   (drawsContent 1)
    100                   (backingStoreAttached 1)
    101                   (visible rect 0.00, 0.00 185.00 x 15.00)
    102                   (coverage rect -10.00, -95.00 800.00 x 600.00)
    103                   (intersects coverage rect 1)
    104                   (contentsScale 1.00)
    105                 )
    106                 (GraphicsLayer
    107                   (position 185.00 0.00)
    108                   (bounds 15.00 85.00)
    109                   (drawsContent 1)
    110                   (backingStoreAttached 1)
    111                   (visible rect 0.00, 0.00 15.00 x 85.00)
    112                   (coverage rect -195.00, -10.00 800.00 x 600.00)
    113                   (intersects coverage rect 1)
    114                   (contentsScale 1.00)
    115                 )
    116                 (GraphicsLayer
    117                   (position 185.00 85.00)
     96                  (position 0.00 135.00)
     97                  (bounds 285.00 15.00)
     98                  (drawsContent 1)
     99                  (backingStoreAttached 1)
     100                  (visible rect 0.00, 0.00 285.00 x 15.00)
     101                  (coverage rect -10.00, -145.00 800.00 x 600.00)
     102                  (intersects coverage rect 1)
     103                  (contentsScale 1.00)
     104                )
     105                (GraphicsLayer
     106                  (position 285.00 0.00)
     107                  (bounds 15.00 135.00)
     108                  (drawsContent 1)
     109                  (backingStoreAttached 1)
     110                  (visible rect 0.00, 0.00 15.00 x 135.00)
     111                  (coverage rect -295.00, -10.00 800.00 x 600.00)
     112                  (intersects coverage rect 1)
     113                  (contentsScale 1.00)
     114                )
     115                (GraphicsLayer
     116                  (position 285.00 135.00)
    118117                  (bounds 15.00 15.00)
    119118                  (drawsContent 1)
    120119                  (backingStoreAttached 1)
    121120                  (visible rect 0.00, 0.00 15.00 x 15.00)
    122                   (coverage rect -195.00, -95.00 800.00 x 600.00)
     121                  (coverage rect -295.00, -145.00 800.00 x 600.00)
     122                  (intersects coverage rect 1)
     123                  (contentsScale 1.00)
     124                )
     125              )
     126            )
     127          )
     128        )
     129        (GraphicsLayer
     130          (position 316.00 8.00)
     131          (bounds 304.00 154.00)
     132          (drawsContent 1)
     133          (backingStoreAttached 1)
     134          (visible rect 0.00, 0.00 304.00 x 154.00)
     135          (coverage rect -316.00, -8.00 800.00 x 600.00)
     136          (intersects coverage rect 1)
     137          (contentsScale 1.00)
     138          (children 1
     139            (GraphicsLayer
     140              (position 2.00 2.00)
     141              (backingStoreAttached 0)
     142              (visible rect 0.00, 0.00 0.00 x 0.00)
     143              (coverage rect -318.00, -10.00 800.00 x 600.00)
     144              (intersects coverage rect 0)
     145              (contentsScale 1.00)
     146              (children 4
     147                (GraphicsLayer
     148                  (anchor 0.00 0.00)
     149                  (bounds 285.00 135.00)
     150                  (backingStoreAttached 1)
     151                  (visible rect 0.00, 0.00 285.00 x 135.00)
     152                  (coverage rect 0.00, 0.00 285.00 x 135.00)
     153                  (intersects coverage rect 1)
     154                  (contentsScale 1.00)
     155                  (children 1
     156                    (GraphicsLayer
     157                      (backingStoreAttached 0)
     158                      (visible rect 0.00, 0.00 0.00 x 0.00)
     159                      (coverage rect 0.00, 0.00 285.00 x 135.00)
     160                      (intersects coverage rect 0)
     161                      (contentsScale 1.00)
     162                      (children 1
     163                        (GraphicsLayer
     164                          (anchor 0.00 0.00)
     165                          (bounds 400.00 300.00)
     166                          (backingStoreAttached 1)
     167                          (visible rect 0.00, 0.00 285.00 x 135.00)
     168                          (coverage rect 0.00, 0.00 285.00 x 135.00)
     169                          (intersects coverage rect 1)
     170                          (contentsScale 1.00)
     171                          (children 1
     172                            (GraphicsLayer
     173                              (bounds 400.00 300.00)
     174                              (drawsContent 1)
     175                              (backingStoreAttached 1)
     176                              (visible rect 0.00, 0.00 285.00 x 135.00)
     177                              (coverage rect 0.00, 0.00 285.00 x 135.00)
     178                              (intersects coverage rect 1)
     179                              (contentsScale 1.00)
     180                              (tile cache coverage 0, 0 400 x 300)
     181                              (tile size 512 x 512)
     182                              (top left tile 0, 0 tiles grid 1 x 1)
     183                              (in window 1)
     184                              (children 1
     185                                (GraphicsLayer
     186                                  (backingStoreAttached 0)
     187                                  (visible rect 0.00, 0.00 0.00 x 0.00)
     188                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
     189                                  (intersects coverage rect 0)
     190                                  (contentsScale 1.00)
     191                                )
     192                              )
     193                            )
     194                          )
     195                        )
     196                      )
     197                    )
     198                  )
     199                )
     200                (GraphicsLayer
     201                  (position 0.00 135.00)
     202                  (bounds 285.00 15.00)
     203                  (drawsContent 1)
     204                  (backingStoreAttached 1)
     205                  (visible rect 0.00, 0.00 285.00 x 15.00)
     206                  (coverage rect -318.00, -145.00 800.00 x 600.00)
     207                  (intersects coverage rect 1)
     208                  (contentsScale 1.00)
     209                )
     210                (GraphicsLayer
     211                  (position 285.00 0.00)
     212                  (bounds 15.00 135.00)
     213                  (drawsContent 1)
     214                  (backingStoreAttached 1)
     215                  (visible rect 0.00, 0.00 15.00 x 135.00)
     216                  (coverage rect -603.00, -10.00 800.00 x 600.00)
     217                  (intersects coverage rect 1)
     218                  (contentsScale 1.00)
     219                )
     220                (GraphicsLayer
     221                  (position 285.00 135.00)
     222                  (bounds 15.00 15.00)
     223                  (drawsContent 1)
     224                  (backingStoreAttached 1)
     225                  (visible rect 0.00, 0.00 15.00 x 15.00)
     226                  (coverage rect -603.00, -145.00 800.00 x 600.00)
     227                  (intersects coverage rect 1)
     228                  (contentsScale 1.00)
     229                )
     230              )
     231            )
     232          )
     233        )
     234        (GraphicsLayer
     235          (position 8.00 166.00)
     236          (bounds 304.00 154.00)
     237          (drawsContent 1)
     238          (backingStoreAttached 1)
     239          (visible rect 0.00, 0.00 304.00 x 154.00)
     240          (coverage rect -8.00, -166.00 800.00 x 600.00)
     241          (intersects coverage rect 1)
     242          (contentsScale 1.00)
     243          (children 1
     244            (GraphicsLayer
     245              (position 2.00 2.00)
     246              (backingStoreAttached 0)
     247              (visible rect 0.00, 0.00 0.00 x 0.00)
     248              (coverage rect -10.00, -168.00 800.00 x 600.00)
     249              (intersects coverage rect 0)
     250              (contentsScale 1.00)
     251              (children 4
     252                (GraphicsLayer
     253                  (anchor 0.00 0.00)
     254                  (bounds 285.00 135.00)
     255                  (backingStoreAttached 1)
     256                  (visible rect 0.00, 0.00 285.00 x 135.00)
     257                  (coverage rect 0.00, 0.00 285.00 x 135.00)
     258                  (intersects coverage rect 1)
     259                  (contentsScale 1.00)
     260                  (children 1
     261                    (GraphicsLayer
     262                      (backingStoreAttached 0)
     263                      (visible rect 0.00, 0.00 0.00 x 0.00)
     264                      (coverage rect 0.00, 0.00 285.00 x 135.00)
     265                      (intersects coverage rect 0)
     266                      (contentsScale 1.00)
     267                      (children 1
     268                        (GraphicsLayer
     269                          (anchor 0.00 0.00)
     270                          (bounds 400.00 300.00)
     271                          (backingStoreAttached 1)
     272                          (visible rect 0.00, 0.00 285.00 x 135.00)
     273                          (coverage rect 0.00, 0.00 285.00 x 135.00)
     274                          (intersects coverage rect 1)
     275                          (contentsScale 1.00)
     276                          (children 1
     277                            (GraphicsLayer
     278                              (bounds 400.00 300.00)
     279                              (backingStoreAttached 1)
     280                              (visible rect 0.00, 0.00 285.00 x 135.00)
     281                              (coverage rect 0.00, 0.00 285.00 x 135.00)
     282                              (intersects coverage rect 1)
     283                              (contentsScale 1.00)
     284                              (children 2
     285                                (GraphicsLayer
     286                                  (anchor 0.00 0.00)
     287                                  (bounds 285.00 135.00)
     288                                  (drawsContent 1)
     289                                  (backingStoreAttached 1)
     290                                  (visible rect 0.00, 0.00 285.00 x 135.00)
     291                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
     292                                  (intersects coverage rect 1)
     293                                  (contentsScale 1.00)
     294                                )
     295                                (GraphicsLayer
     296                                  (bounds 400.00 300.00)
     297                                  (drawsContent 1)
     298                                  (backingStoreAttached 1)
     299                                  (visible rect 0.00, 0.00 285.00 x 135.00)
     300                                  (coverage rect 0.00, 0.00 285.00 x 135.00)
     301                                  (intersects coverage rect 1)
     302                                  (contentsScale 1.00)
     303                                  (tile cache coverage 0, 0 400 x 300)
     304                                  (tile size 512 x 512)
     305                                  (top left tile 0, 0 tiles grid 1 x 1)
     306                                  (in window 1)
     307                                  (children 1
     308                                    (GraphicsLayer
     309                                      (backingStoreAttached 0)
     310                                      (visible rect 0.00, 0.00 0.00 x 0.00)
     311                                      (coverage rect 0.00, 0.00 285.00 x 135.00)
     312                                      (intersects coverage rect 0)
     313                                      (contentsScale 1.00)
     314                                    )
     315                                  )
     316                                )
     317                              )
     318                            )
     319                          )
     320                        )
     321                      )
     322                    )
     323                  )
     324                )
     325                (GraphicsLayer
     326                  (position 0.00 135.00)
     327                  (bounds 285.00 15.00)
     328                  (drawsContent 1)
     329                  (backingStoreAttached 1)
     330                  (visible rect 0.00, 0.00 285.00 x 15.00)
     331                  (coverage rect -10.00, -303.00 800.00 x 600.00)
     332                  (intersects coverage rect 1)
     333                  (contentsScale 1.00)
     334                )
     335                (GraphicsLayer
     336                  (position 285.00 0.00)
     337                  (bounds 15.00 135.00)
     338                  (drawsContent 1)
     339                  (backingStoreAttached 1)
     340                  (visible rect 0.00, 0.00 15.00 x 135.00)
     341                  (coverage rect -295.00, -168.00 800.00 x 600.00)
     342                  (intersects coverage rect 1)
     343                  (contentsScale 1.00)
     344                )
     345                (GraphicsLayer
     346                  (position 285.00 135.00)
     347                  (bounds 15.00 15.00)
     348                  (drawsContent 1)
     349                  (backingStoreAttached 1)
     350                  (visible rect 0.00, 0.00 15.00 x 15.00)
     351                  (coverage rect -295.00, -303.00 800.00 x 600.00)
    123352                  (intersects coverage rect 1)
    124353                  (contentsScale 1.00)
  • trunk/Source/WebCore/ChangeLog

    r225091 r225092  
     12017-11-21  Frederic Wang  <fwang@igalia.com>
     2
     3        Async frame scrolling: handle fixed root backgrounds in frames
     4        https://bugs.webkit.org/show_bug.cgi?id=176261
     5
     6        Based on patch by Simon Fraser <simon.fraser@apple.com>
     7        Reviewed by Antonio Gomes.
     8
     9        For frames with tiled backing, we register a slow-repaint object because we hit
     10        RenderElement::styleWillChange() before we've made a backing for the iframe's RenderView so
     11        view().compositor().supportsFixedRootBackgroundCompositing() returns false. This patch
     12        ensures that this object is removed when setBackgroundLayerPaintsFixedRootBackground is
     13        called. It also removes the opaque background of non-main frames with tiled backing.
     14        This fixes a possible hit of ASSERT(!m_backgroundLayer) after r221615.
     15
     16        Test: compositing/tiling/tiled-drawing-async-frame-scrolling.html
     17
     18        * rendering/RenderLayerBacking.cpp:
     19        (WebCore::RenderLayerBacking::updateGeometry): Do not set opaque contents for frames with
     20        tiled backing. We keep !m_isMainFrameRenderViewLayer for backward compatibility with WK1.
     21        (WebCore::RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground): Add an early
     22        return when m_backgroundLayerPaintsFixedRootBackground is not changed. Remove the slow
     23        repaint object previously registered for this frame. Also add an ASSERT to ensure that a
     24        fixed root background is only set for frames with async scrolling.
     25        (WebCore::RenderLayerBacking::updateRootLayerConfiguration): Restrict some special handling
     26        of background and opaqueness to the main frame.
     27
    1282017-11-21  Zan Dobersek  <zdobersek@igalia.com>
    229
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r225090 r225092  
    10201020    }
    10211021
    1022     if (!m_isMainFrameRenderViewLayer) {
     1022    if (!m_isMainFrameRenderViewLayer && !m_isFrameLayerWithTiledBacking) {
    10231023        // For non-root layers, background is always painted by the primary graphics layer.
    10241024        ASSERT(!m_backgroundLayer);
     
    14221422void RenderLayerBacking::setBackgroundLayerPaintsFixedRootBackground(bool backgroundLayerPaintsFixedRootBackground)
    14231423{
     1424    if (backgroundLayerPaintsFixedRootBackground == m_backgroundLayerPaintsFixedRootBackground)
     1425        return;
     1426
    14241427    m_backgroundLayerPaintsFixedRootBackground = backgroundLayerPaintsFixedRootBackground;
     1428
     1429    if (m_backgroundLayerPaintsFixedRootBackground) {
     1430        ASSERT(m_isFrameLayerWithTiledBacking);
     1431        renderer().view().frameView().removeSlowRepaintObject(*renderer().view().rendererForRootBackground());
     1432    }
    14251433}
    14261434
     
    19241932
    19251933    if (m_backgroundLayerPaintsFixedRootBackground && m_backgroundLayer) {
    1926         m_backgroundLayer->setBackgroundColor(backgroundColor);
    1927         m_backgroundLayer->setContentsOpaque(!viewIsTransparent);
     1934        if (m_isMainFrameRenderViewLayer) {
     1935            m_backgroundLayer->setBackgroundColor(backgroundColor);
     1936            m_backgroundLayer->setContentsOpaque(!viewIsTransparent);
     1937        }
    19281938
    19291939        m_graphicsLayer->setBackgroundColor(Color());
    19301940        m_graphicsLayer->setContentsOpaque(false);
    1931     } else {
     1941    } else if (m_isMainFrameRenderViewLayer) {
    19321942        m_graphicsLayer->setBackgroundColor(backgroundColor);
    19331943        m_graphicsLayer->setContentsOpaque(!viewIsTransparent);
Note: See TracChangeset for help on using the changeset viewer.