Skip to main content

Bug Tracker

Side navigation

#8951 closed enhancement (patchwelcome)

Opened April 24, 2011 10:56AM UTC

Closed June 06, 2011 06:01PM UTC

Last modified March 09, 2012 01:58PM UTC

jQuery could handle firefox bug 383026 with .scrollLeft()

Reported by: arieleo Owned by:
Priority: low Milestone: 1.7
Component: offset Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:
Description

Hi,

This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug.

Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox.

Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers.

For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers.

Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one.

Documentation for the Firefox bug is located here:

https://bugzilla.mozilla.org/show_bug.cgi?id=383026

Your review of this suggestion is appreciated.

Ariel

Attachments (0)
Change History (13)

Changed April 24, 2011 10:00PM UTC by timmywil comment:1

component: unfiledoffset
owner: → arieleo
priority: undecidedlow
status: newpending

Thanks for taking the time to contribute to the jQuery project!

I went ahead and made a test case and I couldn't reproduce the issue experienced: http://jsfiddle.net/timmywil/F2sh8/3/ (checked in Firefox 3.6 and Firefox 4).

Perhaps you could update mine or create a test case on http://jsfiddle.net, or let us know which version of Firefox has the issue.

Changed April 25, 2011 09:48AM UTC by arieleo comment:2

status: pendingnew

Thanks for checking!

To reproduce it just play with the scrollbars, as they all read out '0' when in their initial location.

You can use this change I made to the jsFiddle code:

http://jsfiddle.net/F2sh8/7/

One more difference in behavior between browsers I now spotted, is that the initial value of '0' is also something specific to Firefox (I have Firefox 4). Other browsers will read out the scroll distance from the left, no matter the direction.

In this case Firefox is much more sensible, for cases when you want to localize a website by converting the CSS from LTR to RTL while not making any changes to the JavaScripts.

For that matter, perhaps it's worth leaving .scrollLeft() along, and creating a new jQuery function called .scrollDistanceHorizontal() or something along this line, that will represent the scroll distance from the initial scrollbar location, no matter the direction.

This way, given an example situation where I have an LTR site with a slider script that scrolls a div from right to left by increasing the scroll distance, I would not have to make any changes to the script if I localize the site to RTL languages.

This could be nice. Thanks again!

Changed April 25, 2011 02:43PM UTC by timmywil comment:3

owner: arieleotimmywil
status: newassigned

Changed May 22, 2011 07:27PM UTC by john comment:4

keywords: → 1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 22, 2011 09:28PM UTC by rwaldron comment:5

description: Hi, \ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug. \ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox. \ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers. \ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers. \ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one. \ \ Documentation for the Firefox bug is located here: \ https://bugzilla.mozilla.org/show_bug.cgi?id=383026 \ \ Your review of this suggestion is appreciated. \ Ariel \ Hi,\ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug.\ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox.\ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers.\ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers.\ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one.\ \ Documentation for the Firefox bug is located here:\ https://bugzilla.mozilla.org/show_bug.cgi?id=383026\ \ Your review of this suggestion is appreciated.\ Ariel\

+0,

Changed May 23, 2011 12:42AM UTC by jaubourg comment:6

+1, seeing how "quick" Mozilla is to fix this, we might consider it.

Changed May 23, 2011 04:33AM UTC by timmywil comment:7

+1, Yes, I forgot about this one.

Changed May 24, 2011 09:41PM UTC by dmethvin comment:8

description: Hi,\ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug.\ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox.\ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers.\ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers.\ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one.\ \ Documentation for the Firefox bug is located here:\ https://bugzilla.mozilla.org/show_bug.cgi?id=383026\ \ Your review of this suggestion is appreciated.\ Ariel\ Hi, \ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug. \ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox. \ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers. \ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers. \ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one. \ \ Documentation for the Firefox bug is located here: \ https://bugzilla.mozilla.org/show_bug.cgi?id=383026 \ \ Your review of this suggestion is appreciated. \ Ariel \

+0, Do we have a feature detect for this?

Changed May 27, 2011 12:06AM UTC by timmywil comment:9

owner: timmywil
status: assignedopen

Changed June 03, 2011 01:57PM UTC by john comment:10

description: Hi, \ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug. \ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox. \ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers. \ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers. \ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one. \ \ Documentation for the Firefox bug is located here: \ https://bugzilla.mozilla.org/show_bug.cgi?id=383026 \ \ Your review of this suggestion is appreciated. \ Ariel \ Hi,\ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug.\ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox.\ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers.\ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers.\ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one.\ \ Documentation for the Firefox bug is located here:\ https://bugzilla.mozilla.org/show_bug.cgi?id=383026\ \ Your review of this suggestion is appreciated.\ Ariel\

+0, Very low priority, let's land only if there's a patch with unit tests.

Changed June 05, 2011 09:31PM UTC by ajpiano comment:11

description: Hi,\ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug.\ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox.\ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers.\ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers.\ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one.\ \ Documentation for the Firefox bug is located here:\ https://bugzilla.mozilla.org/show_bug.cgi?id=383026\ \ Your review of this suggestion is appreciated.\ Ariel\ Hi, \ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug. \ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox. \ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers. \ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers. \ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one. \ \ Documentation for the Firefox bug is located here: \ https://bugzilla.mozilla.org/show_bug.cgi?id=383026 \ \ Your review of this suggestion is appreciated. \ Ariel \

+0, Patchwelcome

Changed June 06, 2011 02:44PM UTC by scottgonzalez comment:12

description: Hi, \ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug. \ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox. \ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers. \ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers. \ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one. \ \ Documentation for the Firefox bug is located here: \ https://bugzilla.mozilla.org/show_bug.cgi?id=383026 \ \ Your review of this suggestion is appreciated. \ Ariel \ Hi,\ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug.\ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox.\ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers.\ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers.\ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one.\ \ Documentation for the Firefox bug is located here:\ https://bugzilla.mozilla.org/show_bug.cgi?id=383026\ \ Your review of this suggestion is appreciated.\ Ariel\

+0, I'm in favor of fixing this bug, but I don't think this belongs specifically on the 1.7 roadmap

Changed June 06, 2011 06:01PM UTC by rwaldron comment:13

description: Hi,\ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug.\ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox.\ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers.\ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers.\ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one.\ \ Documentation for the Firefox bug is located here:\ https://bugzilla.mozilla.org/show_bug.cgi?id=383026\ \ Your review of this suggestion is appreciated.\ Ariel\ Hi, \ This is a suggestion to handle a bug in Firefox (383026) rather than an actual jQuery bug. \ \ Using jQuery .scrollLeft() on an element with a direction of RTL will return negative values in Firefox. \ \ Although this is caused by a bug in Firefox and not in jQuery, given that jQuery is very useful in unifying browsers behaviour for the JavaScript programmer, maybe it should also unify this behavior across browsers. \ \ For example, one need only to set an element's opacity with jQuery and forget it. jQuery will deal with the different opacity techniques for the different browsers. \ \ Therefore, my suggestion is to add to jQuery's .scrollLeft the ability to take into consideration the rendering engine and to return a unified positive value, instead of Firefox's negative one. \ \ Documentation for the Firefox bug is located here: \ https://bugzilla.mozilla.org/show_bug.cgi?id=383026 \ \ Your review of this suggestion is appreciated. \ Ariel \
keywords: 1.7-discuss
milestone: 1.next1.7
resolution: → patchwelcome
status: openclosed