2010-04-23 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dan Bernstein.
ASSERT(willBeComposited == needsToBeComposited(layer)); on gmail.com
https://bugs.webkit.org/show_bug.cgi?id=38066
When a layer goes into compositing mode because it has a negative z-index child that is going
into compositing mode, then set willBeComposited to true. Also add another assertion to catch
any other cases where the state of willBeComposited is mismanaged.
Test: compositing/composited-negative-zindex-child.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c3e38c6..a93fccd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2010-04-23 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ ASSERT(willBeComposited == needsToBeComposited(layer)); on gmail.com
+ https://bugs.webkit.org/show_bug.cgi?id=38066
+
+ Testcase with a negative z-index child that toggles into compositing mode. It should not assert.
+
+ * compositing/composited-negative-zindex-child-expected.txt: Copied from LayoutTests/compositing/self-painting-layers2-expected.txt.
+ * compositing/composited-negative-zindex-child.html: Added.
+
2010-04-23 Dan Bernstein <mitz@apple.com>
Reviewed by Simon Fraser.
diff --git a/LayoutTests/compositing/composited-negative-zindex-child-expected.txt b/LayoutTests/compositing/composited-negative-zindex-child-expected.txt
new file mode 100644
index 0000000..4ebf1bd
--- /dev/null
+++ b/LayoutTests/compositing/composited-negative-zindex-child-expected.txt
@@ -0,0 +1,3 @@
+This test should not assert in debug builds.
+
+
diff --git a/LayoutTests/compositing/composited-negative-zindex-child.html b/LayoutTests/compositing/composited-negative-zindex-child.html
new file mode 100644
index 0000000..5805793
--- /dev/null
+++ b/LayoutTests/compositing/composited-negative-zindex-child.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style type="text/css" media="screen">
+ .box {
+ height: 100px;
+ width: 100px;
+ position: absolute;
+ z-index: 0;
+ }
+
+ .parent {
+ border: 1px solid black;
+ }
+
+ .child {
+ top: 10px;
+ left: 10px;
+ background-color: silver;
+ z-index: -1;
+ }
+ </style>
+ <script type="text/javascript" charset="utf-8">
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function doTest() {
+ document.getElementById('child').style.webkitTransform = 'translateZ(0)';
+ }
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+ <p>This test should not assert in debug builds.</p>
+ <div class="parent box">
+ <div id="child" class="child box"></div>
+ </div>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 39f902f..5f2dd83 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -201,6 +201,22 @@
Reviewed by Dan Bernstein.
+ ASSERT(willBeComposited == needsToBeComposited(layer)); on gmail.com
+ https://bugs.webkit.org/show_bug.cgi?id=38066
+
+ When a layer goes into compositing mode because it has a negative z-index child that is going
+ into compositing mode, then set willBeComposited to true. Also add another assertion to catch
+ any other cases where the state of willBeComposited is mismanaged.
+
+ Test: compositing/composited-negative-zindex-child.html
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+
+2010-04-23 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
When webkitAnimationEnd event fires, on-screen rendering should show the last frame of animation
https://bugs.webkit.org/show_bug.cgi?id=37955
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index 47042a6..d8bf053 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -555,6 +555,7 @@
childState.m_compositingAncestor = layer;
if (overlapMap)
addToOverlapMap(*overlapMap, layer, absBounds, haveComputedBounds);
+ willBeComposited = true;
}
}
}
@@ -579,6 +580,8 @@
}
}
+ ASSERT(willBeComposited == needsToBeComposited(layer));
+
// If we have a software transform, and we have layers under us, we need to also
// be composited. Also, if we have opacity < 1, then we need to be a layer so that
// the child layers are opaque, then rendered with opacity on this layer.