Bug 29465 - Incorrect animation with scale(0) transform (singular matrix)
Summary: Incorrect animation with scale(0) transform (singular matrix)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: http://dinolatoga.com/demo/webkit-ima...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-18 08:23 PDT by Simon Fraser (smfr)
Modified: 2009-09-19 11:47 PDT (History)
1 user (show)

See Also:


Attachments
Patch, changelog, testcase (8.27 KB, patch)
2009-09-18 18:12 PDT, Simon Fraser (smfr)
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2009-09-18 08:23:54 PDT
If you load the page in the URL, the last image on the page shows a bug when you hover over it, if accelerated compositing is enabled; the black div does not scale in correctly.

This is an issue with singular matrices. It works fine in software.
Comment 1 Simon Fraser (smfr) 2009-09-18 13:51:07 PDT
See also 26575. Bug 26544 was supposed to fix this.
Comment 2 Simon Fraser (smfr) 2009-09-18 15:04:40 PDT
Possible fix:
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index f7368eb..7ad6e35 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -160,13 +160,25 @@ static NSValue* getTransformFunctionValue(const TransformOperation* transformOp,
         case TransformOperation::TRANSLATE_Z:
             return [NSNumber numberWithDouble:transformOp ? static_cast<const TranslateTransformOperation*>(transformOp)->z(size) : 0];
         case TransformOperation::SCALE:
+        case TransformOperation::SCALE_3D:
+            return [NSArray arrayWithObjects:
+                        [NSNumber numberWithDouble:transformOp ? static_cast<const ScaleTransformOperation*>(transformOp)->x() : 0],
+                        [NSNumber numberWithDouble:transformOp ? static_cast<const ScaleTransformOperation*>(transformOp)->y() : 0],
+                        [NSNumber numberWithDouble:transformOp ? static_cast<const ScaleTransformOperation*>(transformOp)->z() : 0],
+                        nil];
+
         case TransformOperation::TRANSLATE:
+        case TransformOperation::TRANSLATE_3D:
+            return [NSArray arrayWithObjects:
+                        [NSNumber numberWithDouble:transformOp ? static_cast<const TranslateTransformOperation*>(transformOp)->x(size) : 0],
+                        [NSNumber numberWithDouble:transformOp ? static_cast<const TranslateTransformOperation*>(transformOp)->y(size) : 0],
+                        [NSNumber numberWithDouble:transformOp ? static_cast<const TranslateTransformOperation*>(transformOp)->z(size) : 0],
+                        nil];
+
         case TransformOperation::SKEW_X:
         case TransformOperation::SKEW_Y:
         case TransformOperation::SKEW:
         case TransformOperation::MATRIX:
-        case TransformOperation::SCALE_3D:
-        case TransformOperation::TRANSLATE_3D:
         case TransformOperation::ROTATE_3D:
         case TransformOperation::MATRIX_3D:
         case TransformOperation::PERSPECTIVE:
@@ -207,6 +219,12 @@ static NSString* getValueFunctionNameForTransformOperation(TransformOperation::O
             return @"translateY"; // kCAValueFunctionTranslateY;
         case TransformOperation::TRANSLATE_Z:
             return @"translateZ"; // kCAValueFunctionTranslateZ;
+        case TransformOperation::SCALE:
+        case TransformOperation::SCALE_3D:
+            return @"scale"; // kCAValueFunctionScale;
+        case TransformOperation::TRANSLATE:
+        case TransformOperation::TRANSLATE_3D:
+            return @"translate"; // kCAValueFunctionTranslate;
         default:
             return nil;
     }
Comment 3 Simon Fraser (smfr) 2009-09-18 18:12:28 PDT
Created attachment 39808 [details]
Patch, changelog, testcase
Comment 4 Simon Fraser (smfr) 2009-09-19 11:47:12 PDT
http://trac.webkit.org/changeset/48562