REGRESSION (r109851): Video controls do not render
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 20:44:35 +0000 (20:44 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 20:44:35 +0000 (20:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=93859

Reviewed by Simon Fraser.

Source/WebCore:

Because video layers can't act as an ancestor composited layer whose
backing can be shared by child layers, any child layer of a video
layer needs to be put into its own composited layer. Because this is
technically overlap, the "overlap" indirect compositing reason is
reused for this case.

Test: compositing/video/video-controls-layer-creation.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):

LayoutTests:

Convert jernoble's test into a layout test.

* compositing/video/video-controls-layer-creation.html: Added.
* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125597 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/compositing/video/video-controls-layer-creation.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp

index f99f45e..edbc699 100644 (file)
@@ -1,3 +1,16 @@
+2012-08-13  Adrienne Walker  <enne@google.com>
+
+        REGRESSION (r109851): Video controls do not render
+        https://bugs.webkit.org/show_bug.cgi?id=93859
+
+        Reviewed by Simon Fraser.
+
+        Convert jernoble's test into a layout test.
+
+        * compositing/video/video-controls-layer-creation.html: Added.
+        * platform/chromium/TestExpectations:
+        * platform/mac/TestExpectations:
+
 2012-08-14  Robert Hogan  <robert@webkit.org>
 
         Update Test Expectations to consolidate bug refs for new tests added
diff --git a/LayoutTests/compositing/video/video-controls-layer-creation.html b/LayoutTests/compositing/video/video-controls-layer-creation.html
new file mode 100644 (file)
index 0000000..6fa75b2
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+    div {
+        -webkit-transform:translateZ(0);
+        position: absolute;
+        top: 100px;
+        left: 0px;
+        width: 300px;
+        height: 300px;
+        background-color: white;
+        z-index: 2;
+    }
+    video {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 272px;
+        height: 153px;
+        z-index: 3;
+    }
+</style>
+</head>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText(true);
+</script>
+<body>
+        <!-- video controls should appear in their own layer -->
+        <video controls>
+            <source src="bogus.ogv" type="video/ogg">
+        </video>
+
+        <!-- this div is beneath the video in a stacking context and should through the video into compositing due to overlap -->
+        <div></div>
+    </body>
+</html>
+
index 2d5e730..b2a9501 100644 (file)
@@ -3454,6 +3454,8 @@ BUGWK85856 : scrollbars/rtl/div-horizontal.html = TEXT
 // Bug 93148 changed this to a testRunner test and it started timing out on Mac.
 BUGWK93148 MAC : fast/css/nested-layers-with-hover.html = TIMEOUT
 
+// Needs new image to be checked in for all platforms.
+BUGWK93859 : compositing/video/video-controls-layer-creation.html = PASS FAIL
 
 BUGWK93247 DEBUG : fast/lists/list-marker-remove-crash.html = CRASH
 
index bd17a29..3a175b5 100644 (file)
@@ -349,6 +349,9 @@ BUGWK91969 : fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html
 BUGWK91969 : fast/dom/HTMLProgressElement/progress-writing-mode.html = TEXT
 BUGWK91969 : fast/dom/HTMLProgressElement/indeterminate-progress-001.html = TEXT
 
+// Needs new image to be checked in for all platforms.
+BUGWK93859 : compositing/video/video-controls-layer-creation.html = PASS FAIL
+
 // Require rebaseline after bug 93148
 BUGWK93148 : tables/mozilla_expected_failures/bugs/bug106966.html = TEXT
 BUGWK93148 : tables/mozilla_expected_failures/marvin/table_overflow_hidden_tbody.html = TEXT
index 74f6df3..b5340a6 100644 (file)
@@ -1,3 +1,21 @@
+2012-08-13  Adrienne Walker  <enne@google.com>
+
+        REGRESSION (r109851): Video controls do not render
+        https://bugs.webkit.org/show_bug.cgi?id=93859
+
+        Reviewed by Simon Fraser.
+
+        Because video layers can't act as an ancestor composited layer whose
+        backing can be shared by child layers, any child layer of a video
+        layer needs to be put into its own composited layer. Because this is
+        technically overlap, the "overlap" indirect compositing reason is
+        reused for this case.
+
+        Test: compositing/video/video-controls-layer-creation.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
 2012-08-14  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
 
         WebKitTestRunner needs layoutTestController.dumpResourceLoadCallbacks
index 6062aae..72ba4c2 100644 (file)
@@ -743,9 +743,18 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
         haveComputedBounds = true;
         compositingReason = overlapMap->overlapsLayers(absBounds) ? RenderLayer::IndirectCompositingForOverlap : RenderLayer::NoIndirectCompositingReason;
     }
-    
+
+#if ENABLE(VIDEO)
+    // Video is special. It's the only RenderLayer type that can both have
+    // RenderLayer children and whose children can't use its backing to render
+    // into. These children (the controls) always need to be promoted into their
+    // own layers to draw on top of the accelerated video.
+    if (compositingState.m_compositingAncestor && compositingState.m_compositingAncestor->renderer()->isVideo())
+        compositingReason = RenderLayer::IndirectCompositingForOverlap;
+#endif
+
     layer->setIndirectCompositingReason(compositingReason);
-    
+
     // The children of this layer don't need to composite, unless there is
     // a compositing layer among them, so start by inheriting the compositing
     // ancestor with m_subtreeIsCompositing set to false.
@@ -763,14 +772,6 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
             overlapMap->pushCompositingContainer();
     }
 
-#if ENABLE(VIDEO)
-    // Video is special. It's a replaced element with a content layer, but has shadow content
-    // for the controller that must render in front. Without this, the controls fail to show
-    // when the video element is a stacking context (e.g. due to opacity or transform).
-    if (willBeComposited && layer->renderer()->isVideo())
-        childState.m_subtreeIsCompositing = true;
-#endif
-
 #if !ASSERT_DISABLED
     LayerListMutationDetector mutationChecker(layer);
 #endif