Ticket #10117 (closed bug: duplicate)
[chrome] outerWidth(true) returns wrong results with mixed px- and %-values
| Reported by: | m.schuhfuss@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | dimensions | Version: | 1.6.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
In chrome, there is a problem with the calculation of the outerWidth including the margin when, for example, the width is specified in pixels and the margin in percent.
The following code will demonstrate the problem: http://jsfiddle.net/NXRW2/3/
In this case the margin (10%) will be added to the width (100px) as if it were percent, summing up to the wrong number of 120px.
Change History
comment:1 in reply to: ↑ description Changed 21 months ago by m.schuhfuss@…
comment:2 Changed 21 months ago by anonymous
Even if the width is also specified in percent the result is the same: the width is correctly converted to px whereas the margins are not.
comment:3 Changed 21 months ago by anonymous
No surprise, but this is confirmed behaviour in Safari 5.1 as well
comment:4 Changed 20 months ago by rwaldron
- Priority changed from undecided to low
- Status changed from new to open
- Component changed from unfiled to dimensions
comment:5 Changed 19 months ago by mikesherov
yeah, percentage values for any of width,padding,margin,or border will result in the answer being goofy. If any of them contain percentages, the whole calculation should report 0.
This is also a needsdocs.
Very similar to ##9945
comment:7 Changed 18 months ago by mikesherov
- Status changed from open to closed
- Resolution set to duplicate
this is a dupe of #10639
comment:8 Changed 18 months ago by mikesherov
- Status changed from closed to reopened
- Resolution duplicate deleted
comment:9 Changed 18 months ago by mikesherov
- Status changed from reopened to closed
- Resolution set to duplicate
comment:10 Changed 18 months ago by mikesherov
Duplicate of #10639.
comment:11 Changed 13 months ago by anonymous
related: http://bugs.jquery.com/ticket/11584
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Replying to m.schuhfuss@…:
Should read: ... as if it were pixels ..