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

Side by Side Diff: Source/core/dom/ScriptLoader.cpp

Issue 122743002: MIME type predicates and case-insensitive matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Simplify check for empty +xml subtype Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/DOMImplementationTest.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // - Allowing a different set of languages for language= and type=. language = supports Javascript 1.1 and 1.4-1.6, but type= does not. 152 // - Allowing a different set of languages for language= and type=. language = supports Javascript 1.1 and 1.4-1.6, but type= does not.
153 153
154 String type = client()->typeAttributeValue(); 154 String type = client()->typeAttributeValue();
155 String language = client()->languageAttributeValue(); 155 String language = client()->languageAttributeValue();
156 if (type.isEmpty() && language.isEmpty()) 156 if (type.isEmpty() && language.isEmpty())
157 return true; // Assume text/javascript. 157 return true; // Assume text/javascript.
158 if (type.isEmpty()) { 158 if (type.isEmpty()) {
159 type = "text/" + language.lower(); 159 type = "text/" + language.lower();
160 if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type) || isLegacySup portedJavaScriptLanguage(language)) 160 if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type) || isLegacySup portedJavaScriptLanguage(language))
161 return true; 161 return true;
162 } else if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSp ace().lower()) || (supportLegacyTypes == AllowLegacyTypeInTypeAttribute && isLeg acySupportedJavaScriptLanguage(type))) { 162 } else if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSp ace()) || (supportLegacyTypes == AllowLegacyTypeInTypeAttribute && isLegacySuppo rtedJavaScriptLanguage(type))) {
163 return true; 163 return true;
164 } 164 }
165 165
166 return false; 166 return false;
167 } 167 }
168 168
169 // http://dev.w3.org/html5/spec/Overview.html#prepare-a-script 169 // http://dev.w3.org/html5/spec/Overview.html#prepare-a-script
170 bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition, Legacy TypeSupport supportLegacyTypes) 170 bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition, Legacy TypeSupport supportLegacyTypes)
171 { 171 {
172 if (m_alreadyStarted) 172 if (m_alreadyStarted)
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 if (isHTMLScriptLoader(element)) 449 if (isHTMLScriptLoader(element))
450 return toHTMLScriptElement(element)->loader(); 450 return toHTMLScriptElement(element)->loader();
451 451
452 if (isSVGScriptLoader(element)) 452 if (isSVGScriptLoader(element))
453 return toSVGScriptElement(element)->loader(); 453 return toSVGScriptElement(element)->loader();
454 454
455 return 0; 455 return 0;
456 } 456 }
457 457
458 } 458 }
OLDNEW
« no previous file with comments | « Source/core/dom/DOMImplementationTest.cpp ('k') | Source/core/inspector/InspectorPageAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698