473,769 Members | 7,315 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("scr ollBack ()", 1);
}

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

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

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

Jul 23 '05 #1
5 2023


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.mozill a.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.mozill a.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.getEle mentById('ta');
ta.value = "";
ta.onscroll = function () { bubbling = true; }
if (ta.addEventLis tener) {
ta.addEventList ener("input",
function () { if (ta.scrollHeigh t > 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
1448
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 framework, let us call it that, consists in two parts. The first part is just a basic thread class deriving from threading.Thread with a few extra functionality that makes it easier for a thread to spawn a new thread and "father it". Each of its
1
2253
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: I have script started from W2K console that normally prints ascii messages to the screen. However, I have command line "debug" -flag that might cause printing
8
4231
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, which when you click it bookmarks the site (much easier). The favicon is never saved if the site is bookmarked this way. Does anyone have any ideas how to fix this?? This is the code: <script language="JavaScript">
7
8695
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, somehow I always end up with error messages and functions not working right. Can someone please help me? I have a form, inside is 1 Text Field and 2 Password Fields. What I'm looking to do is: - Make sure password fields are equal - Set...
7
1875
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 at validator.w3.org I get a error the attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the...
5
2871
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 (other than the service being stopped) it would restart it. I have written the service to do just this, and for testing purposes I am running the program Notepad. And I even have it making entries in the System Event Log. However, and this is my...
0
5576
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
2
2903
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 help? my script is below. thank you import java.awt.*; //import all java.awt import java.awt.event.*; //import all java.awt.event import java.util.*; //import all java.util import javax.swing.*; //import all javax.swing class Product...
53
8416
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 language="javascript" type="text/javascript">
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8876
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
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 we have to send another system
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.