M
Mark Szlazak
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>
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>