https://bugs.webkit.org/show_bug.cgi?id=191725
Reviewed by Alex Christensen.
This test tests the changes made in r238229.
* compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt: Added.
* compositing/iframes/remove-reinsert-webview-with-iframe.html: Added.
* platform/ios/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt: Added.
* platform/mac-wk1/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238271
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2018-11-15 Simon Fraser <simon.fraser@apple.com>
+ Add layout test for iframe contents disappearing on view unparent/reparent
+ https://bugs.webkit.org/show_bug.cgi?id=191725
+
+ Reviewed by Alex Christensen.
+
+ This test tests the changes made in r238229.
+
+ * compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt: Added.
+ * compositing/iframes/remove-reinsert-webview-with-iframe.html: Added.
+ * platform/ios/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt: Added.
+ * platform/mac-wk1/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt: Added.
+
+2018-11-15 Simon Fraser <simon.fraser@apple.com>
+
REGRESSION (r238090) Composited iframes that resize from zero don't show
https://bugs.webkit.org/show_bug.cgi?id=191733
rdar://problem/46107764
--- /dev/null
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (tile cache coverage 0, 0 800 x 600)
+ (tile size 800 x 600)
+ (top left tile 0, 0 tiles grid 1 x 1)
+ (in window 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 520.00 328.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 10.00 10.00)
+ (bounds 404.00 304.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 210.00 210.00)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (tile cache coverage 0, 0 800 x 600)
+ (tile size 800 x 600)
+ (top left tile 0, 0 tiles grid 1 x 1)
+ (in window 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 520.00 328.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 10.00 10.00)
+ (bounds 404.00 304.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 210.00 210.00)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
--- /dev/null
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ iframe {
+ width: 400px;
+ height: 300px;
+ }
+ .composited {
+ transform: translateZ(1px);
+ padding: 10px;
+ width: 500px;
+ }
+
+ .masked {
+ -webkit-mask-image: url(../resources/alpha-gradient.png);
+ -webkit-mask-repeat: repeat-x;
+ }
+ </style>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function geRemoveViewScript()
+ {
+ return `
+ (function() {
+ uiController.removeViewFromWindow(function() {
+ uiController.uiScriptComplete('');
+ });
+ })();`
+ }
+
+ function getReinsertViewScript()
+ {
+ return `
+ (function() {
+ uiController.addViewToWindow(function() {
+ uiController.uiScriptComplete('');
+ });
+ })();`
+ }
+
+ function getLayerTree()
+ {
+ if (window.internals)
+ return internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES);
+
+ return "";
+ }
+
+ function doTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ let beforeLayers = getLayerTree();
+
+ testRunner.runUIScript(geRemoveViewScript(), function(result) {
+
+ testRunner.runUIScript(getReinsertViewScript(), function(result) {
+ let afterLayers = getLayerTree();
+
+ document.getElementById('before-layers').textContent = beforeLayers;
+ document.getElementById('after-layers').textContent = afterLayers;
+
+ testRunner.notifyDone();
+ });
+ });
+ }
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+ <div class="composited">
+ <iframe src="resources/composited-subframe.html"></iframe>
+ </div>
+
+<pre id="before-layers">Layer tree goes here</pre>
+<pre id="after-layers">Layer tree goes here</pre>
+</body>
+</html>
--- /dev/null
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (tile cache coverage 0, 0 800 x 600)
+ (tile size 800 x 600)
+ (top left tile 0, 0 tiles grid 1 x 1)
+ (in window 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 520.00 329.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 10.00 10.00)
+ (bounds 404.00 304.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 210.00 210.00)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (tile cache coverage 0, 0 800 x 600)
+ (tile size 800 x 600)
+ (top left tile 0, 0 tiles grid 1 x 1)
+ (in window 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 520.00 329.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 10.00 10.00)
+ (bounds 404.00 304.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 210.00 210.00)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
--- /dev/null
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 520.00 328.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 10.00 10.00)
+ (bounds 404.00 304.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 210.00 210.00)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 520.00 328.00)
+ (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 1.00 1.00])
+ (children 1
+ (GraphicsLayer
+ (position 10.00 10.00)
+ (bounds 404.00 304.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 400.00 300.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 400.00 300.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 210.00 210.00)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+