Changeset 211662 in webkit


Ignore:
Timestamp:
Feb 3, 2017, 5:53:38 PM (9 years ago)
Author:
Simon Fraser
Message:

Correctly set the "inWindow" flag for TileControllers that aren't the page tiles, and clarify "usingTiledBacking" logic
https://bugs.webkit.org/show_bug.cgi?id=167774

Reviewed by Tim Horton.
Source/WebCore:

RenderLayerBacking had some very confusing "usingTiledCacheLayer" uses.

Its member variable, m_usingTiledCacheLayer, really meant "m_isMainFrameLayerWithTiledBacking" so make it so.
It had a usingTiledBacking(), which returned the same thing, which this patch replaces with isMainFrameLayerWithTiledBacking().

The fact that usingTiledBacking() was only true for the page tiled layer tripped up
RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants(), which would only ever call setIsInWindow()
on the page tiled layer. These changes fix that.

Also make a way for tests to unparent the web view via UIScriptController, and dump out the "in window"
status of TileBackings when dumping tile caches.

Test: tiled-drawing/tiled-backing-in-window.html

  • platform/graphics/TiledBacking.h:
  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::dumpAdditionalProperties):

  • platform/graphics/ca/TileController.h:
  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::computePageTiledBackingCoverage):
(WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
(WebCore::RenderLayerBacking::setTiledBackingHasMargins):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::shouldClipCompositedBounds):
(WebCore::RenderLayerBacking::updateDescendantClippingLayer):
(WebCore::RenderLayerBacking::updateRootLayerConfiguration):
(WebCore::RenderLayerBacking::paintsIntoWindow):
(WebCore::computeTileCoverage): Deleted.

  • rendering/RenderLayerBacking.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
(WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing):
(WebCore::RenderLayerCompositor::documentUsesTiledBacking):

Tools:

Implement UIScriptController removeViewFromWindow() and addViewToWindow(), and hook
up for Mac WK1 and WK2, and iOS WK2. It takes a callback because view state updates to the
web process are async, so the callback fires after the web process gets the new state.

  • DumpRenderTree/ios/UIScriptControllerIOS.mm:

(WTR::UIScriptController::removeViewFromWindow):
(WTR::UIScriptController::addViewToWindow):

  • DumpRenderTree/mac/DumpRenderTree.mm:

(createWebViewAndOffscreenWindow):
(resetWebViewToConsistentStateBeforeTesting):

  • DumpRenderTree/mac/DumpRenderTreeMac.h:
  • DumpRenderTree/mac/UIScriptControllerMac.mm:

(WTR::UIScriptController::removeViewFromWindow):
(WTR::UIScriptController::addViewToWindow):

  • TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
  • TestRunnerShared/UIScriptContext/UIScriptController.cpp:

(WTR::UIScriptController::removeViewFromWindow):
(WTR::UIScriptController::addViewToWindow):

  • TestRunnerShared/UIScriptContext/UIScriptController.h:
  • WebKitTestRunner/PlatformWebView.h:
  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetStateToConsistentValues):

  • WebKitTestRunner/ios/PlatformWebViewIOS.mm:

(WTR::PlatformWebView::removeFromWindow):
(WTR::PlatformWebView::addToWindow):

  • WebKitTestRunner/ios/UIScriptControllerIOS.mm:

(WTR::UIScriptController::removeViewFromWindow):
(WTR::UIScriptController::addViewToWindow):

  • WebKitTestRunner/mac/PlatformWebViewMac.mm:

(WTR::PlatformWebView::removeFromWindow):
(WTR::PlatformWebView::addToWindow):

  • WebKitTestRunner/mac/UIScriptControllerMac.mm:

(WTR::UIScriptController::removeViewFromWindow):
(WTR::UIScriptController::addViewToWindow):

LayoutTests:

Rebase to include the "in window" output.

tiled-drawing/background-transparency-toggle.html was sensitive to the length of the output, so give the body
a fixed size.

  • compositing/tiling/offscreen-tiled-layer-expected.txt:
  • compositing/tiling/transform-origin-tiled-expected.txt:
  • platform/mac-wk1/compositing/tiling/offscreen-tiled-layer-expected.txt:
  • platform/mac-wk1/compositing/tiling/transform-origin-tiled-expected.txt:
  • platform/mac-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt:
  • platform/mac-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
  • platform/mac-wk2/compositing/tiling/tile-cache-zoomed-expected.txt:
  • platform/mac-wk2/compositing/tiling/tiled-layer-resize-expected.txt:
  • platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
  • platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
  • platform/mac/compositing/tiling/tiled-layer-resize-expected.txt:
  • tiled-drawing/background-transparency-toggle-expected.txt:
  • tiled-drawing/background-transparency-toggle.html:
  • tiled-drawing/scrolling/fast-scroll-div-latched-div-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-select-latched-select-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-background-no-image-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-body-background-body-layer-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-body-background-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-body-background-opacity-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-body-background-positioned-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-body-background-transformed-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-body-background-zoomed-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-html-background-expected.txt:
  • tiled-drawing/scrolling/fixed-background/fixed-non-propagated-body-background-expected.txt:
  • tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt:
  • tiled-drawing/simple-document-with-margin-tiles-expected.txt:
  • tiled-drawing/tile-coverage-after-scroll-expected.txt:
  • tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt:
  • tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:
  • tiled-drawing/tile-coverage-slow-scrolling-expected.txt:
  • tiled-drawing/tile-coverage-speculative-expected.txt:
  • tiled-drawing/tile-coverage-view-exposed-rect-expected.txt:
  • tiled-drawing/tile-size-both-scrollable-expected.txt:
  • tiled-drawing/tile-size-horizontally-scrollable-expected.txt:
  • tiled-drawing/tile-size-slow-zoomed-expected.txt:
  • tiled-drawing/tile-size-unscrollable-expected.txt:
  • tiled-drawing/tile-size-vertically-scrollable-expected.txt:
  • tiled-drawing/tile-size-view-exposed-rect-expected.txt:
  • tiled-drawing/tiled-backing-in-window-expected.txt: Added.
  • tiled-drawing/tiled-backing-in-window.html: Added.
  • tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt:
  • tiled-drawing/tiled-drawing-zoom-expected.txt:
  • tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt:
  • tiled-drawing/use-tiled-drawing-expected.txt:
  • tiled-drawing/visible-rect-content-inset-expected.txt:
