Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number
of registered mime types
Test: fast/js/navigator-mimeTypes-length.html
* bindings/js/kjs_navigator.cpp:
(KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
(KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
from even being called.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15573
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-07-22 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Darin.
+
+ Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
+ REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number
+ of registered mime types
+
+ * fast/js/navigator-mimeTypes-length-expected.txt: Added.
+ * fast/js/navigator-mimeTypes-length.html: Added.
+ * fast/js/resources/navigator-mimeTypes-length.js: Added.
+
2006-07-21 Adele Peterson <adele@apple.com>
Reviewed by Darin.
--- /dev/null
+Test for bug 10038: REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number of registered mime types.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS navigator.mimeTypes.length > navigator.plugins.length is true
+PASS navigator.mimeTypes[navigator.mimeTypes.length+1] is undefined
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/navigator-mimeTypes-length.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
--- /dev/null
+description(
+"Test for bug 10038: REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number of registered mime types."
+);
+
+shouldBeTrue("navigator.mimeTypes.length > navigator.plugins.length");
+shouldBe("navigator.mimeTypes[navigator.mimeTypes.length+1]", "undefined");
+
+successfullyParsed = true;
+2006-07-22 Alexey Proskuryakov <ap@nypop.com>
+
+ Reviewed by Darin.
+
+ Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
+ REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number
+ of registered mime types
+
+ * bindings/js/kjs_navigator.cpp:
+ (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
+ (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
+ from even being called.
+
2006-07-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adele and Tim Omernick.
JSValue *MimeTypes::getValueProperty(ExecState *exec, int token) const
{
assert(token == Length);
- return jsNumber(plugins->size());
+ return jsNumber(mimes->size());
}
JSValue *MimeTypes::indexGetter(ExecState *exec, JSObject *originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
const HashEntry* entry = Lookup::findEntry(&MimeTypesTable, propertyName);
if (entry) {
- slot.setStaticEntry(this, entry, staticValueGetter<Plugins>);
+ slot.setStaticEntry(this, entry, staticValueGetter<MimeTypes>);
return true;
} else {
// mimeTypes[#]