diff --git a/mozilla/allmakefiles.sh b/mozilla/allmakefiles.sh index 11b99649b1a..60abfe8a1f4 100755 --- a/mozilla/allmakefiles.sh +++ b/mozilla/allmakefiles.sh @@ -1543,6 +1543,14 @@ for extension in $MOZ_EXTENSIONS; do extensions/python/xpcom/test/Makefile extensions/python/xpcom/test/test_component/Makefile " ;; + python/dom ) MAKEFILES_extensions="$MAKEFILES_extensions + extensions/python/dom/Makefile + extensions/python/dom/test/Makefile + extensions/python/dom/test/pyxultest/Makefile + extensions/python/dom/src/Makefile + extensions/python/dom/nsdom/Makefile + extensions/python/dom/nsdom/test/Makefile + " ;; sql ) MAKEFILES_extensions="$MAKEFILES_extensions $MAKEFILES_sql" ;; diff --git a/mozilla/caps/src/nsScriptSecurityManager.cpp b/mozilla/caps/src/nsScriptSecurityManager.cpp index eadec6d6774..4b76da9df62 100644 --- a/mozilla/caps/src/nsScriptSecurityManager.cpp +++ b/mozilla/caps/src/nsScriptSecurityManager.cpp @@ -81,6 +81,7 @@ #include "nsIObserverService.h" #include "nsIContent.h" #include "nsAutoPtr.h" +#include "nsDOMJSUtils.h" #include "nsAboutProtocolUtils.h" #include "nsIClassInfo.h" #include "nsIURIFixup.h" diff --git a/mozilla/configure.in b/mozilla/configure.in index ba0760795b9..94db5e00615 100644 --- a/mozilla/configure.in +++ b/mozilla/configure.in @@ -4029,7 +4029,7 @@ MOZ_PREF_EXTENSIONS=1 MOZ_PROFILELOCKING=1 MOZ_PROFILESHARING=1 MOZ_PSM=1 -MOZ_PYTHON_EXTENSIONS="xpcom" +MOZ_PYTHON_EXTENSIONS="xpcom dom" MOZ_PYTHON= MOZ_PYTHON_DEBUG_SUFFIX= MOZ_PYTHON_DLL_SUFFIX= @@ -7088,7 +7088,7 @@ if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then fi if test "$OS_ARCH" = "WINNT"; then dnl Convert to cygwin style "mixed" (ie, "c:/path/file.exe") - PYTHON=`cygpath -t mixed $PYTHON` + PYTHON=`$CYGPATH_W $PYTHON | $CYGPATH_S` fi if test ! -x "$PYTHON"; then AC_MSG_ERROR([Could not find Python - please adjust your PATH, or set PYTHON.]) @@ -7103,7 +7103,7 @@ if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then MOZ_PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"` dnl Setup the include and library directories. if test "$OS_ARCH" = "WINNT"; then - MOZ_PYTHON_PREFIX=`cygpath -t mixed $MOZ_PYTHON_PREFIX` + MOZ_PYTHON_PREFIX=`$CYGPATH_W $MOZ_PYTHON_PREFIX | $CYGPATH_S` dnl Source trees have "include" and "PC" for .h, and "PCbuild" for .lib dnl Binary trees have "include" for .h, and "libs" for .lib dnl We add 'em both - along with quotes, to handle spaces. @@ -7153,7 +7153,18 @@ if test `echo "$MOZ_EXTENSIONS" | grep -c python` -ne 0; then fi AC_MSG_RESULT(Building Python extensions using python-$MOZ_PYTHON_VER_DOTTED from $MOZ_PYTHON_PREFIX) fi -dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified, but not necessary now. + +dnl If the user asks for the 'python' extension, then we add +dnl MOZ_PYTHON_EXTENSIONS to MOZ_EXTENSIONS - but with the leading 'python/' +dnl Note the careful regex - it must match 'python' followed by anything +dnl other than a '/', including the end-of-string. +if test `echo "$MOZ_EXTENSIONS" | grep -c 'python\([[^/]]\|$\)'` -ne 0; then + for pyext in $MOZ_PYTHON_EXTENSIONS; do + MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS python/$pyext` + done +fi +dnl Later we may allow MOZ_PYTHON_EXTENSIONS to be specified on the +dnl command-line, but not yet AC_SUBST(MOZ_PYTHON_EXTENSIONS) AC_SUBST(MOZ_PYTHON) AC_SUBST(MOZ_PYTHON_PREFIX) diff --git a/mozilla/content/base/public/nsContentUtils.h b/mozilla/content/base/public/nsContentUtils.h index 12ef8d6cefa..52278ac927b 100644 --- a/mozilla/content/base/public/nsContentUtils.h +++ b/mozilla/content/base/public/nsContentUtils.h @@ -573,11 +573,13 @@ public: } /** - * Returns the appropriate event argument name for the specified - * namespace. Added because we need to switch between SVG's "evt" - * and the rest of the world's "event". + * Returns the appropriate event argument names for the specified + * namespace and event name. Added because we need to switch between + * SVG's "evt" and the rest of the world's "event", and because onerror + * takes 3 args. */ - static const char *GetEventArgName(PRInt32 aNameSpaceID); + static void GetEventArgNames(PRInt32 aNameSpaceID, nsIAtom *aEventName, + PRUint32 *aArgCount, const char*** aArgNames); /** * Return the nsIXPConnect service. diff --git a/mozilla/content/base/public/nsIContent.h b/mozilla/content/base/public/nsIContent.h index 1e409e70c16..cf55d5cc1fc 100644 --- a/mozilla/content/base/public/nsIContent.h +++ b/mozilla/content/base/public/nsIContent.h @@ -42,6 +42,7 @@ #include "nsCaseTreatment.h" #include "nsChangeHint.h" #include "nsINode.h" +#include "nsIProgrammingLanguage.h" // for ::JAVASCRIPT // Forward declarations class nsIAtom; @@ -60,8 +61,8 @@ class nsAttrName; // IID for the nsIContent interface #define NS_ICONTENT_IID \ -{ 0x67b73e9b, 0x6ec8, 0x4f20, \ - { 0x89, 0xb2, 0xb1, 0x46, 0x9e, 0x0a, 0x51, 0x68 } } +{ 0x469b2ce5, 0x3e00, 0x45e0, \ + { 0x9c, 0x6e, 0x4e, 0x80, 0xfb, 0x27, 0x59, 0x7d } } // hack to make egcs / gcc 2.95.2 happy class nsIContent_base : public nsINode { @@ -614,6 +615,19 @@ public: return 0; } + /* The default script type (language) ID for this content. + All content must support fetching the default script language. + */ + virtual PRUint32 GetScriptTypeID() const + { return nsIProgrammingLanguage::JAVASCRIPT; } + + /* Not all content supports setting a new default language */ + virtual nsresult SetScriptTypeID(PRUint32 aLang) + { + NS_NOTREACHED("SetScriptTypeID not implemented"); + return NS_ERROR_NOT_IMPLEMENTED; + } + /** * Clones this node, using aNodeInfoManager to get the nodeinfo for the * clone. When cloning an element, all attributes of the element will be diff --git a/mozilla/content/base/public/nsINode.h b/mozilla/content/base/public/nsINode.h index aac66047bc0..460b2bbf2a6 100644 --- a/mozilla/content/base/public/nsINode.h +++ b/mozilla/content/base/public/nsINode.h @@ -79,8 +79,11 @@ class nsVoidArray; // NOTE: Should only be used on nsIContent nodes #define NODE_MAY_HAVE_FRAME 0x00000020U +// Four bits for the script-type ID +#define NODE_SCRIPT_TYPE_OFFSET 6 + // Remaining bits are node type specific. -#define NODE_TYPE_SPECIFIC_BITS_OFFSET 6 +#define NODE_TYPE_SPECIFIC_BITS_OFFSET 0x0a // IID for the nsINode interface #define NS_INODE_IID \ diff --git a/mozilla/content/base/src/nsContentUtils.cpp b/mozilla/content/base/src/nsContentUtils.cpp index fc152a2d066..9c59a46a572 100644 --- a/mozilla/content/base/src/nsContentUtils.cpp +++ b/mozilla/content/base/src/nsContentUtils.cpp @@ -2198,17 +2198,34 @@ nsContentUtils::UnregisterPrefCallback(const char *aPref, } -static const char gEventName[] = "event"; -static const char gSVGEventName[] = "evt"; +static const char *gEventNames[] = {"event"}; +static const char *gSVGEventNames[] = {"evt"}; +// for b/w compat, the first name to onerror is still 'event', even though it +// is actually the error message. (pre this code, the other 2 were not avail.) +// XXXmarkh - a quick lxr shows no affected code - should we correct this? +static const char *gOnErrorNames[] = {"event", "source", "lineno"}; // static -const char * -nsContentUtils::GetEventArgName(PRInt32 aNameSpaceID) +void +nsContentUtils::GetEventArgNames(PRInt32 aNameSpaceID, + nsIAtom *aEventName, + PRUint32 *aArgCount, + const char*** aArgArray) { - if (aNameSpaceID == kNameSpaceID_SVG) - return gSVGEventName; +#define SET_EVENT_ARG_NAMES(names) \ + *aArgCount = sizeof(names)/sizeof(names[0]); \ + *aArgArray = names; - return gEventName; + // nsJSEventListener is what does the arg magic for onerror, and it does + // not seem to take the namespace into account. So we let onerror in all + // namespaces get the 3 arg names. + if (aEventName == nsLayoutAtoms::onerror) { + SET_EVENT_ARG_NAMES(gOnErrorNames); + } else if (aNameSpaceID == kNameSpaceID_SVG) { + SET_EVENT_ARG_NAMES(gSVGEventNames); + } else { + SET_EVENT_ARG_NAMES(gEventNames); + } } nsCxPusher::nsCxPusher(nsISupports *aCurrentTarget) diff --git a/mozilla/content/base/src/nsCopySupport.cpp b/mozilla/content/base/src/nsCopySupport.cpp index dd5165b9d2b..453fadd2081 100644 --- a/mozilla/content/base/src/nsCopySupport.cpp +++ b/mozilla/content/base/src/nsCopySupport.cpp @@ -215,11 +215,8 @@ nsresult nsCopySupport::HTMLCopy(nsISelection *aSel, nsIDocument *aDoc, PRInt16 // Add the URL DataFlavor to the transferable. Don't use kURLMime, as it will // cause an unnecessary UniformResourceLocator to be added which confuses - // some apps eg. Outlook 2000 - (See Bug 315370). Don't use - // kURLDataMime, as it will cause a bogus 'url ' flavor to - // show up on the Mac clipboard, confusing other apps, like - // Terminal (see bug 336012). - rv = AppendString(trans, shortcut, kURLPrivateMime); + // some apps eg. Outlook 2000 - (See Bug 315370) + rv = AppendString(trans, shortcut, kURLDataMime ); NS_ENSURE_SUCCESS(rv, rv); } } diff --git a/mozilla/content/base/src/nsDOMParser.cpp b/mozilla/content/base/src/nsDOMParser.cpp index 83dd6407ec7..f3851efe272 100644 --- a/mozilla/content/base/src/nsDOMParser.cpp +++ b/mozilla/content/base/src/nsDOMParser.cpp @@ -65,6 +65,7 @@ #include "nsThreadUtils.h" #include "nsNetCID.h" #include "nsContentUtils.h" +#include "nsDOMJSUtils.h" static const char* kLoadAsData = "loadAsData"; diff --git a/mozilla/content/base/src/nsDocument.cpp b/mozilla/content/base/src/nsDocument.cpp index 33384135737..93a2df2c89e 100644 --- a/mozilla/content/base/src/nsDocument.cpp +++ b/mozilla/content/base/src/nsDocument.cpp @@ -58,6 +58,7 @@ #include "nsIBaseWindow.h" #include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" +#include "nsIScriptRuntime.h" #include "nsCOMArray.h" #include "nsGUIEvent.h" @@ -1373,7 +1374,23 @@ nsDocument::SetHeaderData(nsIAtom* aHeaderField, const nsAString& aData) if (aHeaderField == nsHTMLAtoms::headerContentLanguage) { CopyUTF16toUTF8(aData, mContentLanguage); } - + + // Set the default script-type on the root element. + if (aHeaderField == nsHTMLAtoms::headerContentScriptType) { + nsIContent *root = GetRootContent(); + if (root) { + // Get the script-type ID for this value. + nsresult rv; + nsCOMPtr runtime; + rv = NS_GetScriptRuntime(aData, getter_AddRefs(runtime)); + if (NS_FAILED(rv) || runtime == nsnull) { + NS_WARNING("The script-type is unknown"); + } else { + root->SetScriptTypeID(runtime->GetScriptTypeID()); + } + } + } + if (aHeaderField == nsHTMLAtoms::headerDefaultStyle) { // switch alternate style sheets based on default // XXXldb What if we don't have all the sheets yet? Should this use @@ -5097,3 +5114,17 @@ nsDocument::UpdateLinkMap() } mVisitednessChangedURIs.Clear(); } + +NS_IMETHODIMP +nsDocument::GetScriptTypeID(PRUint32 *aScriptType) +{ + NS_ERROR("No default script type here - ask some element"); + return nsIProgrammingLanguage::UNKNOWN; +} + +NS_IMETHODIMP +nsDocument::SetScriptTypeID(PRUint32 aScriptType) +{ + NS_ERROR("Can't change default script type for a document"); + return NS_ERROR_NOT_IMPLEMENTED; +} diff --git a/mozilla/content/base/src/nsGenericElement.cpp b/mozilla/content/base/src/nsGenericElement.cpp index 5b3f4c03d4f..93680a85bd3 100644 --- a/mozilla/content/base/src/nsGenericElement.cpp +++ b/mozilla/content/base/src/nsGenericElement.cpp @@ -855,6 +855,20 @@ nsDOMEventRTTearoff::GetSystemEventGroup(nsIDOMEventGroup **aGroup) return manager->GetSystemEventGroupLM(aGroup); } +NS_IMETHODIMP +nsDOMEventRTTearoff::GetScriptTypeID(PRUint32 *aLang) +{ + *aLang = mContent->GetScriptTypeID(); + return NS_OK; +} + +NS_IMETHODIMP +nsDOMEventRTTearoff::SetScriptTypeID(PRUint32 aLang) +{ + return mContent->SetScriptTypeID(aLang); +} + + // nsIDOMEventTarget NS_IMETHODIMP nsDOMEventRTTearoff::AddEventListener(const nsAString& aType, @@ -985,6 +999,9 @@ nsGenericElement::nsDOMSlots::IsEmpty() nsGenericElement::nsGenericElement(nsINodeInfo *aNodeInfo) : nsIXMLContent(aNodeInfo) { + // Set the default scriptID to JS - but skip SetScriptTypeID as it + // does extra work we know isn't necessary here... + SetFlags(nsIProgrammingLanguage::JAVASCRIPT << NODE_SCRIPT_TYPE_OFFSET); } nsGenericElement::~nsGenericElement() @@ -2301,6 +2318,29 @@ nsGenericElement::MayHaveFrame() const return HasFlag(NODE_MAY_HAVE_FRAME); } +PRUint32 +nsGenericElement::GetScriptTypeID() const +{ + PtrBits flags = GetFlags(); + + /* 4 bits reserved for script-type ID. */ + return (flags >> NODE_SCRIPT_TYPE_OFFSET) & 0x000F; +} + +nsresult +nsGenericElement::SetScriptTypeID(PRUint32 aLang) +{ + if ((aLang & 0x000F) != aLang) { + NS_ERROR("script ID too large!"); + return NS_ERROR_FAILURE; + } + /* SetFlags will just mask in the specific flags set, leaving existing + ones alone. So we must clear all the bits first */ + UnsetFlags(0x000FU << NODE_SCRIPT_TYPE_OFFSET); + SetFlags(aLang << NODE_SCRIPT_TYPE_OFFSET); + return NS_OK; +} + nsresult nsGenericElement::InsertChildAt(nsIContent* aKid, PRUint32 aIndex, @@ -3128,7 +3168,8 @@ nsGenericElement::TriggerLink(nsPresContext* aPresContext, nsresult nsGenericElement::AddScriptEventListener(nsIAtom* aEventName, - const nsAString& aValue) + const nsAString& aValue, + PRBool aDefer) { NS_PRECONDITION(aEventName, "Must have event name!"); nsCOMPtr target; @@ -3143,8 +3184,11 @@ nsGenericElement::AddScriptEventListener(nsIAtom* aEventName, if (manager) { nsIDocument *ownerDoc = GetOwnerDoc(); + defer = defer && aDefer; // only defer if everyone agrees... + + PRUint32 lang = GetScriptTypeID(); rv = - manager->AddScriptEventListener(target, aEventName, aValue, defer, + manager->AddScriptEventListener(target, aEventName, aValue, lang, defer, !nsContentUtils::IsChromeDoc(ownerDoc)); } diff --git a/mozilla/content/base/src/nsGenericElement.h b/mozilla/content/base/src/nsGenericElement.h index 4e495aa336c..97272e0c2ac 100644 --- a/mozilla/content/base/src/nsGenericElement.h +++ b/mozilla/content/base/src/nsGenericElement.h @@ -373,6 +373,9 @@ public: virtual void SetMayHaveFrame(PRBool aMayHaveFrame); virtual PRBool MayHaveFrame() const; + virtual PRUint32 GetScriptTypeID() const; + virtual nsresult SetScriptTypeID(PRUint32 aLang); + /** * This calls Clone to do the actual cloning so that we end up with the * right class for the clone. @@ -487,9 +490,11 @@ public: * (like onclick) and with the value as JS * @param aEventName the event listener name * @param aValue the JS to attach + * @param aDefer indicates if deferred execution is allowed */ nsresult AddScriptEventListener(nsIAtom* aEventName, - const nsAString& aValue); + const nsAString& aValue, + PRBool aDefer = PR_TRUE); /** * Trigger a link with uri aLinkURI. If aClick is false, this triggers a diff --git a/mozilla/content/base/src/nsParserUtils.cpp b/mozilla/content/base/src/nsParserUtils.cpp index a60dc97931a..654cc67ad4d 100644 --- a/mozilla/content/base/src/nsParserUtils.cpp +++ b/mozilla/content/base/src/nsParserUtils.cpp @@ -172,7 +172,7 @@ nsParserUtils::GetQuotedAttributeValue(const nsString& aSource, nsIAtom *aName, // Returns PR_TRUE if the language name is a version of JavaScript and // PR_FALSE otherwise PRBool -nsParserUtils::IsJavaScriptLanguage(const nsString& aName, const char* *aVersion) +nsParserUtils::IsJavaScriptLanguage(const nsString& aName, PRUint32 *aFlags) { JSVersion version = JSVERSION_UNKNOWN; @@ -204,7 +204,7 @@ nsParserUtils::IsJavaScriptLanguage(const nsString& aName, const char* *aVersion } if (version == JSVERSION_UNKNOWN) return PR_FALSE; - *aVersion = JS_VersionToString(version); + *aFlags = version; return PR_TRUE; } diff --git a/mozilla/content/base/src/nsParserUtils.h b/mozilla/content/base/src/nsParserUtils.h index 3b25b71ccc2..aa63ccbe15a 100644 --- a/mozilla/content/base/src/nsParserUtils.h +++ b/mozilla/content/base/src/nsParserUtils.h @@ -63,7 +63,7 @@ public: nsAString& aValue); static PRBool - IsJavaScriptLanguage(const nsString& aName, const char* *aVersion); + IsJavaScriptLanguage(const nsString& aName, PRUint32 *aVerFlags); static void SplitMimeType(const nsAString& aValue, nsString& aType, diff --git a/mozilla/content/base/src/nsScriptLoader.cpp b/mozilla/content/base/src/nsScriptLoader.cpp index 6c35e3ab3b1..5286e599020 100644 --- a/mozilla/content/base/src/nsScriptLoader.cpp +++ b/mozilla/content/base/src/nsScriptLoader.cpp @@ -52,6 +52,7 @@ #include "nsNetUtil.h" #include "nsIScriptGlobalObject.h" #include "nsIScriptContext.h" +#include "nsIScriptRuntime.h" #include "nsIScriptSecurityManager.h" #include "nsIPrincipal.h" #include "nsContentPolicyUtils.h" @@ -60,7 +61,7 @@ #include "nsIScriptElement.h" #include "nsIDOMHTMLScriptElement.h" #include "nsIDocShell.h" -#include "jsapi.h" +#include "jscntxt.h" #include "nsContentUtils.h" #include "nsUnicharUtils.h" #include "nsAutoPtr.h" @@ -117,8 +118,7 @@ class nsScriptLoadRequest : public nsISupports { public: nsScriptLoadRequest(nsIScriptElement* aElement, nsIScriptLoaderObserver* aObserver, - const char* aVersionString, - PRBool aHasE4XOption); + PRUint32 aVersion); virtual ~nsScriptLoadRequest(); NS_DECL_ISUPPORTS @@ -132,21 +132,19 @@ public: PRPackedBool mLoading; // Are we still waiting for a load to complete? PRPackedBool mWasPending; // Processed immediately or pending PRPackedBool mIsInline; // Is the script inline or loaded? - PRPackedBool mHasE4XOption; // Has E4X=1 script type parameter nsString mScriptText; // Holds script for loaded scripts - const char* mJSVersion; // We don't own this string + PRUint32 mJSVersion; nsCOMPtr mURI; PRInt32 mLineNo; }; nsScriptLoadRequest::nsScriptLoadRequest(nsIScriptElement* aElement, nsIScriptLoaderObserver* aObserver, - const char* aVersionString, - PRBool aHasE4XOption) : + PRUint32 aVersion) : mElement(aElement), mObserver(aObserver), mLoading(PR_TRUE), mWasPending(PR_FALSE), - mIsInline(PR_TRUE), mHasE4XOption(aHasE4XOption), - mJSVersion(aVersionString), mLineNo(1) + mIsInline(PR_TRUE), + mJSVersion(aVersion), mLineNo(1) { } @@ -382,10 +380,16 @@ nsScriptLoader::DoProcessScriptElement(nsIScriptElement *aElement, // Script evaluation can also be disabled in the current script // context even though it's enabled in the document. + // XXX - still hard-coded for JS here, even though another language + // may be specified. Should this check be made *after* we examine + // the attributes to locate the script-type? + // For now though, if JS is disabled we assume every language is + // disabled. nsIScriptGlobalObject *globalObject = mDocument->GetScriptGlobalObject(); if (globalObject) { - nsIScriptContext *context = globalObject->GetContext(); + nsIScriptContext *context = globalObject->GetScriptContext( + nsIProgrammingLanguage::JAVASCRIPT); // If scripts aren't enabled in the current context, there's no // point in going on. @@ -394,35 +398,15 @@ nsScriptLoader::DoProcessScriptElement(nsIScriptElement *aElement, } } - PRBool isJavaScript = PR_TRUE; - PRBool hasE4XOption = PR_FALSE; - const char* jsVersionString = nsnull; + // Default script language is whatever the root content specifies + // (which may come from a header or http-meta tag) + PRUint32 typeID = mDocument->GetRootContent()->GetScriptTypeID(); + PRUint32 version = 0; nsAutoString language, type, src; - - // "language" is a deprecated attribute of HTML, so we check it only for - // HTML script elements. - nsCOMPtr htmlScriptElement = - do_QueryInterface(aElement); - if (htmlScriptElement) { - // Check the language attribute first, so type can trump language. - htmlScriptElement->GetAttribute(NS_LITERAL_STRING("language"), language); - if (!language.IsEmpty()) { - isJavaScript = nsParserUtils::IsJavaScriptLanguage(language, - &jsVersionString); - - // IE, Opera, etc. do not respect language version, so neither should - // we at this late date in the browser wars saga. Note that this change - // affects HTML but not XUL or SVG (but note also that XUL has its own - // code to check nsParserUtils::IsJavaScriptLanguage -- that's probably - // a separate bug, one we may not be able to fix short of XUL2). See - // bug 255895 (https://bugzilla.mozilla.org/show_bug.cgi?id=255895). - jsVersionString = ::JS_VersionToString(JSVERSION_DEFAULT); - } - } - nsresult rv = NS_OK; // Check the type attribute to determine language and version. + // If type exists, it trumps the deprecated 'language=' aElement->GetScriptType(type); if (!type.IsEmpty()) { nsCOMPtr mimeHdrParser = @@ -437,6 +421,7 @@ nsScriptLoader::DoProcessScriptElement(nsIScriptElement *aElement, mimeType); NS_ENSURE_SUCCESS(rv, rv); + // Javascript keeps the fast path, optimized for most-likely type // Table ordered from most to least likely JS MIME types. // See bug 62485, feel free to add