[Webkit-unassigned] [Bug 11315] New: MS Atlas Safari Compatibility layer considered harmful

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 16 08:50:32 PDT 2006


http://bugs.webkit.org/show_bug.cgi?id=11315

           Summary: MS Atlas Safari Compatibility layer considered harmful
           Product: WebKit
           Version: 419.x
          Platform: Macintosh
               URL: http://atlas.asp.net/atlastoolkit/Accordion/Accordion.as
                    px
        OS/Version: Mac OS X 10.4
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P3
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at opendarwin.org
        ReportedBy: webkit at metafeather.com


Not wanting to rehash discussions in the wider community about the use of
Object.prototype to extend the native JS objects, I have found the following
inconsitency between the MS Atlas Firefox and Safari compatibility layers that
I do not think is intended, but on reviewing the JS code cannot see how this is
happened unless there is a possible bug in Safari.

In AtlasCompat.js (see:
http://atlas.asp.net/ScriptLibrary/Atlas/Release/AtlasCompat.js) the
_loadSafariCompatLayer() function appears to add 'getElementById',
'attachEvent' and 'deleteEvent' functions to every native Object of the window
rather than just the HTMLElement prototype Object that it intends.

To replicate:

1. Go to http://atlas.asp.net/atlastoolkit/Accordion/Accordion.aspx in Safari
and Firefox (or other Atlas using site)

2. In each enter to following in the address bar to create a new Object and
then iterate through its properties:

 javascript:var mytest = new Object();mytest.myprop = 'prop';for (var key in
mytest){alert(key+' = '+typeof(mytest[key]))}

3. In Firefox there will be one alert with a value of 'myprop = prop'. In
Safari there will be 4 alerts, including the extra function names (Tested in
Safari 2.0.4 and Firefox 1.5.0.7)

I believe that this manipulation of Objects (in Safari only) is one of the
reasons why developers have been having problems integrating custom code or
other OS libraries (e.g. Prototype) with Atlas in Safari, and changing this
will greatly simplify things.

This may be an MS Atlas JS bug so this is cross-posted to the ASP.NET AJAX
Discussion forum here: http://forums.asp.net/1007/ShowForum.aspx (its being
moderated).

However any work with the MS Atlas developers on their Safari Compatibility
layer JS would be greatly appreciated.


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



More information about the webkit-unassigned mailing list