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

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

Issue 2889783003: Only allow subsequence caching for SVG documents, not inline SVG. (Closed)
Patch Set: Merge branch 'master' into fixsvg 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/paint/PaintLayerPainterTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
index 78b94d8fe06842de49709b12d193f91eb1a048f0..b52788629e65ea2340fea1d4fbac3e8ec97a5306 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -145,79 +145,6 @@ TEST_P(PaintLayerPainterTest, CachedSubsequence) {
}
}
-TEST_P(PaintLayerPainterTest, CachedSubsequenceForSVGRoot) {
- SetBodyInnerHTML(
- "<svg id='svg' style='position: relative'>"
- " <rect id='rect' x='10' y='10' width='100' height='100' rx='15' "
- "ry='15'/>"
- "</svg>"
- "<div id='div' style='position: relative; width: 50x; height: "
- "50px'></div>");
- GetDocument().View()->UpdateAllLifecyclePhases();
-
- LayoutObject& svg = *GetDocument().getElementById("svg")->GetLayoutObject();
- LayoutObject& rect = *GetDocument().getElementById("rect")->GetLayoutObject();
- LayoutObject& div = *GetDocument().getElementById("div")->GetLayoutObject();
-
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- // SPv2 slips the clip box (see BoxClipper).
- EXPECT_DISPLAY_LIST(
- RootPaintController().GetDisplayItemList(), 2,
- TestDisplayItem(GetLayoutView(), kDocumentBackgroundType),
- TestDisplayItem(rect, kForegroundType));
- } else {
- EXPECT_DISPLAY_LIST(
- RootPaintController().GetDisplayItemList(), 6,
- TestDisplayItem(GetLayoutView(), kDocumentBackgroundType),
- TestDisplayItem(svg, DisplayItem::kClipLayerForeground),
- TestDisplayItem(svg, DisplayItem::kBeginTransform),
- TestDisplayItem(rect, kForegroundType),
- TestDisplayItem(svg, DisplayItem::kEndTransform),
- TestDisplayItem(svg, DisplayItem::ClipTypeToEndClipType(
- DisplayItem::kClipLayerForeground)));
- }
-
- // Change the color of the div. This should not invalidate the subsequence
- // for the SVG root.
- ToHTMLElement(div.GetNode())
- ->setAttribute(HTMLNames::styleAttr,
- "position: relative; width: 50x; height: 50px; "
- "background-color: green");
- GetDocument().View()->UpdateAllLifecyclePhasesExceptPaint();
- EXPECT_TRUE(PaintWithoutCommit());
-
- // Reuse of SVG and document background. 2 fewer with SPv2 enabled because
- // clip display items don't appear in SPv2 display lists.
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
- EXPECT_EQ(2, NumCachedNewItems());
- else
- EXPECT_EQ(6, NumCachedNewItems());
-
- Commit();
-
- if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
- EXPECT_DISPLAY_LIST(
- RootPaintController().GetDisplayItemList(), 3,
- TestDisplayItem(GetLayoutView(), kDocumentBackgroundType),
- TestDisplayItem(rect, kForegroundType),
- TestDisplayItem(div, kBackgroundType));
- } else {
- EXPECT_DISPLAY_LIST(
- RootPaintController().GetDisplayItemList(), 7,
- TestDisplayItem(GetLayoutView(), kDocumentBackgroundType),
- TestDisplayItem(svg, DisplayItem::kClipLayerForeground),
- TestDisplayItem(svg, DisplayItem::kBeginTransform),
- TestDisplayItem(rect, kForegroundType),
- TestDisplayItem(svg, DisplayItem::kEndTransform),
- TestDisplayItem(svg, DisplayItem::ClipTypeToEndClipType(
- DisplayItem::kClipLayerForeground)),
- TestDisplayItem(div, kBackgroundType),
- TestDisplayItem(GetLayoutView(),
- DisplayItem::ClipTypeToEndClipType(
- DisplayItem::kClipFrameToVisibleContentRect)));
- }
-}
-
TEST_P(PaintLayerPainterTest, CachedSubsequenceOnInterestRectChange) {
// TODO(wangxianzhu): SPv2 deals with interest rect differently, so disable
// this test for SPv2 temporarily.
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698