Bug 53695 - Style transform (-webkit-transform: scale3d) with 0-scale renders, but disables mouse events.
Summary: Style transform (-webkit-transform: scale3d) with 0-scale renders, but disabl...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-03 11:00 PST by W. James MacLean
Modified: 2013-06-25 19:36 PDT (History)
5 users (show)

See Also:


Attachments
Test case with style containing 0-scale. (1.21 KB, text/html)
2011-02-03 11:01 PST, W. James MacLean
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description W. James MacLean 2011-02-03 11:00:28 PST
Visit the attached HTML file scale0.html with Chromium/Safari, both with gpu enabled and not enabled.

The box labelled "broken" has a style element "-webkit-transform: scale3d(0.8,0.8,0)" that is applied when the box is clicked. Two different behaviours are seen, depending on whether GPU acceleration is enabled in the browser or not.

With GPU enabled, clicking on the box labelled "broken" changes the DIV's transform in a way that makes it non-invertible, causing it to be subsequently is removed from hit-testing. After the initial click this element no longer receives mouse events.

With GPU disabled, clicking on the same box appears to work normally, partially because in non-gpu mode WebKit calls makeRenderable() which overrides the element's transform by making it affine (and in the process invertible).

In both cases though the element is rendered.

According to the CSS specs (http://www.w3.org/TR/css3-2d-transforms/), elements with non-invertible transforms should not be rendered:

"In some cases, an animation might cause a transformation matrix to be singular or non-invertible. For example, an animation in which scale moves from 1 to -1. At the time when the matrix is in such a state, the transformed element is not rendered."

This suggests that perhaps the correct behaviour would be to not render the element at all. In any case, it seems desirable that both code paths should produce the same result.
Comment 1 W. James MacLean 2011-02-03 11:01:21 PST
Created attachment 81087 [details]
Test case with style containing 0-scale.
Comment 2 Dean Jackson 2011-02-03 11:31:20 PST
Seems like we need to decide things like:

- does scale to 0 along any axis make something disappear?
- does scale to 0 along any axis make something invisible to events?
- should a Z scale do anything to a 2d-only scene?
- what should happen with rotateY(90deg) scale(0, 1) rotateY(-90deg)? ie. if you scale to 0 along an axis perpendicular to the plane you exist in, does that make you disappear?
Comment 3 Jet Villegas 2013-06-25 12:59:25 PDT
Per spec, this should not be rendered at all:
http://www.w3.org/TR/css3-transforms/#transform-function-lists