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

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

Issue 2847873002: Don't pass subpixel offsets through non-translation transforms (Closed)
Patch Set: Fix LayoutBox::MapVisualRectToContainer()? 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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 5ebf1b6cbcdb5e3a88e03274d743659dfdd54307..5cf983a5aec154f4cb1dd002c8bc4a3df5f0db85 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1200,8 +1200,8 @@ bool LayoutBox::MapVisualRectToContainer(
// 2. Container offset.
// 3. Container scroll offset.
// 4. Perspective applied by container.
- // 5. Transform flattening.
- // 6. Expansion for pixel snapping.
+ // 5. Expansion for pixel snapping.
+ // 6. Transform flattening.
// 7. Container clip.
// 1. Transform.
@@ -1237,11 +1237,8 @@ bool LayoutBox::MapVisualRectToContainer(
transform = perspective_matrix * transform;
}
- // 5. Transform flattening.
- transform_state.ApplyTransform(transform, accumulation);
-
- // 6. Expansion for pixel snapping.
- // Use enclosingBoundingBox because we cannot properly compute pixel
+ // 5. Expansion for pixel snapping.
+ // Use EnclosingBoundingBox because we cannot properly compute pixel
// snapping for painted elements within the transform since we don't know
// the desired subpixel accumulation at this point, and the transform may
// include a scale.
@@ -1251,6 +1248,13 @@ bool LayoutBox::MapVisualRectToContainer(
FloatQuad(transform_state.LastPlanarQuad().EnclosingBoundingBox()));
Xianzhu 2017/04/28 19:35:27 I'm not sure if this is correct: 1. Is it OK to fl
}
+ // 6. Transform flattening.
+ transform_state.ApplyTransform(transform, accumulation);
+ if (!preserve3D) {
+ transform_state.Flatten();
+ transform_state.SetQuad(FloatQuad(transform_state.LastPlanarQuad()));
+ }
+
// 7. Container clip.
if (container_object->IsBox() && container_object != ancestor &&
container_object->HasClipRelatedProperty()) {

Powered by Google App Engine
This is Rietveld 408576698