Open
Bug 1014791
Opened 11 years ago
Updated 2 years ago
[layout view] width and height shown in the layout view shouldn't be impacted by css transform
Categories
(DevTools :: Inspector, defect, P3)
DevTools
Inspector
Tracking
(Not tracked)
NEW
People
(Reporter: pbro, Unassigned)
Details
See this tweet: https://twitter.com/thebabydino/status/469546310648205313
STR:
- Open the inspector on this page
- Select any element
- Switch to the box-model sidebar and check the width/height dimensions
- Now add an attribute to the selected node: 'style="transform:scale(.5)"'
- Check the width/height in the box-model sidebar again
Expected: the width/height should remain the same as transform doesn't actually change them
Actual: the width/height values change
Interestingly, it would be pretty cool if the layout-view did show the bounding client rect dimensions for transformed elements.
Maybe the view should have a checkbox to switch between "box-model" and "bounding rect" mode.
Or maybe when the user switched the the non-box-model view, then we would draw the exact shape of the transformed box-model regions with actual dimensions using getBoxQuads.
But in any case, the normal layout-view we have should be consistent with the computed style of the element I think. Right now it uses:
let clientRect = node.rawNode.getBoundingClientRect();
to determine width and height.
However, it does correctly use getComputedStyle to determine dimensions of the other regions.
Reporter | ||
Comment 1•11 years ago
|
||
Yes but!
Elements don't always have a width/height defined in their style, so getComputedStyle won't return anything we can use. And as far as I know offsetWidth/Height will be impacted by the transform.
I actually don't know if there's a way to get the untransformed dimensions of a transformed element ... and it probably is not an information that is kept at platform level, since it's not exposed.
Reporter | ||
Comment 2•11 years ago
|
||
(In reply to Patrick Brosset [:pbrosset] [:patrick] from comment #1)
> Yes but!
> Elements don't always have a width/height defined in their style, so
> getComputedStyle won't return anything we can use. And as far as I know
> offsetWidth/Height will be impacted by the transform.
Incorrect, offsetWidth/Height keep their untransformed values
Updated•7 years ago
|
Product: Firefox → DevTools
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•