Location:
trunk
Files:
2 added
83 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r211661 r211662  
     12017-02-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Correctly set the "inWindow" flag for TileControllers that aren't the page tiles, and clarify "usingTiledBacking" logic
     4        https://bugs.webkit.org/show_bug.cgi?id=167774
     5
     6        Reviewed by Tim Horton.
     7       
     8        Rebase to include the "in window" output.
     9       
     10        tiled-drawing/background-transparency-toggle.html was sensitive to the length of the output, so give the body
     11        a fixed size.
     12
     13        * compositing/tiling/offscreen-tiled-layer-expected.txt:
     14        * compositing/tiling/transform-origin-tiled-expected.txt:
     15        * platform/mac-wk1/compositing/tiling/offscreen-tiled-layer-expected.txt:
     16        * platform/mac-wk1/compositing/tiling/transform-origin-tiled-expected.txt:
     17        * platform/mac-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt:
     18        * platform/mac-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
     19        * platform/mac-wk2/compositing/tiling/tile-cache-zoomed-expected.txt:
     20        * platform/mac-wk2/compositing/tiling/tiled-layer-resize-expected.txt:
     21        * platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
     22        * platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
     23        * platform/mac/compositing/tiling/tiled-layer-resize-expected.txt:
     24        * tiled-drawing/background-transparency-toggle-expected.txt:
     25        * tiled-drawing/background-transparency-toggle.html:
     26        * tiled-drawing/scrolling/fast-scroll-div-latched-div-expected.txt:
     27        * tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler-expected.txt:
     28        * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-expected.txt:
     29        * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler-expected.txt:
     30        * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt:
     31        * tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt:
     32        * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-expected.txt:
     33        * tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt:
     34        * tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-expected.txt:
     35        * tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler-expected.txt:
     36        * tiled-drawing/scrolling/fast-scroll-select-latched-select-expected.txt:
     37        * tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler-expected.txt:
     38        * tiled-drawing/scrolling/fixed-background/fixed-background-no-image-expected.txt:
     39        * tiled-drawing/scrolling/fixed-background/fixed-body-background-body-layer-expected.txt:
     40        * tiled-drawing/scrolling/fixed-background/fixed-body-background-expected.txt:
     41        * tiled-drawing/scrolling/fixed-background/fixed-body-background-opacity-expected.txt:
     42        * tiled-drawing/scrolling/fixed-background/fixed-body-background-positioned-expected.txt:
     43        * tiled-drawing/scrolling/fixed-background/fixed-body-background-transformed-expected.txt:
     44        * tiled-drawing/scrolling/fixed-background/fixed-body-background-zoomed-expected.txt:
     45        * tiled-drawing/scrolling/fixed-background/fixed-html-background-expected.txt:
     46        * tiled-drawing/scrolling/fixed-background/fixed-non-propagated-body-background-expected.txt:
     47        * tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt:
     48        * tiled-drawing/simple-document-with-margin-tiles-expected.txt:
     49        * tiled-drawing/tile-coverage-after-scroll-expected.txt:
     50        * tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt:
     51        * tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:
     52        * tiled-drawing/tile-coverage-slow-scrolling-expected.txt:
     53        * tiled-drawing/tile-coverage-speculative-expected.txt:
     54        * tiled-drawing/tile-coverage-view-exposed-rect-expected.txt:
     55        * tiled-drawing/tile-size-both-scrollable-expected.txt:
     56        * tiled-drawing/tile-size-horizontally-scrollable-expected.txt:
     57        * tiled-drawing/tile-size-slow-zoomed-expected.txt:
     58        * tiled-drawing/tile-size-unscrollable-expected.txt:
     59        * tiled-drawing/tile-size-vertically-scrollable-expected.txt:
     60        * tiled-drawing/tile-size-view-exposed-rect-expected.txt:
     61        * tiled-drawing/tiled-backing-in-window-expected.txt: Added.
     62        * tiled-drawing/tiled-backing-in-window.html: Added.
     63        * tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt:
     64        * tiled-drawing/tiled-drawing-zoom-expected.txt:
     65        * tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt:
     66        * tiled-drawing/use-tiled-drawing-expected.txt:
     67        * tiled-drawing/visible-rect-content-inset-expected.txt:
     68
    1692017-02-03  Zalan Bujtas  <zalan@apple.com>
    270
  • trunk/LayoutTests/compositing/tiling/offscreen-tiled-layer-expected.txt

    r203261 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile 0, 0 tiles grid 2 x 2)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    3132          (tile size 512 x 512)
    3233          (top left tile 0, 0 tiles grid 0 x 0)
     34          (in window 1)
    3335        )
    3436      )
  • trunk/LayoutTests/compositing/tiling/transform-origin-tiled-expected.txt

    r183354 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile 0, 0 tiles grid 2 x 2)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    4950                  (tile size 512 x 512)
    5051                  (top left tile 2, 0 tiles grid 2 x 1)
     52                  (in window 1)
    5153                )
    5254              )
  • trunk/LayoutTests/platform/ios-simulator-wk2/compositing/tiling/offscreen-tiled-layer-expected.txt

    r203261 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile 0, 0 tiles grid 2 x 2)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    3132          (tile size 512 x 512)
    3233          (top left tile 0, 0 tiles grid 0 x 0)
     34          (in window 1)
    3335        )
    3436      )
  • trunk/LayoutTests/platform/ios-simulator-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt

    r198502 r211662  
    1717      (tile size 800 x 600)
    1818      (top left tile 0, 0 tiles grid 1 x 1)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    5051                  (tile size 512 x 512)
    5152                  (top left tile 0, 0 tiles grid 6 x 1)
     53                  (in window 1)
    5254                )
    5355              )
  • trunk/LayoutTests/platform/ios-simulator-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt

    r198502 r211662  
    1717      (tile size 800 x 600)
    1818      (top left tile 0, 0 tiles grid 1 x 1)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    5758                      (tile size 512 x 512)
    5859                      (top left tile 0, 0 tiles grid 6 x 1)
     60                      (in window 1)
    5961                    )
    6062                  )
  • trunk/LayoutTests/platform/ios-simulator-wk2/compositing/tiling/tile-cache-zoomed-expected.txt

    r183356 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile 0, 0 tiles grid 2 x 2)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
  • trunk/LayoutTests/platform/ios-simulator-wk2/compositing/tiling/tiled-layer-resize-expected.txt

    r177052 r211662  
    1010      (tile size 512 x 512)
    1111      (top left tile 0, 0 tiles grid 2 x 2)
     12      (in window 1)
    1213      (children 1
    1314        (GraphicsLayer
     
    2021          (tile size 512 x 512)
    2122          (top left tile 0, 0 tiles grid 2 x 2)
     23          (in window 1)
    2224        )
    2325      )
  • trunk/LayoutTests/platform/ios-simulator-wk2/compositing/tiling/transform-origin-tiled-expected.txt

    r198502 r211662  
    1717      (tile size 800 x 600)
    1818      (top left tile 0, 0 tiles grid 1 x 1)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    4950                  (tile size 512 x 512)
    5051                  (top left tile 2, 0 tiles grid 2 x 1)
     52                  (in window 1)
    5153                )
    5254              )
  • trunk/LayoutTests/platform/mac-wk1/compositing/tiling/offscreen-tiled-layer-expected.txt

    r203261 r211662  
    2828          (tile size 512 x 512)
    2929          (top left tile 0, 0 tiles grid 0 x 0)
     30          (in window 1)
    3031        )
    3132      )
  • trunk/LayoutTests/platform/mac-wk1/compositing/tiling/transform-origin-tiled-expected.txt

    r183355 r211662  
    4646                  (tile size 512 x 512)
    4747                  (top left tile 2, 0 tiles grid 2 x 1)
     48                  (in window 1)
    4849                )
    4950              )
  • trunk/LayoutTests/platform/mac-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt

    r183354 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile 0, 0 tiles grid 2 x 2)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    5051                  (tile size 512 x 512)
    5152                  (top left tile 0, 0 tiles grid 6 x 1)
     53                  (in window 1)
    5254                )
    5355              )
  • trunk/LayoutTests/platform/mac-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt

    r183354 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile 0, 0 tiles grid 2 x 2)
     19      (in window 1)
    1920      (children 1
    2021        (GraphicsLayer
     
    5758                      (tile size 512 x 512)
    5859                      (top left tile 0, 0 tiles grid 6 x 1)
     60                      (in window 1)
    5961                    )
    6062                  )
  • trunk/LayoutTests/platform/mac-wk2/compositing/tiling/tile-cache-zoomed-expected.txt

    r183354 r211662  
    1919      (tile size 512 x 512)
    2020      (top left tile 0, 0 tiles grid 2 x 2)
     21      (in window 1)
    2122      (children 1
    2223        (GraphicsLayer
  • trunk/LayoutTests/platform/mac-wk2/compositing/tiling/tiled-layer-resize-expected.txt

    r168244 r211662  
    1010      (tile size 512 x 512)
    1111      (top left tile 0, 0 tiles grid 2 x 2)
     12      (in window 1)
    1213      (children 1
    1314        (GraphicsLayer
     
    2021          (tile size 512 x 512)
    2122          (top left tile 0, 0 tiles grid 2 x 2)
     23          (in window 1)
    2224        )
    2325      )
  • trunk/LayoutTests/platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt

    r183354 r211662  
    4747                  (tile size 512 x 512)
    4848                  (top left tile 0, 0 tiles grid 6 x 1)
     49                  (in window 1)
    4950                )
    5051              )
  • trunk/LayoutTests/platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt

    r183354 r211662  
    5454                      (tile size 512 x 512)
    5555                      (top left tile 0, 0 tiles grid 6 x 1)
     56                      (in window 1)
    5657                    )
    5758                  )
  • trunk/LayoutTests/platform/mac/compositing/tiling/tiled-layer-resize-expected.txt

    r180441 r211662  
    1717          (tile size 512 x 512)
    1818          (top left tile 0, 0 tiles grid 2 x 2)
     19          (in window 1)
    1920        )
    2021      )
  • trunk/LayoutTests/tiled-drawing/background-transparency-toggle-expected.txt

    r197594 r211662  
    33(GraphicsLayer
    44  (anchor 0.00 0.00)
    5   (bounds 800.00 600.00)
     5  (bounds 785.00 1024.00)
    66  (children 1
    77    (GraphicsLayer
    8       (bounds 800.00 600.00)
     8      (bounds 785.00 1024.00)
    99      (contentsOpaque 1)
    10       (tile cache coverage 0, 0 800 x 600)
    11       (tile size 800 x 600)
    12       (top left tile 0, 0 tiles grid 1 x 1)
     10      (tile cache coverage 0, 0 785 x 1024)
     11      (tile size 785 x 512)
     12      (top left tile 0, 0 tiles grid 1 x 2)
     13      (in window 1)
    1314    )
    1415  )
     
    1617(GraphicsLayer
    1718  (anchor 0.00 0.00)
    18   (bounds 800.00 600.00)
     19  (bounds 785.00 1024.00)
    1920  (children 1
    2021    (GraphicsLayer
    21       (bounds 800.00 600.00)
     22      (bounds 785.00 1024.00)
    2223      (backgroundColor #00000033)
    23       (tile cache coverage 0, 0 800 x 600)
    24       (tile size 800 x 600)
    25       (top left tile 0, 0 tiles grid 1 x 1)
     24      (tile cache coverage 0, 0 785 x 1024)
     25      (tile size 785 x 512)
     26      (top left tile 0, 0 tiles grid 1 x 2)
     27      (in window 1)
    2628    )
    2729  )
     
    2931(GraphicsLayer
    3032  (anchor 0.00 0.00)
    31   (bounds 800.00 600.00)
     33  (bounds 785.00 1024.00)
    3234  (children 1
    3335    (GraphicsLayer
    34       (bounds 800.00 600.00)
     36      (bounds 785.00 1024.00)
    3537      (contentsOpaque 1)
    36       (tile cache coverage 0, 0 800 x 600)
    37       (tile size 800 x 600)
    38       (top left tile 0, 0 tiles grid 1 x 1)
     38      (tile cache coverage 0, 0 785 x 1024)
     39      (tile size 785 x 512)
     40      (top left tile 0, 0 tiles grid 1 x 2)
     41      (in window 1)
    3942    )
    4043  )
     
    4245(GraphicsLayer
    4346  (anchor 0.00 0.00)
    44   (bounds 785.00 648.00)
     47  (bounds 785.00 1024.00)
    4548  (children 1
    4649    (GraphicsLayer
    47       (bounds 785.00 648.00)
     50      (bounds 785.00 1024.00)
    4851      (contentsOpaque 1)
    49       (tile cache coverage 0, 0 785 x 600)
    50       (tile size 800 x 600)
    51       (top left tile 0, 0 tiles grid 1 x 1)
     52      (tile cache coverage 0, 0 785 x 1024)
     53      (tile size 785 x 512)
     54      (top left tile 0, 0 tiles grid 1 x 2)
     55      (in window 1)
    5256    )
    5357  )
  • trunk/LayoutTests/tiled-drawing/background-transparency-toggle.html

    r187905 r211662  
    66        body {
    77            background-color: white;
     8            height: 1000px;
    89        }
    910       
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-div-expected.txt

    r187905 r211662  
    7272      (tile size 512 x 512)
    7373      (top left tile 0, 0 tiles grid 4 x 4)
     74      (in window 1)
    7475    )
    7576  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler-expected.txt

    r187905 r211662  
    7272      (tile size 512 x 512)
    7373      (top left tile 0, 0 tiles grid 4 x 4)
     74      (in window 1)
    7475    )
    7576  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-expected.txt

    r187905 r211662  
    7272      (tile size 512 x 512)
    7373      (top left tile 0, 0 tiles grid 4 x 4)
     74      (in window 1)
    7475    )
    7576  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler-expected.txt

    r187905 r211662  
    7373      (tile size 512 x 512)
    7474      (top left tile 0, 0 tiles grid 4 x 4)
     75      (in window 1)
    7576    )
    7677  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-expected.txt

    r197594 r211662  
    2828      (tile size 785 x 512)
    2929      (top left tile 0, 0 tiles grid 1 x 4)
     30      (in window 1)
    3031    )
    3132  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler-expected.txt

    r197594 r211662  
    2828      (tile size 785 x 512)
    2929      (top left tile 0, 0 tiles grid 1 x 4)
     30      (in window 1)
    3031    )
    3132  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-expected.txt

    r197594 r211662  
    2828      (tile size 785 x 512)
    2929      (top left tile 0, 0 tiles grid 1 x 4)
     30      (in window 1)
    3031    )
    3132  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler-expected.txt

    r197594 r211662  
    2828      (tile size 785 x 512)
    2929      (top left tile 0, 0 tiles grid 1 x 4)
     30      (in window 1)
    3031    )
    3132  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-expected.txt

    r187905 r211662  
    3030      (tile size 512 x 512)
    3131      (top left tile 0, 0 tiles grid 4 x 4)
     32      (in window 1)
    3233    )
    3334  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler-expected.txt

    r187905 r211662  
    3030      (tile size 512 x 512)
    3131      (top left tile 0, 0 tiles grid 4 x 4)
     32      (in window 1)
    3233    )
    3334  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-select-expected.txt

    r187905 r211662  
    3232      (tile size 512 x 512)
    3333      (top left tile 0, 0 tiles grid 4 x 4)
     34      (in window 1)
    3435    )
    3536  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler-expected.txt

    r188793 r211662  
    3232      (tile size 512 x 512)
    3333      (top left tile 0, 0 tiles grid 4 x 4)
     34      (in window 1)
    3435    )
    3536  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-background-no-image-expected.txt

    r197594 r211662  
    99      (tile size 785 x 512)
    1010      (top left tile 0, 0 tiles grid 1 x 2)
     11      (in window 1)
    1112    )
    1213  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-body-background-body-layer-expected.txt

    r197594 r211662  
    1919          (tile size 785 x 512)
    2020          (top left tile 0, 0 tiles grid 1 x 2)
     21          (in window 1)
    2122        )
    2223      )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-body-background-expected.txt

    r197594 r211662  
    1919          (tile size 785 x 512)
    2020          (top left tile 0, 0 tiles grid 1 x 2)
     21          (in window 1)
    2122        )
    2223      )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-body-background-opacity-expected.txt

    r197594 r211662  
    1919          (tile size 785 x 512)
    2020          (top left tile 0, 0 tiles grid 1 x 2)
     21          (in window 1)
    2122        )
    2223      )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-body-background-positioned-expected.txt

    r197594 r211662  
    1919          (tile size 785 x 512)
    2020          (top left tile 0, 0 tiles grid 1 x 2)
     21          (in window 1)
    2122        )
    2223      )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-body-background-transformed-expected.txt

    r187905 r211662  
    1919          (tile size 512 x 512)
    2020          (top left tile 0, 0 tiles grid 2 x 2)
     21          (in window 1)
    2122        )
    2223      )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-body-background-zoomed-expected.txt

    r209409 r211662  
    2020          (tile size 512 x 512)
    2121          (top left tile 0, 0 tiles grid 2 x 3)
     22          (in window 1)
    2223        )
    2324      )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-html-background-expected.txt

    r197594 r211662  
    1919          (tile size 785 x 512)
    2020          (top left tile 0, 0 tiles grid 1 x 2)
     21          (in window 1)
    2122        )
    2223      )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed-background/fixed-non-propagated-body-background-expected.txt

    r197594 r211662  
    1010      (tile size 785 x 512)
    1111      (top left tile 0, 0 tiles grid 1 x 2)
     12      (in window 1)
    1213    )
    1314  )
  • trunk/LayoutTests/tiled-drawing/scrolling/fixed/four-bars-zoomed-expected.txt

    r209409 r211662  
    5050      (tile size 785 x 512)
    5151      (top left tile 0, 0 tiles grid 1 x 2)
     52      (in window 1)
    5253      (children 4
    5354        (GraphicsLayer
  • trunk/LayoutTests/tiled-drawing/simple-document-with-margin-tiles-expected.txt

    r194607 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile -1, -1 tiles grid 4 x 4)
     19      (in window 1)
    1920    )
    2021  )
  • trunk/LayoutTests/tiled-drawing/tile-coverage-after-scroll-expected.txt

    r197594 r211662  
    1717      (tile size 785 x 512)
    1818      (top left tile 0, 5 tiles grid 1 x 3)
     19      (in window 1)
    1920    )
    2021  )
  • trunk/LayoutTests/tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt

    r197594 r211662  
    1717      (tile size 785 x 512)
    1818      (top left tile 0, 5 tiles grid 1 x 3)
     19      (in window 1)
    1920    )
    2021  )
  • trunk/LayoutTests/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt

    r197594 r211662  
    1717      (tile size 785 x 512)
    1818      (top left tile 0, 8 tiles grid 1 x 2)
     19      (in window 1)
    1920    )
    2021  )
  • trunk/LayoutTests/tiled-drawing/tile-coverage-slow-scrolling-expected.txt

    r197594 r211662  
    1717      (tile size 800 x 600)
    1818      (top left tile 0, 0 tiles grid 1 x 1)
     19      (in window 1)
    1920    )
    2021  )
  • trunk/LayoutTests/tiled-drawing/tile-coverage-speculative-expected.txt

    r197594 r211662  
    1717      (tile size 785 x 512)
    1818      (top left tile 0, 0 tiles grid 1 x 2)
     19      (in window 1)
    1920    )
    2021  )
  • trunk/LayoutTests/tiled-drawing/tile-coverage-view-exposed-rect-expected.txt

    r199200 r211662  
    99      (tile size 512 x 512)
    1010      (top left tile 0, 2 tiles grid 2 x 1)
     11      (in window 1)
    1112    )
    1213  )
  • trunk/LayoutTests/tiled-drawing/tile-size-both-scrollable-expected.txt

    r197541 r211662  
    99      (tile size 512 x 512)
    1010      (top left tile 0, 0 tiles grid 2 x 2)
     11      (in window 1)
    1112    )
    1213  )
  • trunk/LayoutTests/tiled-drawing/tile-size-horizontally-scrollable-expected.txt

    r197541 r211662  
    99      (tile size 512 x 512)
    1010      (top left tile 0, 0 tiles grid 2 x 2)
     11      (in window 1)
    1112    )
    1213  )
  • trunk/LayoutTests/tiled-drawing/tile-size-slow-zoomed-expected.txt

    r187905 r211662  
    1919      (tile size 512 x 512)
    2020      (top left tile 0, 0 tiles grid 2 x 2)
     21      (in window 1)
    2122    )
    2223  )
  • trunk/LayoutTests/tiled-drawing/tile-size-unscrollable-expected.txt

    r197594 r211662  
    99      (tile size 800 x 600)
    1010      (top left tile 0, 0 tiles grid 1 x 1)
     11      (in window 1)
    1112    )
    1213  )
  • trunk/LayoutTests/tiled-drawing/tile-size-vertically-scrollable-expected.txt

    r197594 r211662  
    99      (tile size 785 x 512)
    1010      (top left tile 0, 0 tiles grid 1 x 2)
     11      (in window 1)
    1112    )
    1213  )
  • trunk/LayoutTests/tiled-drawing/tile-size-view-exposed-rect-expected.txt

    r199200 r211662  
    99      (tile size 512 x 512)
    1010      (top left tile 0, 0 tiles grid 2 x 1)
     11      (in window 1)
    1112    )
    1213  )
  • trunk/LayoutTests/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt

    r187905 r211662  
    1919      (tile size 512 x 512)
    2020      (top left tile 1, 0 tiles grid 4 x 5)
     21      (in window 1)
    2122    )
    2223  )
  • trunk/LayoutTests/tiled-drawing/tiled-drawing-zoom-expected.txt

    r187905 r211662  
    1919      (tile size 512 x 512)
    2020      (top left tile 0, 0 tiles grid 2 x 2)
     21      (in window 1)
    2122    )
    2223  )
  • trunk/LayoutTests/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt

    r187905 r211662  
    1919      (tile size 512 x 512)
    2020      (top left tile 3, 4 tiles grid 3 x 2)
     21      (in window 1)
    2122    )
    2223  )
  • trunk/LayoutTests/tiled-drawing/use-tiled-drawing-expected.txt

    r187905 r211662  
    1717      (tile size 512 x 512)
    1818      (top left tile 0, 0 tiles grid 2 x 2)
     19      (in window 1)
    1920    )
    2021  )
  • trunk/LayoutTests/tiled-drawing/visible-rect-content-inset-expected.txt

    r197594 r211662  
    1818      (tile size 800 x 512)
    1919      (top left tile 0, 0 tiles grid 1 x 1)
     20      (in window 1)
    2021    )
    2122  )
  • trunk/Source/WebCore/ChangeLog

    r211661 r211662  
     12017-02-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Correctly set the "inWindow" flag for TileControllers that aren't the page tiles, and clarify "usingTiledBacking" logic
     4        https://bugs.webkit.org/show_bug.cgi?id=167774
     5
     6        Reviewed by Tim Horton.
     7
     8        RenderLayerBacking had some very confusing "usingTiledCacheLayer" uses.
     9
     10        Its member variable, m_usingTiledCacheLayer, really meant "m_isMainFrameLayerWithTiledBacking" so make it so.
     11        It had a usingTiledBacking(), which returned the same thing, which this patch replaces with isMainFrameLayerWithTiledBacking().
     12
     13        The fact that usingTiledBacking() was only true for the page tiled layer tripped up
     14        RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants(), which would only ever call setIsInWindow()
     15        on the page tiled layer. These changes fix that.
     16
     17        Also make a way for tests to unparent the web view via UIScriptController, and dump out the "in window"
     18        status of TileBackings when dumping tile caches.
     19
     20        Test: tiled-drawing/tiled-backing-in-window.html
     21
     22        * platform/graphics/TiledBacking.h:
     23        * platform/graphics/ca/GraphicsLayerCA.cpp:
     24        (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
     25        * platform/graphics/ca/TileController.h:
     26        * rendering/RenderLayerBacking.cpp:
     27        (WebCore::RenderLayerBacking::RenderLayerBacking):
     28        (WebCore::computePageTiledBackingCoverage):
     29        (WebCore::RenderLayerBacking::adjustTiledBackingCoverage):
     30        (WebCore::RenderLayerBacking::setTiledBackingHasMargins):
     31        (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
     32        (WebCore::RenderLayerBacking::shouldClipCompositedBounds):
     33        (WebCore::RenderLayerBacking::updateDescendantClippingLayer):
     34        (WebCore::RenderLayerBacking::updateRootLayerConfiguration):
     35        (WebCore::RenderLayerBacking::paintsIntoWindow):
     36        (WebCore::computeTileCoverage): Deleted.
     37        * rendering/RenderLayerBacking.h:
     38        * rendering/RenderLayerCompositor.cpp:
     39        (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
     40        (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
     41        (WebCore::RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants):
     42        (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing):
     43        (WebCore::RenderLayerCompositor::documentUsesTiledBacking):
     44
    1452017-02-03  Zalan Bujtas  <zalan@apple.com>
    246
  • trunk/Source/WebCore/platform/graphics/TiledBacking.h

    r208985 r211662  
    9898
    9999    virtual void setIsInWindow(bool) = 0;
     100    virtual bool isInWindow() const = 0;
    100101
    101102    enum {
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r211305 r211662  
    35073507        writeIndent(textStream, indent + 1);
    35083508        textStream << "(top left tile " << gridExtent.x() << ", " << gridExtent.y() << " tiles grid " << gridExtent.width() << " x " << gridExtent.height() << ")\n";
     3509
     3510        writeIndent(textStream, indent + 1);
     3511        textStream << "(in window " << tiledBacking()->isInWindow() << ")\n";
    35093512    }
    35103513   
  • trunk/Source/WebCore/platform/graphics/ca/TileController.h

    r208985 r211662  
    137137    void scheduleTileRevalidation(double interval);
    138138
    139     bool isInWindow() const { return m_isInWindow; }
    140139    float topContentInset() const { return m_topContentInset; }
    141140
     
    151150    void prepopulateRect(const FloatRect&) override;
    152151    void setIsInWindow(bool) override;
     152    bool isInWindow() const override { return m_isInWindow; }
    153153    void setTileCoverage(TileCoverage) override;
    154154    void revalidateTiles() override;
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r211387 r211662  
    9494RenderLayerBacking::RenderLayerBacking(RenderLayer& layer)
    9595    : m_owningLayer(layer)
    96     , m_viewportConstrainedNodeID(0)
    97     , m_scrollingNodeID(0)
    98     , m_artificiallyInflatedBounds(false)
    99     , m_isMainFrameRenderViewLayer(false)
    100     , m_usingTiledCacheLayer(false)
    101     , m_requiresOwnBackingStore(true)
    102     , m_canCompositeFilters(false)
    103 #if ENABLE(FILTERS_LEVEL_2)
    104     , m_canCompositeBackdropFilters(false)
    105 #endif
    106     , m_backgroundLayerPaintsFixedRootBackground(false)
    10796{
    10897    if (layer.isRootLayer()) {
    10998        m_isMainFrameRenderViewLayer = renderer().frame().isMainFrame();
    110         m_usingTiledCacheLayer = renderer().page().chrome().client().shouldUseTiledBackingForFrameView(renderer().view().frameView());
     99        m_isMainFrameLayerWithTiledBacking = renderer().page().chrome().client().shouldUseTiledBackingForFrameView(renderer().view().frameView());
    111100    }
    112101   
    113102    createPrimaryGraphicsLayer();
    114103
    115     if (m_usingTiledCacheLayer) {
    116         TiledBacking* tiledBacking = this->tiledBacking();
    117 
     104    if (TiledBacking* tiledBacking = this->tiledBacking()) {
    118105        tiledBacking->setIsInWindow(renderer().page().isInWindow());
    119106
    120         if (m_isMainFrameRenderViewLayer)
     107        if (m_isMainFrameLayerWithTiledBacking) {
    121108            tiledBacking->setUnparentsOffscreenTiles(true);
    122 
    123         tiledBacking->setScrollingPerformanceLoggingEnabled(renderer().settings().scrollingPerformanceLoggingEnabled());
    124         adjustTiledBackingCoverage();
     109            tiledBacking->setScrollingPerformanceLoggingEnabled(renderer().settings().scrollingPerformanceLoggingEnabled());
     110            adjustTiledBackingCoverage();
     111        }
    125112    }
    126113}
     
    198185}
    199186
    200 static TiledBacking::TileCoverage computeTileCoverage(RenderLayerBacking* backing)
     187static TiledBacking::TileCoverage computePageTiledBackingCoverage(RenderLayerBacking* backing)
    201188{
    202189    // FIXME: When we use TiledBacking for overflow, this should look at RenderView scrollability.
     
    218205void RenderLayerBacking::adjustTiledBackingCoverage()
    219206{
    220     if (!m_usingTiledCacheLayer)
     207    if (!m_isMainFrameLayerWithTiledBacking)
    221208        return;
    222209
    223     TiledBacking::TileCoverage tileCoverage = computeTileCoverage(this);
     210    TiledBacking::TileCoverage tileCoverage = computePageTiledBackingCoverage(this);
    224211    tiledBacking()->setTileCoverage(tileCoverage);
    225212}
     
    227214void RenderLayerBacking::setTiledBackingHasMargins(bool hasExtendedBackgroundOnLeftAndRight, bool hasExtendedBackgroundOnTopAndBottom)
    228215{
    229     if (!m_usingTiledCacheLayer)
     216    if (!m_isMainFrameLayerWithTiledBacking)
    230217        return;
    231218
     
    285272        layerName.append("...");
    286273    }
    287     m_graphicsLayer = createGraphicsLayer(layerName, m_usingTiledCacheLayer ? GraphicsLayer::Type::PageTiledBacking : GraphicsLayer::Type::Normal);
    288 
    289     if (m_usingTiledCacheLayer) {
    290         m_childContainmentLayer = createGraphicsLayer("TiledBacking containment");
     274    m_graphicsLayer = createGraphicsLayer(layerName, m_isMainFrameLayerWithTiledBacking ? GraphicsLayer::Type::PageTiledBacking : GraphicsLayer::Type::Normal);
     275
     276    if (m_isMainFrameLayerWithTiledBacking) {
     277        m_childContainmentLayer = createGraphicsLayer("Page TiledBacking containment");
    291278        m_graphicsLayer->addChild(m_childContainmentLayer.get());
    292279    }
     
    469456#endif
    470457
    471     if (m_usingTiledCacheLayer)
     458    if (m_isMainFrameLayerWithTiledBacking)
    472459        return false;
    473460
     
    13281315
    13291316    if (needsDescendantClip) {
    1330         if (!m_childContainmentLayer && !m_usingTiledCacheLayer) {
     1317        if (!m_childContainmentLayer && !m_isMainFrameLayerWithTiledBacking) {
    13311318            m_childContainmentLayer = createGraphicsLayer("child clipping");
    13321319            m_childContainmentLayer->setMasksToBounds(true);
     
    18291816void RenderLayerBacking::updateRootLayerConfiguration()
    18301817{
    1831     if (!m_usingTiledCacheLayer)
     1818    if (!m_isMainFrameLayerWithTiledBacking)
    18321819        return;
    18331820
     
    22172204#endif
    22182205
    2219     if (m_usingTiledCacheLayer)
     2206    if (m_isMainFrameLayerWithTiledBacking)
    22202207        return false;
    22212208
  • trunk/Source/WebCore/rendering/RenderLayerBacking.h

    r208668 r211662  
    8888
    8989    // Layer to clip children
    90     bool hasClippingLayer() const { return (m_childContainmentLayer && !m_usingTiledCacheLayer); }
    91     GraphicsLayer* clippingLayer() const { return !m_usingTiledCacheLayer ? m_childContainmentLayer.get() : nullptr; }
     90    bool hasClippingLayer() const { return (m_childContainmentLayer && !m_isMainFrameLayerWithTiledBacking); }
     91    GraphicsLayer* clippingLayer() const { return !m_isMainFrameLayerWithTiledBacking ? m_childContainmentLayer.get() : nullptr; }
    9292
    9393    // Layer to get clipped by ancestor
     
    182182    bool hasUnpositionedOverflowControlsLayers() const;
    183183
    184     bool usingTiledBacking() const { return m_usingTiledCacheLayer; }
     184    bool isMainFrameLayerWithTiledBacking() const { return m_isMainFrameLayerWithTiledBacking; }
     185
    185186    WEBCORE_EXPORT TiledBacking* tiledBacking() const;
    186187    void adjustTiledBackingCoverage();
     
    331332    bool shouldClipCompositedBounds() const;
    332333
    333     bool hasTiledBackingFlatteningLayer() const { return (m_childContainmentLayer && m_usingTiledCacheLayer); }
    334     GraphicsLayer* tileCacheFlatteningLayer() const { return m_usingTiledCacheLayer ? m_childContainmentLayer.get() : nullptr; }
     334    bool hasTiledBackingFlatteningLayer() const { return (m_childContainmentLayer && m_isMainFrameLayerWithTiledBacking); }
     335    GraphicsLayer* tileCacheFlatteningLayer() const { return m_isMainFrameLayerWithTiledBacking ? m_childContainmentLayer.get() : nullptr; }
    335336
    336337    void paintIntoLayer(const GraphicsLayer*, GraphicsContext&, const IntRect& paintDirtyRect, PaintBehavior, GraphicsLayerPaintingPhase);
     
    364365    std::unique_ptr<GraphicsLayer> m_scrollingContentsLayer; // Only used if the layer is using composited scrolling.
    365366
    366     ScrollingNodeID m_viewportConstrainedNodeID;
    367     ScrollingNodeID m_scrollingNodeID;
    368 
    369367    LayoutRect m_compositedBounds;
    370368    LayoutSize m_subpixelOffsetFromRenderer; // This is the subpixel distance between the primary graphics layer and the associated renderer's bounds.
    371369    LayoutSize m_compositedBoundsOffsetFromGraphicsLayer; // This is the subpixel distance between the primary graphics layer and the render layer bounds.
    372370
    373     bool m_artificiallyInflatedBounds; // bounds had to be made non-zero to make transform-origin work
    374     bool m_isMainFrameRenderViewLayer;
    375     bool m_usingTiledCacheLayer;
    376     bool m_requiresOwnBackingStore;
    377     bool m_canCompositeFilters;
     371    ScrollingNodeID m_viewportConstrainedNodeID { 0 };
     372    ScrollingNodeID m_scrollingNodeID { 0 };
     373
     374    bool m_artificiallyInflatedBounds { false }; // bounds had to be made non-zero to make transform-origin work
     375    bool m_isMainFrameRenderViewLayer { false };
     376    bool m_isMainFrameLayerWithTiledBacking { false };
     377    bool m_requiresOwnBackingStore { true };
     378    bool m_canCompositeFilters { false };
    378379#if ENABLE(FILTERS_LEVEL_2)
    379     bool m_canCompositeBackdropFilters;
    380 #endif
    381     bool m_backgroundLayerPaintsFixedRootBackground;
     380    bool m_canCompositeBackdropFilters { false };
     381#endif
     382    bool m_backgroundLayerPaintsFixedRootBackground { false };
    382383};
    383384
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r211541 r211662  
    441441#if PLATFORM(IOS)
    442442        FloatRect exposedRect = frameView.exposedContentRect();
    443         LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " flushPendingLayerChanges (root " << isFlushRoot << ") exposedRect " << exposedRect);
     443        LOG_WITH_STREAM(Compositing, stream << "\nRenderLayerCompositor " << this << " flushPendingLayerChanges (root " << isFlushRoot << ") exposedRect " << exposedRect);
    444444        rootLayer->flushCompositingState(exposedRect);
    445445#else
     
    450450            visibleRect.intersect(frameView.viewExposedRect().value());
    451451
    452         LOG_WITH_STREAM(Compositing,  stream << "RenderLayerCompositor " << this << " flushPendingLayerChanges(" << isFlushRoot << ") " << visibleRect);
     452        LOG_WITH_STREAM(Compositing,  stream << "\nRenderLayerCompositor " << this << " flushPendingLayerChanges(" << isFlushRoot << ") " << visibleRect);
    453453        rootLayer->flushCompositingState(visibleRect);
     454        LOG_WITH_STREAM(Compositing,  stream << "RenderLayerCompositor " << this << " flush complete\n");
    454455#endif
    455456    }
     
    17601761{
    17611762    RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();
    1762     if (renderViewBacking && renderViewBacking->usingTiledBacking())
     1763    if (renderViewBacking && renderViewBacking->isMainFrameLayerWithTiledBacking())
    17631764        setCompositingLayersNeedRebuild();
    17641765}
     
    20292030void RenderLayerCompositor::setIsInWindowForLayerIncludingDescendants(RenderLayer& layer, bool isInWindow)
    20302031{
    2031     if (layer.isComposited() && layer.backing()->usingTiledBacking())
    2032         layer.backing()->tiledBacking()->setIsInWindow(isInWindow);
     2032    if (layer.isComposited()) {
     2033        if (auto* backing = layer.backing()->tiledBacking())
     2034            backing->setIsInWindow(isInWindow);
     2035    }
    20332036
    20342037    // No need to recurse if we don't have any other tiled layers.
    2035     if (hasNonMainLayersWithTiledBacking())
     2038    if (!hasNonMainLayersWithTiledBacking())
    20362039        return;
    20372040
     
    28432846{
    28442847    RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();
    2845     return renderViewBacking && renderViewBacking->usingTiledBacking();
     2848    return renderViewBacking && renderViewBacking->isMainFrameLayerWithTiledBacking();
    28462849}
    28472850
     
    29482951        return false;
    29492952
    2950     return backing->usingTiledBacking();
     2953    return backing->isMainFrameLayerWithTiledBacking();
    29512954}
    29522955
  • trunk/Tools/ChangeLog

    r211657 r211662  
     12017-02-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Correctly set the "inWindow" flag for TileControllers that aren't the page tiles, and clarify "usingTiledBacking" logic
     4        https://bugs.webkit.org/show_bug.cgi?id=167774
     5
     6        Reviewed by Tim Horton.
     7
     8        Implement UIScriptController removeViewFromWindow() and addViewToWindow(), and hook
     9        up for Mac WK1 and WK2, and iOS WK2. It takes a callback because view state updates to the
     10        web process are async, so the callback fires after the web process gets the new state.
     11
     12        * DumpRenderTree/ios/UIScriptControllerIOS.mm:
     13        (WTR::UIScriptController::removeViewFromWindow):
     14        (WTR::UIScriptController::addViewToWindow):
     15        * DumpRenderTree/mac/DumpRenderTree.mm:
     16        (createWebViewAndOffscreenWindow):
     17        (resetWebViewToConsistentStateBeforeTesting):
     18        * DumpRenderTree/mac/DumpRenderTreeMac.h:
     19        * DumpRenderTree/mac/UIScriptControllerMac.mm:
     20        (WTR::UIScriptController::removeViewFromWindow):
     21        (WTR::UIScriptController::addViewToWindow):
     22        * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
     23        * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
     24        (WTR::UIScriptController::removeViewFromWindow):
     25        (WTR::UIScriptController::addViewToWindow):
     26        * TestRunnerShared/UIScriptContext/UIScriptController.h:
     27        * WebKitTestRunner/PlatformWebView.h:
     28        * WebKitTestRunner/TestController.cpp:
     29        (WTR::TestController::resetStateToConsistentValues):
     30        * WebKitTestRunner/ios/PlatformWebViewIOS.mm:
     31        (WTR::PlatformWebView::removeFromWindow):
     32        (WTR::PlatformWebView::addToWindow):
     33        * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
     34        (WTR::UIScriptController::removeViewFromWindow):
     35        (WTR::UIScriptController::addViewToWindow):
     36        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
     37        (WTR::PlatformWebView::removeFromWindow):
     38        (WTR::PlatformWebView::addToWindow):
     39        * WebKitTestRunner/mac/UIScriptControllerMac.mm:
     40        (WTR::UIScriptController::removeViewFromWindow):
     41        (WTR::UIScriptController::addViewToWindow):
     42
    1432017-02-03  Alexey Proskuryakov  <ap@apple.com>
    244
  • trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm

    r211095 r211662  
    299299}
    300300
     301void UIScriptController::removeViewFromWindow(JSValueRef)
     302{
     303}
     304
     305void UIScriptController::addViewToWindow(JSValueRef)
     306{
     307}
     308
    301309}
    302310
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm

    r211341 r211662  
    180180RefPtr<TestRunner> gTestRunner;
    181181
    182 WebFrame *mainFrame = nullptr;
     182WebFrame *mainFrame = nil;
    183183// This is the topmost frame that is loading, during a given load, or nil when no load is
    184184// in progress.  Usually this is the same as the main frame, but not always.  In the case
    185185// where a frameset is loaded, and then new content is loaded into one of the child frames,
    186186// that child frame is the "topmost frame that is loading".
    187 WebFrame *topLoadingFrame = nullptr; // !nil iff a load is in progress
    188 
     187WebFrame *topLoadingFrame = nil; // !nil iff a load is in progress
     188
     189#if PLATFORM(MAC)
     190NSWindow *mainWindow = nil;
     191#endif
    189192
    190193CFMutableSetRef disallowedURLs= nullptr;
     
    799802    NSRect windowRect = (showWebView) ? NSOffsetRect(rect, 100, 100) : NSOffsetRect(rect, -10000, [firstScreen frame].size.height - rect.size.height + 10000);
    800803    DumpRenderTreeWindow *window = [[DumpRenderTreeWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
     804    mainWindow = window;
    801805
    802806    [window setColorSpace:[firstScreen colorSpace]];
     
    18421846{
    18431847    WebView *webView = [mainFrame webView];
     1848
     1849#if PLATFORM(MAC)
     1850    if (![webView superview])
     1851        [[mainWindow contentView] addSubview:webView];
     1852#endif
     1853
    18441854#if PLATFORM(IOS)
    18451855    adjustWebDocumentForStandardViewport(gWebBrowserView, gWebScrollView);
  • trunk/Tools/DumpRenderTree/mac/DumpRenderTreeMac.h

    r204931 r211662  
    4949extern DefaultPolicyDelegate *defaultPolicyDelegate;
    5050
     51#if PLATFORM(IOS)
     52OBJC_CLASS UIWindow;
     53extern UIWindow *mainWindow;
     54#else
     55OBJC_CLASS NSWindow;
     56extern NSWindow *mainWindow;
     57#endif
     58
    5159void setWaitToDumpWatchdog(CFRunLoopTimerRef);
    5260bool shouldSetWaitToDumpWatchdog();
  • trunk/Tools/DumpRenderTree/mac/UIScriptControllerMac.mm

    r209931 r211662  
    7171    [webView _scaleWebView:scale atOrigin:NSZeroPoint];
    7272
    73     dispatch_async(dispatch_get_main_queue(), ^ {
     73    dispatch_async(dispatch_get_main_queue(), ^{
    7474        if (!m_context)
    7575            return;
     
    9595}
    9696
     97void UIScriptController::removeViewFromWindow(JSValueRef callback)
     98{
     99    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
     100
     101    WebView *webView = [mainFrame webView];
     102    [webView removeFromSuperview];
     103
     104    dispatch_async(dispatch_get_main_queue(), ^{
     105        if (!m_context)
     106            return;
     107        m_context->asyncTaskComplete(callbackID);
     108    });
     109}
     110
     111void UIScriptController::addViewToWindow(JSValueRef callback)
     112{
     113    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
     114
     115    WebView *webView = [mainFrame webView];
     116    [[mainWindow contentView] addSubview:webView];
     117
     118    dispatch_async(dispatch_get_main_queue(), ^{
     119        if (!m_context)
     120            return;
     121        m_context->asyncTaskComplete(callbackID);
     122    });
     123}
     124
    97125}
    98126
  • trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl

    r211095 r211662  
    2727
    2828    void doAsyncTask(object callback); // Used to test the harness.
     29    void uiScriptComplete(DOMString result);
     30
    2931    void doAfterPresentationUpdate(object callback); // Call the callback after sending a message to the WebProcess and receiving a subsequent update.
    3032    void doAfterNextStablePresentationUpdate(object callback);
     
    214216    readonly attribute DOMString scrollingTreeAsText;
    215217
    216     void uiScriptComplete(DOMString result);
    217 
    218218    void retrieveSpeakSelectionContent(object callback);
    219219    readonly attribute DOMString accessibilitySpeakSelectionContent;
     220
     221    // Unparent and parent the web view, simulating, for example, tab switching.
     222    void removeViewFromWindow(object callback);
     223    void addViewToWindow(object callback);
     224
    220225};
  • trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp

    r211095 r211662  
    388388#endif
    389389
     390#if !PLATFORM(COCOA)
     391
     392void UIScriptController::removeViewFromWindow(JSValueRef)
     393{
     394}
     395
     396void UIScriptController::addViewToWindow(JSValueRef)
     397{
     398}
     399
     400#endif // !PLATFORM(COCOA)
     401
    390402#if !PLATFORM(MAC)
    391403
  • trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h

    r211095 r211662  
    141141    void uiScriptComplete(JSStringRef result);
    142142   
    143     void retrieveSpeakSelectionContent(JSValueRef callback);
     143    void retrieveSpeakSelectionContent(JSValueRef);
    144144    JSRetainPtr<JSStringRef> accessibilitySpeakSelectionContent() const;
     145
     146    // These use a callback to allow the client to know when view visibility state updates get to the web process.
     147    void removeViewFromWindow(JSValueRef);
     148    void addViewToWindow(JSValueRef);
    145149
    146150private:
  • trunk/Tools/WebKitTestRunner/PlatformWebView.h

    r209972 r211662  
    8787    void setWindowIsKey(bool);
    8888    bool windowIsKey() const { return m_windowIsKey; }
     89   
     90    void removeFromWindow();
     91    void addToWindow();
    8992
    9093    bool viewSupportsOptions(const TestOptions&) const;
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r211254 r211662  
    754754#endif
    755755
     756    // Make sure the view is in the window (a test can unparent it).
     757    m_mainWebView->addToWindow();
     758
    756759    // In the case that a test using the chrome input field failed, be sure to clean up for the next test.
    757760    m_mainWebView->removeChromeInputField();
  • trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp

    r209972 r211662  
    130130}
    131131
     132void PlatformWebView::addToWindow()
     133{
     134}
     135
     136void PlatformWebView::removeFromWindow()
     137{
     138}
     139
    132140void PlatformWebView::makeWebViewFirstResponder()
    133141{
  • trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp

    r209972 r211662  
    117117}
    118118
     119void PlatformWebView::addToWindow()
     120{
     121}
     122
     123void PlatformWebView::removeFromWindow()
     124{
     125}
     126
    119127void PlatformWebView::makeWebViewFirstResponder()
    120128{
  • trunk/Tools/WebKitTestRunner/ios/PlatformWebViewIOS.mm

    r209972 r211662  
    167167}
    168168
     169void PlatformWebView::addToWindow()
     170{
     171    [m_window.rootViewController.view addSubview:m_view];
     172}
     173
     174void PlatformWebView::removeFromWindow()
     175{
     176    [m_view removeFromSuperview];
     177}
     178
    169179void PlatformWebView::resizeTo(unsigned width, unsigned height, WebViewSizingMode viewSizingMode)
    170180{
  • trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm

    r211095 r211662  
    537537}
    538538
     539void UIScriptController::removeViewFromWindow(JSValueRef callback)
     540{
     541    TestController::singleton().mainWebView()->removeFromWindow();
     542}
     543
     544void UIScriptController::addViewToWindow(JSValueRef callback)
     545{
     546    TestController::singleton().mainWebView()->addToWindow();
     547}
     548
    539549void UIScriptController::platformSetDidStartFormControlInteractionCallback()
    540550{
  • trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm

    r209972 r211662  
    253253}
    254254
     255void PlatformWebView::addToWindow()
     256{
     257    [[m_window contentView] addSubview:m_view];
     258}
     259
     260void PlatformWebView::removeFromWindow()
     261{
     262    [m_view removeFromSuperview];
     263}
     264
    255265void PlatformWebView::makeWebViewFirstResponder()
    256266{
  • trunk/Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm

    r209931 r211662  
    132132}
    133133
     134void UIScriptController::removeViewFromWindow(JSValueRef callback)
     135{
     136#if WK_API_ENABLED
     137    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
     138
     139    auto* mainWebView = TestController::singleton().mainWebView();
     140    mainWebView->removeFromWindow();
     141
     142    [mainWebView->platformView() _doAfterNextPresentationUpdate: ^ {
     143        if (!m_context)
     144            return;
     145        m_context->asyncTaskComplete(callbackID);
     146    }];
     147#else
     148    UNUSED_PARAM(callback);
     149#endif
     150}
     151
     152void UIScriptController::addViewToWindow(JSValueRef callback)
     153{
     154#if WK_API_ENABLED
     155    unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
     156
     157    auto* mainWebView = TestController::singleton().mainWebView();
     158    mainWebView->addToWindow();
     159
     160    [mainWebView->platformView() _doAfterNextPresentationUpdate: ^ {
     161        if (!m_context)
     162            return;
     163        m_context->asyncTaskComplete(callbackID);
     164    }];
     165#else
     166    UNUSED_PARAM(callback);
     167#endif
     168}
     169
    134170} // namespace WTR
Note: See TracChangeset for help on using the changeset viewer.