RESOLVED FIXED 10038
REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number of registered mime types
https://bugs.webkit.org/show_bug.cgi?id=10038
Summary REGRESSION: Length of navigator.mimeTypes collection returns number of instal...
Brian Ellis
Reported 2006-07-20 19:15:36 PDT
(This bug is a regression from Safari 419.3.) The "navigator.mimeTypes" collection is supposed to store a list of all registered MIME types for which the browser has a handler.  In the nightly WebKit builds, however, querying the length of this collection in the WebKit nightly returns the length of the navigator.plugins collection instead. Since this is typically much less than the number of registered MIME types, a script looping over all the registered types will only access the first n of them, where n is the number of installed plugins.  Attempting to access out-of-bounds indices that are within the bounds of the actual array does work as expected: >> navigator.mimeTypes.length << 14 >> navigator.mimeTypes[70] << "audio/x-aiff" which leads me to believe that it's simply the wrong length being returned. REDUCTION: The URL for this bug points to a simple reduction of the bug, using Safari's "Help > Installed Plug-ins" page is a template.  Scroll to the bottom to see the incorrect behavior. As this will cripple any script attempting to loop over all the installed plugins (as Apple's own plugin example does), this bug is considered a critical one.
Attachments
The bug reduction linked to in the URL, in case a local copy is preferable. (5.47 KB, text/html)
2006-07-20 19:18 PDT, Brian Ellis
no flags
proposed fix (4.57 KB, patch)
2006-07-21 13:54 PDT, Alexey Proskuryakov
darin: review+
Brian Ellis
Comment 1 2006-07-20 19:18:25 PDT
Created attachment 9588 [details] The bug reduction linked to in the URL, in case a local copy is preferable.
Alexey Proskuryakov
Comment 2 2006-07-20 21:38:49 PDT
Regression->P1
Alexey Proskuryakov
Comment 3 2006-07-21 13:54:46 PDT
Created attachment 9604 [details] proposed fix
Darin Adler
Comment 4 2006-07-21 15:30:19 PDT
Comment on attachment 9604 [details] proposed fix r=me
Alexey Proskuryakov
Comment 5 2006-07-22 00:38:26 PDT
Committed revision 15573.
Note You need to log in before you can comment on or make changes to this bug.