Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp |
| index d8ed4c874b9605f68ad15f4a18e31d9ac95a8011..1220047f73006511c744ff2a8a59f594a6d8b972 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp |
| @@ -3329,4 +3329,40 @@ TEST_P(PaintPropertyTreeBuilderTest, MaskClipNodeInvalidation) { |
| EXPECT_EQ(FloatRoundedRect(8, 8, 100, 200), maskClip->clipRect()); |
| } |
| +TEST_P(PaintPropertyTreeBuilderTest, SVGResource) { |
| + // This test verifies the clip node generated for mask's implicit clip |
| + // is correctly invalidated when a box resizes. |
| + setBodyInnerHTML( |
| + "<svg id='svg' xmlns='http://www.w3.org/2000/svg' >" |
| + " <g transform='scale(1000)'>" |
| + " <marker id='markerMiddle' markerWidth='2' markerHeight='2' refX='5' " |
| + "refY='5' markerUnits='strokeWidth'>" |
|
Xianzhu
2017/03/23 17:54:15
Nit: indent the continuation.
chrishtr
2017/03/23 22:52:53
Done.
|
| + " <g id='transformInsideMarker' transform='scale(4)'>" |
| + " <circle cx='5' cy='5' r='7' fill='green'/>" |
| + " </g>" |
| + " </marker>" |
| + " </g>" |
| + " <g id='transformOutsidePath' transform='scale(2)'>" |
| + " <path d='M 130 135 L 180 135 L 180 185' " |
| + "marker-mid='url(#markerMiddle)' fill='none' stroke-width='8px' " |
|
Xianzhu
2017/03/23 17:54:15
Nit: Ditto
chrishtr
2017/03/23 22:52:53
Done.
|
| + "stroke='black'/>" |
| + " </g>" |
| + "</svg>"); |
| + |
| + const ObjectPaintProperties* transformInsideMarkerProperties = |
| + paintPropertiesForElement("transformInsideMarker"); |
| + const ObjectPaintProperties* transformOutsidePathProperties = |
| + paintPropertiesForElement("transformOutsidePath"); |
| + const ObjectPaintProperties* svgProperties = paintPropertiesForElement("svg"); |
| + |
| + // The <marker> object resets to a new paint property tree, so the |
| + // transform within it should have the root as parent. |
| + EXPECT_EQ(TransformPaintPropertyNode::root(), |
| + transformInsideMarkerProperties->transform()->parent()); |
| + |
| + // Whereas this is not true of the transform above the path. |
| + EXPECT_EQ(svgProperties->svgLocalToBorderBoxTransform(), |
| + transformOutsidePathProperties->transform()->parent()); |
| +} |
| + |
| } // namespace blink |