OLD | NEW |
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/paint/PaintPropertyTreeBuilderTest.h" | 5 #include "core/paint/PaintPropertyTreeBuilderTest.h" |
6 | 6 |
7 #include "core/html/HTMLIFrameElement.h" | 7 #include "core/html/HTMLIFrameElement.h" |
8 #include "core/layout/LayoutTreeAsText.h" | 8 #include "core/layout/LayoutTreeAsText.h" |
9 #include "core/paint/ObjectPaintProperties.h" | 9 #include "core/paint/ObjectPaintProperties.h" |
10 #include "core/paint/PaintPropertyTreePrinter.h" | 10 #include "core/paint/PaintPropertyTreePrinter.h" |
(...skipping 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3167 setBodyInnerHTML( | 3167 setBodyInnerHTML( |
3168 "<div id='target' style='overflow: auto; width: 100px; height: 100px'>" | 3168 "<div id='target' style='overflow: auto; width: 100px; height: 100px'>" |
3169 " <div style='width: 200px; height: 200px'></div>" | 3169 " <div style='width: 200px; height: 200px'></div>" |
3170 "</div>"); | 3170 "</div>"); |
3171 | 3171 |
3172 const ObjectPaintProperties* properties = paintPropertiesForElement("target"); | 3172 const ObjectPaintProperties* properties = paintPropertiesForElement("target"); |
3173 EXPECT_NE(CompositorElementId(), | 3173 EXPECT_NE(CompositorElementId(), |
3174 properties->scrollTranslation()->compositorElementId()); | 3174 properties->scrollTranslation()->compositorElementId()); |
3175 } | 3175 } |
3176 | 3176 |
3177 TEST_P(PaintPropertyTreeBuilderTest, OverflowClipSubpixelPosition) { | |
3178 setBodyInnerHTML( | |
3179 "<style>body { margin: 20px 30px; }</style>" | |
3180 "<div id='clipper'" | |
3181 " style='position: relative; overflow: hidden; " | |
3182 " width: 400px; height: 300px; left: 1.5px'>" | |
3183 "</div>"); | |
3184 | |
3185 LayoutBoxModelObject* clipper = toLayoutBoxModelObject( | |
3186 document().getElementById("clipper")->layoutObject()); | |
3187 const ObjectPaintProperties* clipProperties = clipper->paintProperties(); | |
3188 | |
3189 EXPECT_EQ(LayoutPoint(FloatPoint(31.5, 20)), clipper->paintOffset()); | |
3190 EXPECT_EQ(FloatRect(31.5, 20, 400, 300), | |
3191 clipProperties->overflowClip()->clipRect().rect()); | |
3192 } | |
3193 | |
3194 } // namespace blink | 3177 } // namespace blink |
OLD | NEW |