Title: [217076] trunk/LayoutTests
Revision
217076
Author
[email protected]
Date
2017-05-18 16:27:37 -0700 (Thu, 18 May 2017)

Log Message

Add a test to ensure that media controls don't trigger composting of ancestors via "isolates blending"
https://bugs.webkit.org/show_bug.cgi?id=172320

Reviewed by Dean Jackson.

Test that makes some source-less and sourced audio and video controls, and dumps
the layer tree to ensure that they didn't trigger compositing on their ancestor
stacking context element.

* media/controls-should-not-trigger-isolates-blending-expected.txt: Added.
* media/controls-should-not-trigger-isolates-blending.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (217075 => 217076)


--- trunk/LayoutTests/ChangeLog	2017-05-18 23:22:16 UTC (rev 217075)
+++ trunk/LayoutTests/ChangeLog	2017-05-18 23:27:37 UTC (rev 217076)
@@ -1,3 +1,17 @@
+2017-05-18  Simon Fraser  <[email protected]>
+
+        Add a test to ensure that media controls don't trigger composting of ancestors via "isolates blending"
+        https://bugs.webkit.org/show_bug.cgi?id=172320
+
+        Reviewed by Dean Jackson.
+
+        Test that makes some source-less and sourced audio and video controls, and dumps
+        the layer tree to ensure that they didn't trigger compositing on their ancestor
+        stacking context element.
+
+        * media/controls-should-not-trigger-isolates-blending-expected.txt: Added.
+        * media/controls-should-not-trigger-isolates-blending.html: Added.
+
 2017-05-18  Dean Jackson  <[email protected]>
 
         Transform misplaces element 50% of the time

Added: trunk/LayoutTests/media/controls-should-not-trigger-isolates-blending-expected.txt (0 => 217076)


--- trunk/LayoutTests/media/controls-should-not-trigger-isolates-blending-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/controls-should-not-trigger-isolates-blending-expected.txt	2017-05-18 23:27:37 UTC (rev 217076)
@@ -0,0 +1,13 @@
+Tests that media controls don't trigger compositing on an ancestor via isolatesBlending
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS containsLayerWithSize(layers, 456, 50) is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+
+

Added: trunk/LayoutTests/media/controls-should-not-trigger-isolates-blending.html (0 => 217076)


--- trunk/LayoutTests/media/controls-should-not-trigger-isolates-blending.html	                        (rev 0)
+++ trunk/LayoutTests/media/controls-should-not-trigger-isolates-blending.html	2017-05-18 23:27:37 UTC (rev 217076)
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+<script src=""
+<script src=""
+    <style>
+        .container {
+            width: 456px;
+            height: 50px;
+            margin: 4px;
+            padding: 2px;
+            box-sizing: border-box;
+            border: 1px solid gray;
+            position: relative;
+            z-index: 0;
+        }
+        
+        audio {
+            display: block;
+            margin: 20px;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        jsTestIsAsync = true;
+
+        function containsLayerWithSize(layersText, width, height)
+        {
+            var lines = layersText.split('\n');
+            
+            var re = /\(bounds ([.\d]+) ([.\d]+)\)/;
+            
+            for (var line of lines) {
+                var result;
+                if (result = re.exec(line)) {
+                    if (parseFloat(result[1]) == width && parseFloat(result[2]) == height)
+                        return true;
+                }
+                
+            }
+            return false;
+        }
+        
+        var mediaElementsToWaitFor = 2;
+        function setupVideos()
+        {
+            setSrcById('loaded-video', findMediaFile('video', 'content/test'));
+
+            var video = document.getElementById('loaded-video');
+            video.addEventListener("canplaythrough", function() {
+                checkForMediaLoaded(--mediaElementsToWaitFor);
+            });
+            video.load();
+
+            setSrcById('loaded-audio', findMediaFile('audio', 'content/test'));
+            var audio = document.getElementById('loaded-audio')
+            audio.addEventListener("canplaythrough", function() {
+                checkForMediaLoaded(--mediaElementsToWaitFor);
+            });
+            audio.load();
+        }
+        
+        function checkForMediaLoaded(loadsRemaining)
+        {
+            if (loadsRemaining)
+                return;
+            
+            testCompositedContainer();
+        }
+
+        var layers;
+        function testCompositedContainer()
+        {
+            if (!window.internals)
+                return;
+
+            description('Tests that media controls don\'t trigger compositing on an ancestor via isolatesBlending');
+            layers = internals.layerTreeAsText(document);
+            
+            shouldBeFalse('containsLayerWithSize(layers, 456, 50)');
+            
+            finishJSTest();
+        }
+        
+        window.addEventListener('load', setupVideos, false);
+    </script>
+</head>
+<body>
+
+<div class="container">
+    <audio controls="controls"/>
+</div>
+
+<div class="container">
+    <video id="loaded-audio" controls="controls"/>
+</div>
+
+<div class="container">
+    <video src="" controls="controls"/>
+</div>
+
+<div class="container">
+    <video id="loaded-video" controls="controls"/>
+</div>
+
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to