Closed Bug 320020 Opened 19 years ago Closed 14 years ago

my.yahoo.com - use of getElementsByClass causes temporary hang and/or "Unresponsive script" warning

Categories

(Tech Evangelism Graveyard :: English US, defect)

x86
Windows 98
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: baconburg, Unassigned)

References

()

Details

(Keywords: perf, top100, top50)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

WARNING: Unresponsive Script

Reproducible: Always

Steps to Reproduce:
1.Signing onto my yahoo
2.
3.

Actual Results:  
error message

Expected Results:  
no error message
Group: security
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051212 Firefox/1.5

Works for me. Do you also see this problem in Firefox's safe-mode?
http://kb.mozillazine.org/Safe_Mode_(Firefox)
Bug 320409 is another report of this problem on my.yahoo.com.  I think I saw another one a few weeks ago, but I can't find it now.

It would help if you could:

* Make a reduced testcase and attach it, or

* Try temporarily removing parts of your customized My Yahoo page in order to figure out which part makes Firefox unhappy.  Use Camino to do the removal if it takes too long to load the page in Firefox.  (IIRC, the report I read a few weeks ago implicated a mail-related feature, so you might try that first.)  Then I can try adding the same feature to my My Yahoo page and see if I hit the same problem.
Summary: WARNING: Unresponsive Script → "WARNING: Unresponsive Script" on my.yahoo.com
Does Firefox appear to hang for a few seconds before the dialog appears?  If not, the dialog is appearing incorrectly, which means it's definitely a bug in Firefox.  If it does, it could either be a bug in Firefox (something is taking longer than it should) or a bug in the site (it's using an unnecessarily slow algorithm implemented in JavaScript).
It turns out that my father experiences this problem on his blazing-fast 500MHz Celeron computer.  When told me about the problem last month, I told him to change dom.max_script_run_time from 5 to 12, but I didn't remember that incident until several days after commenting on this bug report.

The "My Yahoo!" page is a bit slow to load, but the browser becomes unresponsive for about 6 seconds right around when it finishes loading (probably due to an onload script).

I'll try to reduce the bug on my father's computer, and then I'll try to figure out whether it's a bug in Firefox or a bug in My Yahoo.
At least for my dad's My Yahoo page, most of the hang is spent in the page's getElementsByClass function.  getElementsByClass is called twice.

function getElementsByClass(theNode, theClass) {
  var cArray = [];
  var z = new RegExp('\\b' + theClass + '\\b');
  function doTree(theNode) {
    if (theNode.className && z.test(theNode.className)){
      cArray.push(theNode);
    }
    for (var i=0, len=theNode.childNodes.length; i<len; i++) {
      doTree(theNode.childNodes[i]);
    }
  }
  doTree(theNode);
  return cArray;
}

I'm leaning toward saying this is Yahoo's bug.  They should find a way to make the page work without having a script recurse through the document.
My partially-reduced testcase causes IE to hang much longer than it causes Firefox to hang.  Hmm.
Ripped out a bunch of scripts, ripped out the list of stocks my dad follows and replaced it with a bunch of repeated links, brought a few scripts inline.
my.yahoo.com is #26 on the http://reporter.mozilla.org/ list.  About 30% of the reports are about this issue.
Keywords: perf, top100, top50
Most people who reported that the dialog appeared said it was annoying, and none of them mentioned the 5-second hang before the appearance of the dialog.  Maybe they're reading headlines and not trying to scroll.  I wonder if we should increase the default dom.max_script_run_time from 5 to 10.
*** Bug 325227 has been marked as a duplicate of this bug. ***
Assignee: nobody → english-us
Status: UNCONFIRMED → NEW
Component: JavaScript Console → English US
Ever confirmed: true
Product: Firefox → Tech Evangelism
QA Contact: javascript.console → english-us
Summary: "WARNING: Unresponsive Script" on my.yahoo.com → my.yahoo.com - use of getElementsByClass causes temporary hang and/or "Unresponsive script" warning
*** Bug 325600 has been marked as a duplicate of this bug. ***
check if bug 335058 helps
Is this like  Bug 506442 ?
(In reply to comment #13)
> Is this like  Bug 506442 ?

baconburg, Black_Ps`
do you still see this issue?
No, the problem has been solved!
WFM based on comment 15
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: