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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp

Issue 2889783003: Only allow subsequence caching for SVG documents, not inline SVG. (Closed)
Patch Set: none Created 3 years, 7 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/svg/graphics/SVGImageTest.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
index 9c71221fac1a3d5aa5bb0af66424176cce78fdb3..b4516c15db83cf4bcb6f4decd8a14966a4864b35 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImageTest.cpp
@@ -4,6 +4,9 @@
#include "core/svg/graphics/SVGImage.h"
+#include "core/frame/FrameView.h"
+#include "core/layout/LayoutView.h"
+#include "core/paint/PaintLayer.h"
#include "core/svg/graphics/SVGImageChromeClient.h"
#include "platform/SharedBuffer.h"
#include "platform/Timer.h"
@@ -145,4 +148,16 @@ TEST_F(SVGImageTest, ResetAnimation) {
EXPECT_TRUE(timer->IsActive());
}
+TEST_F(SVGImageTest, SupportsSubsequenceCaching) {
+ const bool kShouldPause = true;
+ Load(kAnimatedDocument, kShouldPause);
+ PumpFrame();
+ LocalFrame* local_frame = ToLocalFrame(GetImage().GetPage()->MainFrame());
+ EXPECT_TRUE(local_frame->GetDocument()->IsSVGDocument());
+ LayoutObject* svg_root = local_frame->View()->GetLayoutView()->ChildAt(0);
fs 2017/05/17 11:14:45 Nit: s/ChildAt(0)/FirstChild/ (ChildAt is quite th
chrishtr 2017/05/17 17:01:18 Done.
+ EXPECT_TRUE(svg_root->IsSVGRoot());
+ EXPECT_TRUE(
+ ToLayoutBoxModelObject(svg_root)->Layer()->SupportsSubsequenceCaching());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698