Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: components/mime_util/mime_util.cc

Issue 2135753002: Update supported javascript mimetypes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment language slightly Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/html/script-allowed-types-languages.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mime_util/mime_util.cc
diff --git a/components/mime_util/mime_util.cc b/components/mime_util/mime_util.cc
index 06f9b523783ee4f6e4bddb93eb4d8dc558b76e4d..5f4cf3ffbe4b4f70cfc83833a7e54a7e57d28ef1 100644
--- a/components/mime_util/mime_util.cc
+++ b/components/mime_util/mime_util.cc
@@ -36,26 +36,27 @@ const char* const kSupportedImageTypes[] = {"image/jpeg",
"image/x-xbitmap", // xbm
"image/x-png"};
-// Mozilla 1.8 and WinIE 7 both accept text/javascript and text/ecmascript.
-// Mozilla 1.8 accepts application/javascript, application/ecmascript, and
-// application/x-javascript, but WinIE 7 doesn't.
-// WinIE 7 accepts text/javascript1.1 - text/javascript1.3, text/jscript, and
-// text/livescript, but Mozilla 1.8 doesn't.
-// Mozilla 1.8 allows leading and trailing whitespace, but WinIE 7 doesn't.
-// Mozilla 1.8 and WinIE 7 both accept the empty string, but neither accept a
-// whitespace-only string.
-// We want to accept all the values that either of these browsers accept, but
-// not other values.
-const char* const kSupportedJavascriptTypes[] = {"text/javascript",
- "text/ecmascript",
- "application/javascript",
- "application/ecmascript",
- "application/x-javascript",
- "text/javascript1.1",
- "text/javascript1.2",
- "text/javascript1.3",
- "text/jscript",
- "text/livescript"};
+// Support every script type mentioned in the spec, as it notes that "User
+// agents must recognize all JavaScript MIME types." See
+// https://html.spec.whatwg.org/#javascript-mime-type.
+const char* const kSupportedJavascriptTypes[] = {
+ "application/ecmascript",
+ "application/javascript",
+ "application/x-ecmascript",
+ "application/x-javascript",
+ "text/ecmascript",
+ "text/javascript",
+ "text/javascript1.0",
+ "text/javascript1.1",
+ "text/javascript1.2",
+ "text/javascript1.3",
+ "text/javascript1.4",
+ "text/javascript1.5",
+ "text/jscript",
+ "text/livescript",
+ "text/x-ecmascript",
+ "text/x-javascript",
+};
// These types are excluded from the logic that allows all text/ types because
// while they are technically text, it's very unlikely that a user expects to
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/html/script-allowed-types-languages.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698