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

RESOLVED INVALID

Status

()

Core
DOM: CSS Object Model
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: Chen Zhixiang, Unassigned)

Tracking

24 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 814717 [details]
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.
(Reporter)

Comment 1

5 years ago
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.)
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
(Reporter)

Comment 3

5 years ago
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?
(Reporter)

Comment 4

5 years ago
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.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
(Reporter)

Comment 5

5 years ago
Also,
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().
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → INVALID

Comment 7

5 years ago
I commented in the W3C bug report at https://www.w3.org/Bugs/Public/show_bug.cgi?id=23466

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.