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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.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
Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 22a31999a0631cfd3d6b81222a611cbd7168140b..cdbf5a81cca6055c3793982e23c8dc4832c9643f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -2302,15 +2302,16 @@ void LayoutObject::GetTransformFromContainer(
const LayoutSize& offset_in_container,
TransformationMatrix& transform) const {
transform.MakeIdentity();
- transform.Translate(offset_in_container.Width().ToFloat(),
- offset_in_container.Height().ToFloat());
PaintLayer* layer = HasLayer() ? ToLayoutBoxModelObject(this)->Layer() : 0;
if (layer && layer->Transform())
transform.Multiply(layer->CurrentTransform());
+ transform.TranslateRight(offset_in_container.Width().ToFloat(),
+ offset_in_container.Height().ToFloat());
+
if (container_object && container_object->HasLayer() &&
container_object->Style()->HasPerspective()) {
- // Perpsective on the container affects us, so we have to factor it in here.
+ // Perspective on the container affects us, so we have to factor it in here.
DCHECK(container_object->HasLayer());
FloatPoint perspective_origin =
ToLayoutBoxModelObject(container_object)->Layer()->PerspectiveOrigin();
@@ -2318,12 +2319,10 @@ void LayoutObject::GetTransformFromContainer(
TransformationMatrix perspective_matrix;
perspective_matrix.ApplyPerspective(
container_object->Style()->Perspective());
+ perspective_matrix.ApplyTransformOrigin(perspective_origin.X(),
+ perspective_origin.Y(), 0);
- transform.TranslateRight3d(-perspective_origin.X(), -perspective_origin.Y(),
- 0);
transform = perspective_matrix * transform;
- transform.TranslateRight3d(perspective_origin.X(), perspective_origin.Y(),
- 0);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698