[Webkit-unassigned] [Bug 28328] New: javascript execution sequence.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 14 15:50:56 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28328

           Summary: javascript execution sequence.
           Product: WebKit
           Version: 525.x (Safari 3.2)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: hartman at videolan.org
                CC: oliver at apple.com, beidson at apple.com


I see a race condition in the following case.

Master script in head.

This master script changes the DOM (adding spans and divs) after
DOMContentLoaded.
I import a second script AFTER changing the DOM. with this:

function importScriptURI(url) {
    var s = document.createElement('script');
    s.setAttribute('src',url);
    s.setAttribute('type','text/javascript');
    document.getElementsByTagName('head')[0].appendChild(s);
    return s;
}

This second script needs to change and see the added DOM elements in order to
function.
This works just fine on Firefox, but on Safari, it seems that execution of both
the master and the "child" javascript are started in paralel. Sometimes, the
new dom elements are seen by the child script, sometimes they are missing. It
might be that there is a workaround, but I have not been able to find any. This
can be a very difficult issue to trigger, and slower computers, high load or
very large and complicated multi level javascript inclusions seem often
required to be able to actually observe the problem. (On wikipedia, in a
complicated situation I see it maybe 1 in 15 page loads.)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list