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

Unified Diff: third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp

Issue 2808613002: Apply container offset and scroll between transform and container perspective. (Closed)
Patch Set: none Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
index e98f8255034cebe1f1fc902323ac59e80c95ca2a..73be3dba26c01198365cc118780f33db9b42bd85 100644
--- a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
@@ -35,10 +35,12 @@ class VisualRectMappingTest : public RenderingTest {
const LayoutBoxModelObject& ancestor,
const LayoutRect& local_rect,
const LayoutRect& expected_visual_rect,
- bool adjust_for_backing = false) {
+ bool adjust_for_backing = false,
+ bool allow_empty_cache_slot = true) {
LayoutRect slow_map_rect = local_rect;
object.MapToVisualRectInAncestorSpace(&ancestor, slow_map_rect);
- if (slow_map_rect.IsEmpty() && object.VisualRect().IsEmpty())
+ if (allow_empty_cache_slot && slow_map_rect.IsEmpty() &&
+ object.VisualRect().IsEmpty())
return;
FloatClipRect geometry_mapper_rect((FloatRect(local_rect)));
@@ -835,4 +837,44 @@ TEST_F(VisualRectMappingTest, ShouldAccountForPerspectiveNested) {
CheckVisualRect(*target, *target->View(), original_rect, output);
}
+TEST_F(VisualRectMappingTest, PerspectivePlusScroll) {
+ EnableCompositing();
+ SetBodyInnerHTML(
+ "<style>"
+ "* { margin: 0; }"
+ "#container {"
+ " perspective: 100px;"
+ " width: 100px; height: 100px;"
+ " overflow: scroll;"
+ "}"
+ "#target {"
+ " transform: rotatex(45eg);"
+ " background: lightblue;"
+ " width: 100px; height: 100px;"
+ "}"
+ "#spacer {"
+ " width: 10px; height:2000px;"
+ "}"
+ "</style>"
+ "<div id='container'>"
+ " <div id='target'></div>"
+ " <div id='spacer'></div>"
+ "</div>");
+ LayoutBlock* container =
+ ToLayoutBlock(GetLayoutObjectByElementId("container"));
+ ToElement(container->GetNode())->scrollTo(0, 5);
+ GetDocument().View()->UpdateAllLifecyclePhases();
+
+ LayoutBlock* target = ToLayoutBlock(GetLayoutObjectByElementId("target"));
+ LayoutRect originalRect(0, 0, 100, 100);
+ TransformationMatrix transform;
+ target->GetTransformFromContainer(
+ container, target->OffsetFromContainer(container), transform);
+ transform.FlattenTo2d();
+
+ LayoutRect output(transform.MapRect(FloatRect(originalRect)));
+ output.Intersect(container->ClippingRect());
+ CheckVisualRect(*target, *target->View(), originalRect, output, false, false);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698