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

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

Issue 1540443003: Fix LayoutObject::mapToVisibleRectInContainerSpace() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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/LayoutObjectTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
index 6afcf09eac39739903251250f7a6a2dd26f23a95..b91d7cb3681b5233ceafa888ce72d657eb9f5840 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
@@ -107,5 +107,21 @@ TEST_F(LayoutObjectTest, ContainingBlockAbsoluteLayoutObjectShouldNotBeNonStatic
EXPECT_EQ(layoutObject->containingBlock(), bodyLayoutObject);
}
+TEST_F(LayoutObjectTest, MapToVisibleRectInContainerSpace)
+{
+ setBodyInnerHTML(
+ "<div id='container' style='overflow: scroll; will-change: transform; width: 50px; height: 50px'>"
+ " <span><img style='width: 20px; height: 100px'></span>"
+ " text text text text text text text"
+ "</div>");
+ LayoutBlock* container = toLayoutBlock(document().getElementById("container")->layoutObject());
+ LayoutText* text = toLayoutText(container->lastChild());
+
+ container->setScrollTop(50);
+ LayoutRect rect(0, 60, 20, 20);
+ text->mapToVisibleRectInContainerSpace(container, rect, nullptr);
+ EXPECT_TRUE(rect == LayoutRect(0, 10, 20, 20));
+}
+
}
« 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