Ticket #8663 (closed bug: invalid)
outerWidth Bug in Chrome and Safari
| Reported by: | kadishmal | Owned by: | kadishmal |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | dimensions | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
There seem to be a bug in the jQuery outerWidth calculations when running in Chrome and Safari. But as these two belong to Webkit, I suppose maybe it's their bug. Anyhow, please look at these.
My "body" tag width is 1521px. It has one child called "page": width=950, border=1, padding=0, margin=0 auto. This margin configuration makes it center horizontally.
Hence, outerWidth of page should be 952.
But in Chrome/Safari:
page.offset().left = 293 page.outerWidth(true) = 1538
In IE:
page.offset().left = 291 page.outerWidth(true) = 952
In Firefox:
page.offset().left = 293 page.outerWidth(true) = 952
If it is jQuery bug, then I assume it is as a result of "margin:0 auto". Perhaps it cannot calculate the outerWidth correctly in this case.
Chrome: 10.0 Safari: 5.0 IE: 8.0 FF: 4.0 jQuery: 1.4.4
Change History
comment:2 Changed 2 years ago by kadishmal
Oh, I think Chrome and Safari compute it correctly, as if "margin:0 auto" the margin left and right become 293, which is true. But IE/FF do not include this margin.
When I do page.outerWidth() - without passing "true" argument, all browsers return what I expected 952.
So, perhaps, you have to look at why IE and FF do not include the margin when outerWidth(true).
comment:3 Changed 2 years ago by timmywil
My guess is that this is a duplicate of #3333. Perhaps you could provide a test case on jsfiddle.net.
comment:5 Changed 2 years ago by rwaldron
- Owner set to kadishmal
- Status changed from new to pending
- Component changed from unfiled to dimensions
comment:6 Changed 2 years ago by trac-o-bot
- Status changed from pending to closed
- Resolution set to invalid
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:7 Changed 14 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.

The "body" tag without the scroller is 1538px. So Chrome and Safari somehow return the width of the parent "body" tag.