473,507 Members | 13,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed with event testing script

Apparently there is a textarea onscroll event bubbling bug in Firefox
and Mozilla:

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

I'm trying to check for this bug with the following script and it
*seems* to work. In IE it reports "bubbling" and in Firefox "not
bubbling" but I really have no direct way to confirm the Firefox
results until the bubbling bug is fixed.

Basically the test script assigns an onscroll event handler to a
textarea and then scrolls the textarea down then back up, checking to
see if a the event handler works (assigns the "bubbling" variable a
"true").

I had to code things with a few settimeouts otherwise Firefox, unlike
IE, wouldn't display the down then back up scrolling of the textarea.
Which may have been a problem.

Lacking a "debugged" Firefox browser, is there some further (indirect?)
tests and/or rational that would support or discredit this script as a
valid onscroll event check?

<html>
<head>
<script>
var bubbling, ta;

function checkBubbling () {
var str = '';
bubbling = false;
ta.onscroll = function () { bubbling = true; }

for (var i=0; i <= ta.rows; i++) str += '\n';
ta.value = str;
ta.scrollTop = ta.scrollHeight;

setTimeout("scrollBack ()", 1);
}

function scrollBack () {
ta.scrollTop = 0;
setTimeout("resetAndReport ()", 1);
}

function resetAndReport () {
ta.value = "";
if (bubbling)
{
alert('bubbling');
}
else
{
alert('not bubbling');
}
}

onload = function ()
{
ta = document.getElementById('ta');
ta.value = "";
checkBubbling();
}
</script>
</head>
<body>
<textarea id="ta" rows=5 cols=40></textarea>
</body>
</html>

Jul 23 '05 #1
5 1994


Mark Szlazak wrote:
Apparently there is a textarea onscroll event bubbling bug in Firefox
and Mozilla:

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

I'm trying to check for this bug with the following script and it
*seems* to work. In IE it reports "bubbling" and in Firefox "not
bubbling" but I really have no direct way to confirm the Firefox
results until the bubbling bug is fixed.

Basically the test script assigns an onscroll event handler to a
textarea and then scrolls the textarea down then back up, checking to
see if a the event handler works (assigns the "bubbling" variable a
"true").


If script scrolls then I am not sure Mozilla fires the scroll event, it
should fire it when the user scrolls. At least for a window a quick test
shows that window.scrollTo() doesn't fire the scroll event and even if
onscroll worked for textareas then I don't think the scroll event would
be fired if script manipulates the scroll settings.


--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Martin Honnen wrote:
Mark Szlazak wrote:
Apparently there is a textarea onscroll event bubbling bug in Firefox and Mozilla:

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

I'm trying to check for this bug with the following script and it
*seems* to work. In IE it reports "bubbling" and in Firefox "not
bubbling" but I really have no direct way to confirm the Firefox
results until the bubbling bug is fixed.

Basically the test script assigns an onscroll event handler to a
textarea and then scrolls the textarea down then back up, checking to see if a the event handler works (assigns the "bubbling" variable a
"true").
If script scrolls then I am not sure Mozilla fires the scroll event,

it should fire it when the user scrolls. At least for a window a quick test shows that window.scrollTo() doesn't fire the scroll event and even if onscroll worked for textareas then I don't think the scroll event would be fired if script manipulates the scroll settings.


--

Martin Honnen
http://JavaScript.FAQTs.com/


OK, with regard to textarea scripts firing onscroll events, why is
there this difference between IE and Firefox?

Also, do you have any suggestions for checking if the textarea onscroll
event in Firefox is working?

Thanks. Mark.

Jul 23 '05 #3


Mark Szlazak wrote:

Also, do you have any suggestions for checking if the textarea onscroll
event in Firefox is working?


That bug you have found has a test case:
<https://bugzilla.mozilla.org/show_bug.cgi?id=229089>
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4

Martin Honnen wrote:
Mark Szlazak wrote:

Also, do you have any suggestions for checking if the textarea onscroll event in Firefox is working?


That bug you have found has a test case:
<https://bugzilla.mozilla.org/show_bug.cgi?id=229089>
--

Martin Honnen
http://JavaScript.FAQTs.com/


Yes! It demonstrates the bug but provides no work-around.
I was hoping for bug detection without browser version detection but no
luck ... I guess.

Mark.

Jul 23 '05 #5

Martin Honnen wrote:
Mark Szlazak wrote:
Apparently there is a textarea onscroll event bubbling bug in Firefox and Mozilla:

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

I'm trying to check for this bug with the following script and it
*seems* to work. In IE it reports "bubbling" and in Firefox "not
bubbling" but I really have no direct way to confirm the Firefox
results until the bubbling bug is fixed.

Basically the test script assigns an onscroll event handler to a
textarea and then scrolls the textarea down then back up, checking to see if a the event handler works (assigns the "bubbling" variable a
"true").
If script scrolls then I am not sure Mozilla fires the scroll event,

it should fire it when the user scrolls. At least for a window a quick test shows that window.scrollTo() doesn't fire the scroll event and even if onscroll worked for textareas then I don't think the scroll event would be fired if script manipulates the scroll settings.


--

Martin Honnen
http://JavaScript.FAQTs.com/


If the user has to scroll the textarea to get a fire from onscroll in a
bugfree firefox then what about user inputs that show the scrollbars
once enough lines are entered into the textarea. I'm thinking about a
script something like this:

<html>
<head>
<script>
var bubbling, ta;

onload = function ()
{
bubbling = false;
ta = document.getElementById('ta');
ta.value = "";
ta.onscroll = function () { bubbling = true; }
if (ta.addEventListener) {
ta.addEventListener("input",
function () { if (ta.scrollHeight > ta.clientHeight)
{
if (bubbling)
{
window.status = 'bubbling';
}
else
{
window.status = 'not bubbling';
}
}
},
false);
}
}
</script>
</head>
<body>
<textarea id="ta" rows=5 cols=40></textarea>
</body>
</html>

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1433
by: Gonçalo Rodrigues | last post by:
Hi, I have a problem with threads and sockets. I'll try to describe the problem in words with pseudo-code. I've been working on a few classes to make it easier to work with threads. This...
1
2239
by: Pekka Niiranen | last post by:
Hi there, after reading TkInter/thread -recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965 I wondered if it was possible to avoid using threads for the following problem: ...
8
4191
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link,...
7
8679
by: Mike | last post by:
I've been trying for the past week to put a simple code together. I have done a LOT of searching, found scripts showing the functions I would like to use, however when I mix them it all goes wrong,...
7
1852
by: mike | last post by:
Hello, I am kind of new to this javascript stuff and I am constantly having problems trying to get my webpage validated. I have the following <script>printdate();</script> and when I validate it...
5
2863
by: Andrew | last post by:
Hey all, Requesting help from the VB.Net gurus in here. I was given a task to write a Windows Service (VB.Net) that would run an external program, and if that program closed for any reason...
0
5518
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
2
2881
by: rookiejavadude | last post by:
I'm have most of my java script done but can not figure out how to add a few buttons. I need to add a delete and add buttong to my existing java program. Not sure were to add it on how. Can anyone...
53
8315
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.