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)

defect

Tracking

(Not tracked)

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.
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.
(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
filter on CLIMBING SHOES
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.