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 80a4da496abba79ce6c567a94452e6957754bc79..ba89b11f9657d8d7b2370c6110f1c11894bad63d 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.cpp |
| @@ -918,4 +918,24 @@ TEST_F(PaintPropertyTreeBuilderTest, ColumnSpannerUnderRelativePositioned) |
| EXPECT_EQ(LayoutPoint(55, 44), spanner.objectPaintProperties()->localBorderBoxProperties()->paintOffset); |
| } |
| +TEST_F(PaintPropertyTreeBuilderTest, PaintOffsetPixelSnapping) |
| +{ |
| + setBodyInnerHTML( |
| + "<style>" |
| + " * { margin: 0; }" |
| + " div { position: relative; }" |
| + "</style>" |
| + "<div id='a' style='width: 70px; height: 70px; left: 0.7px; top: 0.7px;'>" |
| + " <div id='b' style='background: red; width: 40px; height: 40px; transform: translateZ(0);'>" |
| + " <div id='c' style='background: white; width: 40px; height: 40px; left: 0.7px; top: 0.7px;'></div>" |
| + " </div>" |
| + "</div>" |
| + ); |
| + |
| + ObjectPaintProperties* bProperties = document().getElementById("b")->layoutObject()->objectPaintProperties(); |
| + EXPECT_EQ(TransformationMatrix().translate3d(0, 0, 0), bProperties->transform()->matrix()); |
| + // The paint offset transform should be snapped from (0.7,0.7) to (1,1). |
| + EXPECT_EQ(TransformationMatrix().translate(1, 1), bProperties->transform()->parent()->matrix()); |
|
chrishtr
2016/06/29 23:46:30
Is there already a unittest for not snapping if th
pdr.
2016/06/30 16:03:12
Added one in PaintOffsetWithBasicPixelSnapping.
chrishtr
2016/06/30 16:57:17
That test still uses a transform. I was asking for
|
| +} |
| + |
| } // namespace blink |