Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp

Issue 2652273004: Paint invisible layer content in presence of composited animations. (Closed)
Patch Set: Add tests and sync to head. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
index 5d9d39d7d4b3a543c444c81caf86a8ecbfd3f0cf..69ea1ba78a717d723c57f53e1e0991dc341bc357 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -1060,4 +1060,49 @@ TEST_P(PaintLayerPainterTest, DoPaintWithNonTinyOpacity) {
PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo));
}
+TEST_P(PaintLayerPainterTest, DoPaintWithEffectAnimationZeroOpacity) {
+ setBodyInnerHTML(
+ "<style> "
+ "div { "
+ " width: 100px; "
+ " height: 100px; "
+ " animation-name: example; "
+ " animation-duration: 4s; "
+ "} "
+ "@keyframes example { "
+ " from { opacity: 0.0;} "
+ " to { opacity: 1.0;} "
+ "} "
+ "</style> "
+ "<div id='target'></div>");
+ PaintLayer* targetLayer =
+ toLayoutBox(getLayoutObjectByElementId("target"))->layer();
+ PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(),
+ GlobalPaintNormalPhase, LayoutSize());
+ EXPECT_FALSE(
+ PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo));
+}
+
+TEST_P(PaintLayerPainterTest, DoPaintWithTransformAnimationZeroOpacity) {
+ setBodyInnerHTML(
+ "<style> "
+ "div#target { "
+ " animation-name: example; "
+ " animation-duration: 4s; "
+ " opacity: 0.0; "
+ "} "
+ "@keyframes example { "
+ " from { transform: translate(0px, 0px); } "
+ " to { transform: translate(3em, 0px); } "
+ "} "
+ "</style> "
+ "<div id='target'>x</div></div>");
+ PaintLayer* targetLayer =
+ toLayoutBox(getLayoutObjectByElementId("target"))->layer();
+ PaintLayerPaintingInfo paintingInfo(nullptr, LayoutRect(),
+ GlobalPaintNormalPhase, LayoutSize());
+ EXPECT_FALSE(
+ PaintLayerPainter(*targetLayer).paintedOutputInvisible(paintingInfo));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698