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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp

Issue 2510313004: Use LayoutBox::frameRect() as the viewport of LayoutSVGForeignObject (Closed)
Patch Set: crbug.com/667071 Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/LayoutTestHelper.h" 5 #include "core/layout/LayoutTestHelper.h"
6 #include "core/layout/LayoutTreeAsText.h" 6 #include "core/layout/LayoutTreeAsText.h"
7 #include "core/layout/api/LayoutViewItem.h" 7 #include "core/layout/api/LayoutViewItem.h"
8 #include "core/paint/ObjectPaintProperties.h" 8 #include "core/paint/ObjectPaintProperties.h"
9 #include "core/paint/PaintPropertyTreePrinter.h" 9 #include "core/paint/PaintPropertyTreePrinter.h"
10 #include "platform/graphics/paint/GeometryMapper.h" 10 #include "platform/graphics/paint/GeometryMapper.h"
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 " <div id=div style='position: absolute; left: 5.6px; top: 7.3px'>" 1683 " <div id=div style='position: absolute; left: 5.6px; top: 7.3px'>"
1684 " </div>" 1684 " </div>"
1685 " </foreignObject>" 1685 " </foreignObject>"
1686 "</svg>"); 1686 "</svg>");
1687 1687
1688 const auto* svgProperties = 1688 const auto* svgProperties =
1689 getLayoutObjectByElementId("svg")->paintProperties(); 1689 getLayoutObjectByElementId("svg")->paintProperties();
1690 EXPECT_EQ(nullptr, svgProperties->paintOffsetTranslation()); 1690 EXPECT_EQ(nullptr, svgProperties->paintOffsetTranslation());
1691 EXPECT_EQ(LayoutPoint(LayoutUnit(8.6), LayoutUnit(8.3)), 1691 EXPECT_EQ(LayoutPoint(LayoutUnit(8.6), LayoutUnit(8.3)),
1692 svgProperties->localBorderBoxProperties()->paintOffset); 1692 svgProperties->localBorderBoxProperties()->paintOffset);
1693 // Paint offset of SVGRoot be baked into svgLocalToBorderBoxTransform after 1693 // Paint offset of SVGRoot is baked into svgLocalToBorderBoxTransform after
1694 // snapped to pixels. 1694 // snapped to pixels.
1695 EXPECT_EQ(TransformationMatrix().translate(9, 8), 1695 EXPECT_EQ(TransformationMatrix().translate(9, 8),
1696 svgProperties->svgLocalToBorderBoxTransform()->matrix()); 1696 svgProperties->svgLocalToBorderBoxTransform()->matrix());
1697 1697
1698 const auto* foreignObject = 1698 const auto* foreignObject =
1699 toLayoutBox(getLayoutObjectByElementId("foreign")); 1699 toLayoutBox(getLayoutObjectByElementId("foreign"));
1700 const auto* foreignObjectProperties = foreignObject->paintProperties(); 1700 const auto* foreignObjectProperties = foreignObject->paintProperties();
1701 // The offset of foreign object should be snapped to pixels before applying 1701 // The offset of foreign object should be snapped to pixels before applying
1702 // the local transforms. 1702 // the local transforms.
1703 EXPECT_EQ(TransformationMatrix().translate(1.5, 1.5).scale(2).translate(4, 5), 1703 EXPECT_EQ(TransformationMatrix().translate(1.5, 1.5).scale(2).translate(4, 5),
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 EXPECT_EQ(framePreTranslation(), 2887 EXPECT_EQ(framePreTranslation(),
2888 childProperties->paintOffsetTranslation()->parent()); 2888 childProperties->paintOffsetTranslation()->parent());
2889 EXPECT_EQ(childProperties->paintOffsetTranslation(), 2889 EXPECT_EQ(childProperties->paintOffsetTranslation(),
2890 childPaintState.transform()); 2890 childPaintState.transform());
2891 // This will change once we added clip expansion node. 2891 // This will change once we added clip expansion node.
2892 EXPECT_EQ(filterProperties->effect()->outputClip(), childPaintState.clip()); 2892 EXPECT_EQ(filterProperties->effect()->outputClip(), childPaintState.clip());
2893 EXPECT_EQ(filterProperties->effect(), childPaintState.effect()); 2893 EXPECT_EQ(filterProperties->effect(), childPaintState.effect());
2894 } 2894 }
2895 2895
2896 } // namespace blink 2896 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698