Ticket #6000 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

Position: Sometimes positioning is off by 1px in Firefox

Reported by: gethinw Owned by:
Priority: minor Milestone: 1.8.7
Component: ui.position Version: 1.8.4
Keywords: Cc:
Blocking: Blocked by:

Change History

comment:1 Changed 3 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in  32264f7.

comment:2 Changed 3 years ago by scott.gonzalez

  • Status changed from closed to reopened
  • Resolution fixed deleted

Reverted in  a0847f3 since this caused a lot of unit tests to fail.

comment:3 Changed 3 years ago by Scott González

  • Status changed from reopened to closed
  • Resolution set to fixed

Position: Handle sub-pixel offsets better in Firefox. Fixes #6000 - Position: Sometimes positioning is off by 1px in Firefox.

Changeset: 32264f7ad12609b316189fd013cda63b41c8b271

comment:4 Changed 3 years ago by Scott González

Revert "Position: Handle sub-pixel offsets better in Firefox. Fixes #6000 - Position: Sometimes positioning is off by 1px in Firefox."

This reverts commit 32264f7ad12609b316189fd013cda63b41c8b271.

Changeset: a0847f3a08dfc259d8ba7f6ba7da16653cf15183

comment:5 follow-up: ↓ 6 Changed 3 years ago by scott.gonzalez

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:6 in reply to: ↑ 5 Changed 3 years ago by inukshuk

Using parseInt I have encountered a number of off-by-one pixel issues in non-webkit browsers (FF and IE7/8); using Math.round instead, the results seem stable across all browsers. I could not confirm the unit test failures, either. Can you tell me exactly which test are failing, or, alternatively, a case where using Math.round causes a wrong or inconsistent result?

Last edited 3 years ago by inukshuk (previous) (diff)

comment:7 Changed 3 years ago by scott.gonzalez

I can't reproduce the failures now either. I even tried going back to jQuery 1.4.3 and that didn't cause any failures either. I remember having a ton of failures (and I could consistently reproduce back then), but maybe I had something else modified...

comment:8 Changed 3 years ago by Scott González

  • Status changed from reopened to closed
  • Resolution set to fixed

Position: Handle sub-pixel offsets better in Firefox. Fixes #6000 - Position: Sometimes positioning is off by 1px in Firefox.

Changeset: c667cff22d8ef352b81338e2834379678fb2dd27

comment:9 Changed 3 years ago by inukshuk

Scott! Meanwhile, I have encountered a similar problem to #5280 with the 'wobbly' behaviour; this was caused by setOffset in offset.js of core using parseInt instead of parseFloat (to explain: ui-autocomplete would write fractions into the CSS which were then parsed back if autocomplete was executed a second time, thereby causing the 'wobbling' effect). Using parseFloat in setOffset seems like the best fix to this problem, however, as I understand it, this would make the workaround of #5280 and #6000 superflous, or in the worst case even buggy.

I have tried to remove the two lines completely (while also using parseFloat in core) and have not encountered the problem since. If core decides to use parseFloat instead of parseInt I would suggest removing the two lines from ui-position entirely.

Also see  http://bugs.jquery.com/ticket/7730

comment:10 Changed 3 years ago by scott.gonzalez

  • Milestone changed from 1.9 to 1.8.7
Note: See TracTickets for help on using tickets.