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

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

Issue 1994203003: Apply scroll offset and content box offset before recursing in mapAncestorToLocal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/LayoutView.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/MapCoordinatesTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
index 06c5ae0c035142a85c3b9239d80aba32e6728f66..ee06f78ae4a5b5859d0bee3a063d0764b0e2fc7f 100644
--- a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
+++ b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
@@ -451,7 +451,7 @@ TEST_F(MapCoordinatesTest, FixedPosInFixedPos)
}
// TODO(chrishtr): add more multi-frame tests.
-TEST_F(MapCoordinatesTest, FixedPosInScrolledIFrame)
+TEST_F(MapCoordinatesTest, FixedPosInIFrameWhenMainFrameScrolled)
{
document().setBaseURLOverride(KURL(ParsedURLString, "http://test.com"));
setBodyInnerHTML(
@@ -475,6 +475,29 @@ TEST_F(MapCoordinatesTest, FixedPosInScrolledIFrame)
EXPECT_EQ(FloatPoint(10, -7930), mappedPoint);
}
+TEST_F(MapCoordinatesTest, FixedPosInScrolledIFrameWithTransform)
+{
+ document().setBaseURLOverride(KURL(ParsedURLString, "http://test.com"));
+ setBodyInnerHTML(
+ "<style>* { margin: 0; }</style>"
+ "<div style='position: absolute; left: 0px; top: 0px; width: 1024px; height: 768px; transform-origin: 0 0; transform: scale(0.5, 0.5);'>"
+ " <iframe id='frame' frameborder=0 src='http://test.com' class='frame' sandbox='allow-same-origin' width='1024' height='768'></iframe>"
+ "</div>");
+
+ Document& frameDocument = setupChildIframe("frame",
+ "<style>* { margin: 0; } #target { width: 200px; height: 200px; position:fixed}</style><div id=target></div>"
+ "<div style='width: 200; height: 8000px'></div>");
+
+ document().view()->updateAllLifecyclePhases();
+ frameDocument.view()->setScrollPosition(DoublePoint(0.0, 1000), ProgrammaticScroll);
+
+ Element* target = frameDocument.getElementById("target");
+ ASSERT_TRUE(target);
+ FloatPoint mappedPoint = mapAncestorToLocal(target->layoutObject(), nullptr, FloatPoint(0, 0), UseTransforms | TraverseDocumentBoundaries);
+
+ EXPECT_EQ(FloatPoint(0, 0), mappedPoint);
+}
+
TEST_F(MapCoordinatesTest, MulticolWithText)
{
setBodyInnerHTML(
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698