Closed Bug 924752 Opened 6 years ago Closed 6 years ago

Image element's width/height from getComputedStyle doesn't update after setting new CSS3 transform scale matrix


(Core :: DOM: CSS Object Model, defect)

24 Branch
Windows 7
Not set





(Reporter: chenzx, Unassigned)



(1 file)

Attached file index.html
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36

Steps to reproduce:

#see test case.
The newest Chrome also has this problem.
I thought this may be CSS spec. violation?
This is the expected behavior.  The computed values of 'width' and 'height' reflect layout computations as described in the CSS 2.1 specification, but they're not supposed to be updated to reflect graphical transformations.  (And it wouldn't make sense to do so for many transformations, which makes boxes non-rectangular.)
Closed: 6 years ago
Resolution: --- → INVALID
But if so,
how can i tell if the ```graphics transform``` is correct?
There is a lack of feedback mechanism.

See: getComputedStyle is a `feedback` to CSS 2.1 layout as you said, but how can i got the CSS3-transform'ed new geometry info from the DOM object?
CSS3 transform is NOT ```only``` graphical transformations, it also affect layout: for if I set the outer wrapper div to "overflow:auto;", its h/v sliders's length also changes, -- which seems it should be also layout-related.
Resolution: INVALID → ---
If the width/height is ```always``` the original image width/height, then including it in getComputedStyle result is meaningless.
CSS spec. should have clarified the meaning of `computed`, or else, it defines a lot attributes, but few is useful for web app dev.!
For the most part, the concept of "computed value" is just the output of the style system.  For backwards compatibility, getComputedStyle() provides more "used value" type information for layout-related properties.  But I think the information you want belongs in modifications to APIs like getClientRects, getBoundingClientRect, etc., and not in the output of getComputedStyle().
Closed: 6 years ago6 years ago
Resolution: --- → INVALID
I commented in the W3C bug report at

Currently CSS Transforms is defined in a way that it does not influence layout or information about layout. For me this includes he current CSS OM APIs. However, I agree that these information are really useful and we are working on CSSOM View to get this specified.
You need to log in before you can comment on or make changes to this bug.