Add layout test for iframe contents disappearing on view unparent/reparent
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 05:39:26 +0000 (05:39 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 05:39:26 +0000 (05:39 +0000)
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

LayoutTests/ChangeLog
LayoutTests/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt [new file with mode: 0644]
LayoutTests/compositing/iframes/remove-reinsert-webview-with-iframe.html [new file with mode: 0644]
LayoutTests/platform/ios/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt [new file with mode: 0644]

index f18be00..e996394 100644 (file)
@@ -1,5 +1,19 @@
 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
diff --git a/LayoutTests/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt b/LayoutTests/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt
new file mode 100644 (file)
index 0000000..c984e3b
--- /dev/null
@@ -0,0 +1,126 @@
+
+(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)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/iframes/remove-reinsert-webview-with-iframe.html b/LayoutTests/compositing/iframes/remove-reinsert-webview-with-iframe.html
new file mode 100644 (file)
index 0000000..67597e3
--- /dev/null
@@ -0,0 +1,85 @@
+<!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>
diff --git a/LayoutTests/platform/ios/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt b/LayoutTests/platform/ios/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt
new file mode 100644 (file)
index 0000000..3f5cb63
--- /dev/null
@@ -0,0 +1,126 @@
+
+(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)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/platform/mac-wk1/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt b/LayoutTests/platform/mac-wk1/compositing/iframes/remove-reinsert-webview-with-iframe-expected.txt
new file mode 100644 (file)
index 0000000..b80a990
--- /dev/null
@@ -0,0 +1,118 @@
+
+(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)
+                                    )
+                                  )
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+