Bug Tracker

Modify

Ticket #11401 (closed bug: invalid)

Opened 16 months ago

Last modified 8 months ago

.height(...) should be floored for consistent behavior

Reported by: whitters Owned by:
Priority: low Milestone: None
Component: dimensions Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

 http://jsfiddle.net/vju9B/3/

In Chrome, IE7/8, and Opera the height value is floored to the nearest integer. In Firefox it is rounded. This leads to constant 1px discrepencies between Firefox and the rest of the world.

This only applies to elements after they are added to the DOM. Elements that exist as fragments will accept and set their height to a decimal until it is necessary to calculate their box size.

I'm not particularly certain that this should necessarily be changed in jQuery, since it is a bug/oddity within Firefox, but it would be convenient, at least, to report this discrepancy. I couldn't dig up any standard that details the correct behavior for this.

Change History

comment:1 Changed 16 months ago by whitters

 http://jsfiddle.net/fbRUh/

Simplified test case

comment:2 Changed 16 months ago by timmywil

  • Keywords needsdocs added
  • Priority changed from undecided to low
  • Status changed from new to closed
  • Component changed from unfiled to dimensions
  • Resolution set to invalid

Agreed. Some of the differences in browsers concerning decimal point values should be respected for the sake of animations, if nothing else. We should not hide these.

 http://jsfiddle.net/timmywil/fbRUh/3/

However, we could make a note in the docs for dimensions.

comment:3 Changed 8 months ago by mikesherov

  • Keywords needsdocs removed

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.