Bug Tracker

Modify

Ticket #10117 (closed bug: duplicate)

Opened 21 months ago

Last modified 13 months ago

[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@…

Replying to m.schuhfuss@…:

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.

Should read: ... as if it were pixels ..

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.

 http://jsfiddle.net/NXRW2/4/

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:6 Changed 18 months ago by mikesherov

this is a dupe of #10639 . I know this bug came before #10639, but I have a lot of work done on #10639 already, including a pull request and lots of comments on the trac ticket. Please mark this as a dupe.

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.