<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195951] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195951">195951</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-01-31 21:46:20 -0800 (Sun, 31 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
https://bugs.webkit.org/show_bug.cgi?id=153732

Reviewed by Dean Jackson.

Source/WebCore:

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::isTypeSupported): Added comment about mysterious call
to lower(); should probably return here and remove it.

* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::initProtocolHandlerWhitelist): Deleted. Moved into isProtocolWhitelisted.
(WebCore::isProtocolWhitelisted): Changed set to be ASCIICaseInsensitiveHash and
initialized it using a lambda instead of a separate function.
(WebCore::verifyProtocolHandlerScheme): Added a FIXME about some case sensitive
checking of the protocol prefix here.

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::supportsMimeType): Changed set to be
ASCIICaseInsensitiveHash and initialized it using a lambda instead of using
an explict check for empty.
(WebCore::QuickTimePluginReplacement::supportsFileExtension): Ditto.

* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::queryKeysAndValues): Use convertToASCIILowercase. The keys here are
going to be all ASCII.
(WebCore::isYouTubeURL): Use equalLettersIgnoringASCIICase instead of lowercasing
the string.
(WebCore::processAndCreateYouTubeURL): Use url.protocolIsInHTTPFamily instead of
listing &quot;http&quot; and then &quot;https&quot; explicitly. Use equalLettersIgnoringASCIICase
instead of lowercasing a string.
(WebCore::YouTubePluginReplacement::youTubeURL): Ditto.

* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::hostName): Use convertToASCIILowercase on host name.
(WebCore::WebSocketHandshake::host): Ditto.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes): Call convertToASCIILowercase instead of lower
to lowercase an element's tag name. This is a strange way to do things; typically
would be better to use some other function on Element, since tagName goes out of
its way to be capitalized, but some ATK expert can improve this later.

* css/CSSGrammar.y.in: Use the new convertToASCIILowercaseInPlace function rather
than the old lower function. We only need to lowercase the ASCII letters, and it's
also better to have the function have a clearer name.

* css/CSSParser.cpp:
(WebCore::convertToASCIILowercaseInPlace): Renamed from makeLower and made it deal
with only ASCII lowercasing.
(WebCore::CSSParserString::convertToASCIILowercaseInPlace): Renamed from lower.
(WebCore::isUniversalKeyword): Added. Helper for the function below that uses
equalLettersIgnoringASCIICase rather than lowercasing the string.
(WebCore::parseKeywordValue): Use isUniversalKeyword. Also clarified a comment.
(WebCore::CSSParser::parseAttr): Use convertToASCIILowercaseInPlace and delay
String creation until later in the function, using CSSParserString operations more.

* css/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementSelector): Use
convertToASCIILowercaseInPlace by its new name, with its new behavior.

* css/CSSParserValues.h: Tweaked comment and formatting a bit. Replaced the lower
function with the convertToASCIILowercaseInPlace function.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::RareData::parseNth): Rewrote this to avoid the need to
make a lowercased copy of m_argument. Use equalLettersIgnoringASCIICase, and two
calls to find. Also use String::toIntStrict so we don't have to create String
objects for substrings.

* css/MediaQuery.cpp:
(WebCore::MediaQuery::MediaQuery): Use convertToASCIILowercase for media type name.
* css/MediaQueryExp.cpp:
(WebCore::MediaQueryExp::serialize): Use convertToASCIILowercase for media feature name.

* dom/Document.cpp:
(WebCore::isSeparator): Tweaked formatting and removed non-helpful comment.
(WebCore::processArguments): Changed this from a static member function to a non-member
file internal function. Use a std::function instead of a function pointer with a void*
pointer. Rewrote algorithm to simplify it and use StringView instead of String for the
keys and values.
(WebCore::Document::processViewport): Use a lambda instead of a function pointer to
call setViewportFeature, so that function's interface is no longer dictated by
the exact type of the function pointer argument to processArguments.
(WebCore::Document::processFormatDetection): Use a lambda instead of the
setParserFeature function above; use equalLettersIgnoringASCIICase for both the
key and the value, since processArguments no longer lowercases the string.
(WebCore::Document::processArguments): Deleted.

* dom/Document.h: Removed unnecessary declaration of processArguments and
ArgumentsCallback. Both are now private to the cpp file.

* dom/Element.cpp:
(WebCore::makeIdForStyleResolution): Use convertToASCIILowercase. When in quirks mode,
we want to match IDs in an ASCII case-insensitive way not match compatibility caseless.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::isScriptTypeSupported): Remove the use of lower here since
the MIME type registry is now itself ASCII case-insensitive.

* dom/ViewportArguments.cpp:
(WebCore::numericPrefix): Changed to use StringView and take a Document&amp;, rearranged
argument order so Document&amp; comes first.
(WebCore::findSizeValue): Ditto.
(WebCore::findScaleValue): Ditto.
(WebCore::findBooleanValue): Ditto. Also use std::abs instead of fabs, possibly
avoiding a conversion from float to double (not sure it was happening before but it's
definitely not happening now).
(WebCore::setViewportFeature): Changed to put arguments in a more logical order, to take
the ViewportArguments as a reference, not a void*, and to use StringView to avoid forcing
the caller to allocate strings. Also changed to use equalLettersIgnoringASCIICase so we
don't rely on the caller to make the key lowercase for us.
(WebCore::reportViewportWarning): Changed argument types. Added a couple comments about
mistakes in the function.

* dom/ViewportArguments.h: Removed unnecessary declaration of reportViewportWarning,
which is now private to the cpp file. Updated for new arguments to setViewportFeature.

* editing/EditorCommand.cpp:
(WebCore::executeFormatBlock): Use convertToASCIILowercase on the argument, which is
specifying a tag name.

* fileapi/Blob.cpp:
(WebCore::Blob::isValidContentType): Removed unnecessary separate loops for
8-bit and 16-bit strings. Content types are short strings and this small optimization is
not worth the additional code complexity.
(WebCore::Blob::normalizedContentType): Use convertToASCIILowercase since valid
content types are guaranteed to be all ASCII.
(WebCore::Blob::isNormalizedContentType): Removed unnecessary separate loops for
8-bit and 16-bit strings. Content types are short strings and this small optimization is
not worth the additional code complexity.

* html/parser/HTMLParserIdioms.cpp: Added now-needed include of QualifiedName.h.

* html/parser/HTMLParserIdioms.h: Removed unneeded include of QualifiedName.h and
WTFString.h. Made sure every function is declared first, even if it's also defined
later in the header in the section for functions templates and inline functions.

* loader/archive/ArchiveFactory.cpp:
(WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): Use auto&amp; for the type of
the set of MIME types here, since it's now using ASCIICaseInsensitiveHash.

* platform/MIMETypeRegistry.cpp: Changed the MIME type sets to use
ASCIICaseInsensitiveHash since MIME type are not case sensitive.
(WebCore::initializeSupportedImageMIMETypes): Use a modern for loop.
(WebCore::initializeSupportedImageMIMETypesForEncoding): Updated for HashSet type change.
(WebCore::initializePDFMIMETypes): Use a modern for loop.
(WebCore::initializeSupportedNonImageMimeTypes): Use a modern for loop.
(WebCore::initializeSupportedMediaMIMETypes): Updated for HashSet type change.
(WebCore::initializeUnsupportedTextMIMETypes): Use a modern for loop.
(WebCore::initializeMIMETypeRegistry): Updated for HashSet type change.
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Ditto.
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Ditto.
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Ditto.
(WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Ditto.
(WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Ditto.
(WebCore::MIMETypeRegistry::getPDFMIMETypes): Ditto.
(WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Ditto.
(WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Ditto.
(WebCore::mimeTypeAssociationMap): Use ASCIICaseInsensitiveHash.
(WebCore::MIMETypeRegistry::getNormalizedMIMEType): Use auto to make code tighter.

* platform/MIMETypeRegistry.h: Changed return types of the getMIMETypes functions
to use ASCIICaseInsensitiveHash.

* platform/SchemeRegistry.cpp:
(WebCore::schemesForbiddenFromDomainRelaxation): Changed type to
use ASCIICaseInsensitiveHash.

* platform/URL.cpp:
(WebCore::mimeTypeFromDataURL): Use convertToASCIILowercase instead of lower.
Also removed some dead code that tried to handle the case where the data URL
has a comma as one of the first 5 characters: That can't happen since it's a
precondition of this function that the first five characters are &quot;data:&quot;.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::getSupportedTypes): Change type of argument to
a HashSet with ASCIICaseInsensitiveHash.
* platform/graphics/MediaPlayer.h: Ditto.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
Changed type of HashSet to use ASCIICaseInsensitiveHash.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Ditto.

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::avfMIMETypes):
Changed type of HashSet to use ASCIICaseInsensitiveHash.
(WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes): Ditto.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Ditto.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
Changed type of HashSet to use ASCIICaseInsensitiveHash.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Removed
an unnecessary line of code to set a local variable to 0 just before it falls
out of scope.
(WebCore::avfMIMETypes): Ditto. Also tightened up the code a bit.
(WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Ditto.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
Changed type of HashSet to use ASCIICaseInsensitiveHash.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::mimeTypeCache): Ditto.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Ditto.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::mimeTypeCache): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.

* platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::shouldRejectMIMEType): Made this non-case-sensitive by using startsWith
and the &quot;false&quot; argument. Later change this to startsWithIgnoringASCIICase or
startsWithLettersIgnoringASCIICase.
(WebCore::addFileTypesToCache): Use ASCIICaseInsensitiveHash. ALso rewrote to
tighten up the code a bit and use modern Objective-C for loops.
(WebCore::mimeCommonTypesCache): Use ASCIICaseInsensitiveHash.
(WebCore::mimeModernTypesCache): Ditto.
(WebCore::concatenateHashSets): Ditto.
(WebCore::MediaPlayerPrivateQTKit::getSupportedTypes): Ditto.
(WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Initialied
track type set using lambda, but left it case sensitive.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::mimeTypeCache): Changed type of HashSet to use ASCIICaseInsensitiveHash.
(WebCore::MediaPlayerPrivateMediaFoundation::getSupportedTypes): Ditto.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::mimeTypeCache): Ditto.
(WebCore::MockMediaPlayerMediaSource::getSupportedTypes): Ditto.
* platform/mock/mediasource/MockMediaPlayerMediaSource.h: Ditto.

Source/WebKit/mac:

* WebView/WebHTMLRepresentation.mm:
(newArrayWithStrings): Updated to use HashSet&lt;String, ASCIICaseInsensitiveHash&gt;
and also to use a modern for loop.

Source/WTF:

* wtf/text/StringView.h: Added toIntStrict. Not thrilled about the name of this
function, but generally it seems likely to be useful more often than toInt.
And it's needed for one call site in WebCore that was using String::lower.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextStringViewh">trunk/Source/WTF/wtf/text/StringView.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediasourceMediaSourcecpp">trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilscpp">trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsYouTubePluginReplacementcpp">trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp</a></li>
<li><a href="#trunkSourceWebCoreModuleswebsocketsWebSocketHandshakecpp">trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatkWebKitAccessibleWrapperAtkcpp">trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSGrammaryin">trunk/Source/WebCore/css/CSSGrammar.y.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuescpp">trunk/Source/WebCore/css/CSSParserValues.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuesh">trunk/Source/WebCore/css/CSSParserValues.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSSelectorcpp">trunk/Source/WebCore/css/CSSSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssMediaQuerycpp">trunk/Source/WebCore/css/MediaQuery.cpp</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryExpcpp">trunk/Source/WebCore/css/MediaQueryExp.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomElementcpp">trunk/Source/WebCore/dom/Element.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptElementcpp">trunk/Source/WebCore/dom/ScriptElement.cpp</a></li>
<li><a href="#trunkSourceWebCoredomViewportArgumentscpp">trunk/Source/WebCore/dom/ViewportArguments.cpp</a></li>
<li><a href="#trunkSourceWebCoredomViewportArgumentsh">trunk/Source/WebCore/dom/ViewportArguments.h</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorCommandcpp">trunk/Source/WebCore/editing/EditorCommand.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobcpp">trunk/Source/WebCore/fileapi/Blob.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomscpp">trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlparserHTMLParserIdiomsh">trunk/Source/WebCore/html/parser/HTMLParserIdioms.h</a></li>
<li><a href="#trunkSourceWebCoreloaderarchiveArchiveFactorycpp">trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMIMETypeRegistrycpp">trunk/Source/WebCore/platform/MIMETypeRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMIMETypeRegistryh">trunk/Source/WebCore/platform/MIMETypeRegistry.h</a></li>
<li><a href="#trunkSourceWebCoreplatformSchemeRegistrycpp">trunk/Source/WebCore/platform/SchemeRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformURLcpp">trunk/Source/WebCore/platform/URL.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerh">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm">trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateMediaFoundationcpp">trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateMediaFoundationh">trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp">trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourceh">trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLRepresentationmm">trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WTF/ChangeLog        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1,5 +1,16 @@
</span><span class="cx"> 2016-01-31  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
+        https://bugs.webkit.org/show_bug.cgi?id=153732
+
+        Reviewed by Dean Jackson.
+
+        * wtf/text/StringView.h: Added toIntStrict. Not thrilled about the name of this
+        function, but generally it seems likely to be useful more often than toInt.
+        And it's needed for one call site in WebCore that was using String::lower.
+
+2016-01-31  Darin Adler  &lt;darin@apple.com&gt;
+
</ins><span class="cx">         Get rid of most calls to String::upper; mostly replace them with convertToASCIIUppercase
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=153715
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringView.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringView.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WTF/wtf/text/StringView.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -126,6 +126,7 @@
</span><span class="cx">     WTF_EXPORT_STRING_API bool endsWithIgnoringASCIICase(const StringView&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     int toInt(bool&amp; isValid) const;
</span><ins>+    int toIntStrict(bool&amp; isValid) const;
</ins><span class="cx">     float toFloat(bool&amp; isValid) const;
</span><span class="cx"> 
</span><span class="cx">     static void invalidate(const StringImpl&amp;);
</span><span class="lines">@@ -461,6 +462,13 @@
</span><span class="cx">     return charactersToInt(characters16(), length(), &amp;isValid);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline int StringView::toIntStrict(bool&amp; isValid) const
+{
+    if (is8Bit())
+        return charactersToIntStrict(characters8(), m_length, &amp;isValid);
+    return charactersToIntStrict(characters16(), length(), &amp;isValid);
+}
+
</ins><span class="cx"> inline String StringView::toStringWithoutCopying() const
</span><span class="cx"> {
</span><span class="cx">     if (is8Bit())
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/ChangeLog        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1,3 +1,243 @@
</span><ins>+2016-01-31  Darin Adler  &lt;darin@apple.com&gt;
+
+        Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
+        https://bugs.webkit.org/show_bug.cgi?id=153732
+
+        Reviewed by Dean Jackson.
+
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::isTypeSupported): Added comment about mysterious call
+        to lower(); should probably return here and remove it.
+
+        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
+        (WebCore::initProtocolHandlerWhitelist): Deleted. Moved into isProtocolWhitelisted.
+        (WebCore::isProtocolWhitelisted): Changed set to be ASCIICaseInsensitiveHash and
+        initialized it using a lambda instead of a separate function.
+        (WebCore::verifyProtocolHandlerScheme): Added a FIXME about some case sensitive
+        checking of the protocol prefix here.
+
+        * Modules/plugins/QuickTimePluginReplacement.mm:
+        (WebCore::QuickTimePluginReplacement::supportsMimeType): Changed set to be
+        ASCIICaseInsensitiveHash and initialized it using a lambda instead of using
+        an explict check for empty.
+        (WebCore::QuickTimePluginReplacement::supportsFileExtension): Ditto.
+
+        * Modules/plugins/YouTubePluginReplacement.cpp:
+        (WebCore::queryKeysAndValues): Use convertToASCIILowercase. The keys here are
+        going to be all ASCII.
+        (WebCore::isYouTubeURL): Use equalLettersIgnoringASCIICase instead of lowercasing
+        the string.
+        (WebCore::processAndCreateYouTubeURL): Use url.protocolIsInHTTPFamily instead of
+        listing &quot;http&quot; and then &quot;https&quot; explicitly. Use equalLettersIgnoringASCIICase
+        instead of lowercasing a string.
+        (WebCore::YouTubePluginReplacement::youTubeURL): Ditto.
+
+        * Modules/websockets/WebSocketHandshake.cpp:
+        (WebCore::hostName): Use convertToASCIILowercase on host name.
+        (WebCore::WebSocketHandshake::host): Ditto.
+
+        * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
+        (webkitAccessibleGetAttributes): Call convertToASCIILowercase instead of lower
+        to lowercase an element's tag name. This is a strange way to do things; typically
+        would be better to use some other function on Element, since tagName goes out of
+        its way to be capitalized, but some ATK expert can improve this later.
+
+        * css/CSSGrammar.y.in: Use the new convertToASCIILowercaseInPlace function rather
+        than the old lower function. We only need to lowercase the ASCII letters, and it's
+        also better to have the function have a clearer name.
+
+        * css/CSSParser.cpp:
+        (WebCore::convertToASCIILowercaseInPlace): Renamed from makeLower and made it deal
+        with only ASCII lowercasing.
+        (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Renamed from lower.
+        (WebCore::isUniversalKeyword): Added. Helper for the function below that uses
+        equalLettersIgnoringASCIICase rather than lowercasing the string.
+        (WebCore::parseKeywordValue): Use isUniversalKeyword. Also clarified a comment.
+        (WebCore::CSSParser::parseAttr): Use convertToASCIILowercaseInPlace and delay
+        String creation until later in the function, using CSSParserString operations more.
+
+        * css/CSSParserValues.cpp:
+        (WebCore::CSSParserSelector::parsePseudoElementSelector): Use
+        convertToASCIILowercaseInPlace by its new name, with its new behavior.
+
+        * css/CSSParserValues.h: Tweaked comment and formatting a bit. Replaced the lower
+        function with the convertToASCIILowercaseInPlace function.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::RareData::parseNth): Rewrote this to avoid the need to
+        make a lowercased copy of m_argument. Use equalLettersIgnoringASCIICase, and two
+        calls to find. Also use String::toIntStrict so we don't have to create String
+        objects for substrings.
+
+        * css/MediaQuery.cpp:
+        (WebCore::MediaQuery::MediaQuery): Use convertToASCIILowercase for media type name.
+        * css/MediaQueryExp.cpp:
+        (WebCore::MediaQueryExp::serialize): Use convertToASCIILowercase for media feature name.
+
+        * dom/Document.cpp:
+        (WebCore::isSeparator): Tweaked formatting and removed non-helpful comment.
+        (WebCore::processArguments): Changed this from a static member function to a non-member
+        file internal function. Use a std::function instead of a function pointer with a void*
+        pointer. Rewrote algorithm to simplify it and use StringView instead of String for the
+        keys and values.
+        (WebCore::Document::processViewport): Use a lambda instead of a function pointer to
+        call setViewportFeature, so that function's interface is no longer dictated by
+        the exact type of the function pointer argument to processArguments.
+        (WebCore::Document::processFormatDetection): Use a lambda instead of the
+        setParserFeature function above; use equalLettersIgnoringASCIICase for both the
+        key and the value, since processArguments no longer lowercases the string.
+        (WebCore::Document::processArguments): Deleted.
+
+        * dom/Document.h: Removed unnecessary declaration of processArguments and
+        ArgumentsCallback. Both are now private to the cpp file.
+
+        * dom/Element.cpp:
+        (WebCore::makeIdForStyleResolution): Use convertToASCIILowercase. When in quirks mode,
+        we want to match IDs in an ASCII case-insensitive way not match compatibility caseless.
+
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::isScriptTypeSupported): Remove the use of lower here since
+        the MIME type registry is now itself ASCII case-insensitive.
+
+        * dom/ViewportArguments.cpp:
+        (WebCore::numericPrefix): Changed to use StringView and take a Document&amp;, rearranged
+        argument order so Document&amp; comes first.
+        (WebCore::findSizeValue): Ditto.
+        (WebCore::findScaleValue): Ditto.
+        (WebCore::findBooleanValue): Ditto. Also use std::abs instead of fabs, possibly
+        avoiding a conversion from float to double (not sure it was happening before but it's
+        definitely not happening now).
+        (WebCore::setViewportFeature): Changed to put arguments in a more logical order, to take
+        the ViewportArguments as a reference, not a void*, and to use StringView to avoid forcing
+        the caller to allocate strings. Also changed to use equalLettersIgnoringASCIICase so we
+        don't rely on the caller to make the key lowercase for us.
+        (WebCore::reportViewportWarning): Changed argument types. Added a couple comments about
+        mistakes in the function.
+
+        * dom/ViewportArguments.h: Removed unnecessary declaration of reportViewportWarning,
+        which is now private to the cpp file. Updated for new arguments to setViewportFeature.
+
+        * editing/EditorCommand.cpp:
+        (WebCore::executeFormatBlock): Use convertToASCIILowercase on the argument, which is
+        specifying a tag name.
+
+        * fileapi/Blob.cpp:
+        (WebCore::Blob::isValidContentType): Removed unnecessary separate loops for
+        8-bit and 16-bit strings. Content types are short strings and this small optimization is
+        not worth the additional code complexity.
+        (WebCore::Blob::normalizedContentType): Use convertToASCIILowercase since valid
+        content types are guaranteed to be all ASCII.
+        (WebCore::Blob::isNormalizedContentType): Removed unnecessary separate loops for
+        8-bit and 16-bit strings. Content types are short strings and this small optimization is
+        not worth the additional code complexity.
+
+        * html/parser/HTMLParserIdioms.cpp: Added now-needed include of QualifiedName.h.
+
+        * html/parser/HTMLParserIdioms.h: Removed unneeded include of QualifiedName.h and
+        WTFString.h. Made sure every function is declared first, even if it's also defined
+        later in the header in the section for functions templates and inline functions.
+
+        * loader/archive/ArchiveFactory.cpp:
+        (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): Use auto&amp; for the type of
+        the set of MIME types here, since it's now using ASCIICaseInsensitiveHash.
+
+        * platform/MIMETypeRegistry.cpp: Changed the MIME type sets to use
+        ASCIICaseInsensitiveHash since MIME type are not case sensitive.
+        (WebCore::initializeSupportedImageMIMETypes): Use a modern for loop.
+        (WebCore::initializeSupportedImageMIMETypesForEncoding): Updated for HashSet type change.
+        (WebCore::initializePDFMIMETypes): Use a modern for loop.
+        (WebCore::initializeSupportedNonImageMimeTypes): Use a modern for loop.
+        (WebCore::initializeSupportedMediaMIMETypes): Updated for HashSet type change.
+        (WebCore::initializeUnsupportedTextMIMETypes): Use a modern for loop.
+        (WebCore::initializeMIMETypeRegistry): Updated for HashSet type change.
+        (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Ditto.
+        (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Ditto.
+        (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Ditto.
+        (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Ditto.
+        (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Ditto.
+        (WebCore::MIMETypeRegistry::getPDFMIMETypes): Ditto.
+        (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Ditto.
+        (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Ditto.
+        (WebCore::mimeTypeAssociationMap): Use ASCIICaseInsensitiveHash.
+        (WebCore::MIMETypeRegistry::getNormalizedMIMEType): Use auto to make code tighter.
+
+        * platform/MIMETypeRegistry.h: Changed return types of the getMIMETypes functions
+        to use ASCIICaseInsensitiveHash.
+
+        * platform/SchemeRegistry.cpp:
+        (WebCore::schemesForbiddenFromDomainRelaxation): Changed type to
+        use ASCIICaseInsensitiveHash.
+
+        * platform/URL.cpp:
+        (WebCore::mimeTypeFromDataURL): Use convertToASCIILowercase instead of lower.
+        Also removed some dead code that tried to handle the case where the data URL
+        has a comma as one of the first 5 characters: That can't happen since it's a
+        precondition of this function that the first five characters are &quot;data:&quot;.
+
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::MediaPlayer::getSupportedTypes): Change type of argument to
+        a HashSet with ASCIICaseInsensitiveHash.
+        * platform/graphics/MediaPlayer.h: Ditto.
+
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
+        Changed type of HashSet to use ASCIICaseInsensitiveHash.
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Ditto.
+
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::avfMIMETypes):
+        Changed type of HashSet to use ASCIICaseInsensitiveHash.
+        (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes): Ditto.
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Ditto.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        Changed type of HashSet to use ASCIICaseInsensitiveHash.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Removed
+        an unnecessary line of code to set a local variable to 0 just before it falls
+        out of scope.
+        (WebCore::avfMIMETypes): Ditto. Also tightened up the code a bit.
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Ditto.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
+        Changed type of HashSet to use ASCIICaseInsensitiveHash.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::mimeTypeCache): Ditto.
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Ditto.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Ditto.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::mimeTypeCache): Ditto.
+        (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): Ditto.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::shouldRejectMIMEType): Made this non-case-sensitive by using startsWith
+        and the &quot;false&quot; argument. Later change this to startsWithIgnoringASCIICase or
+        startsWithLettersIgnoringASCIICase.
+        (WebCore::addFileTypesToCache): Use ASCIICaseInsensitiveHash. ALso rewrote to
+        tighten up the code a bit and use modern Objective-C for loops.
+        (WebCore::mimeCommonTypesCache): Use ASCIICaseInsensitiveHash.
+        (WebCore::mimeModernTypesCache): Ditto.
+        (WebCore::concatenateHashSets): Ditto.
+        (WebCore::MediaPlayerPrivateQTKit::getSupportedTypes): Ditto.
+        (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Initialied
+        track type set using lambda, but left it case sensitive.
+
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+        (WebCore::mimeTypeCache): Changed type of HashSet to use ASCIICaseInsensitiveHash.
+        (WebCore::MediaPlayerPrivateMediaFoundation::getSupportedTypes): Ditto.
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
+
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
+        (WebCore::mimeTypeCache): Ditto.
+        (WebCore::MockMediaPlayerMediaSource::getSupportedTypes): Ditto.
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Ditto.
+
</ins><span class="cx"> 2016-01-31  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add &quot;WebKit built-in PDF&quot; Plugin to set of publicly visible plugins
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediasourceMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -732,6 +732,7 @@
</span><span class="cx">     if (type.isNull() || type.isEmpty())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    // FIXME: Why do we convert to lowercase here, but not in MediaSource::addSourceBuffer?
</ins><span class="cx">     ContentType contentType(type.lower());
</span><span class="cx">     String codecs = contentType.parameter(&quot;codecs&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesnavigatorcontentutilsNavigatorContentUtilscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -39,15 +39,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static HashSet&lt;String&gt;* protocolWhitelist;
-
-static void initProtocolHandlerWhitelist()
-{
-    protocolWhitelist = new HashSet&lt;String&gt;;
-    for (auto* protocol : { &quot;bitcoin&quot;, &quot;geo&quot;, &quot;im&quot;, &quot;irc&quot;, &quot;ircs&quot;, &quot;magnet&quot;, &quot;mailto&quot;, &quot;mms&quot;, &quot;news&quot;, &quot;nntp&quot;, &quot;sip&quot;, &quot;sms&quot;, &quot;smsto&quot;, &quot;ssh&quot;, &quot;tel&quot;, &quot;urn&quot;, &quot;webcal&quot;, &quot;wtai&quot;, &quot;xmpp&quot; })
-        protocolWhitelist-&gt;add(protocol);
-}
-
</del><span class="cx"> static bool verifyCustomHandlerURL(const URL&amp; baseURL, const String&amp; url, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     // The specification requires that it is a SYNTAX_ERR if the &quot;%s&quot; token is
</span><span class="lines">@@ -74,11 +65,15 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool isProtocolWhitelisted(const String&amp; scheme)
</del><ins>+static inline bool isProtocolWhitelisted(const String&amp; scheme)
</ins><span class="cx"> {
</span><del>-    if (!protocolWhitelist)
-        initProtocolHandlerWhitelist();
-    return protocolWhitelist-&gt;contains(scheme.convertToASCIILowercase());
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; protocolWhitelist = []() {
+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; set;
+        for (auto* protocol : { &quot;bitcoin&quot;, &quot;geo&quot;, &quot;im&quot;, &quot;irc&quot;, &quot;ircs&quot;, &quot;magnet&quot;, &quot;mailto&quot;, &quot;mms&quot;, &quot;news&quot;, &quot;nntp&quot;, &quot;sip&quot;, &quot;sms&quot;, &quot;smsto&quot;, &quot;ssh&quot;, &quot;tel&quot;, &quot;urn&quot;, &quot;webcal&quot;, &quot;wtai&quot;, &quot;xmpp&quot; })
+            set.add(protocol);
+        return set;
+    }();
+    return protocolWhitelist.get().contains(scheme);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool verifyProtocolHandlerScheme(const String&amp; scheme, ExceptionCode&amp; ec)
</span><span class="lines">@@ -86,6 +81,7 @@
</span><span class="cx">     if (isProtocolWhitelisted(scheme))
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><ins>+    // FIXME: Should this be case sensitive, or should it be ASCII case-insensitive?
</ins><span class="cx">     if (scheme.startsWith(&quot;web+&quot;)) {
</span><span class="cx">         // The specification requires that the length of scheme is at least five characters (including 'web+' prefix).
</span><span class="cx">         if (scheme.length() &gt;= 5 &amp;&amp; isValidProtocol(scheme))
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -82,36 +82,36 @@
</span><span class="cx"> 
</span><span class="cx"> bool QuickTimePluginReplacement::supportsMimeType(const String&amp; mimeType)
</span><span class="cx"> {
</span><del>-    static const char* types[] = {
-        &quot;application/vnd.apple.mpegurl&quot;, &quot;application/x-mpegurl&quot;, &quot;audio/3gpp&quot;, &quot;audio/3gpp2&quot;, &quot;audio/aac&quot;, &quot;audio/aiff&quot;,
-        &quot;audio/amr&quot;, &quot;audio/basic&quot;, &quot;audio/mp3&quot;, &quot;audio/mp4&quot;, &quot;audio/mpeg&quot;, &quot;audio/mpeg3&quot;, &quot;audio/mpegurl&quot;, &quot;audio/scpls&quot;,
-        &quot;audio/wav&quot;, &quot;audio/x-aac&quot;, &quot;audio/x-aiff&quot;, &quot;audio/x-caf&quot;, &quot;audio/x-m4a&quot;, &quot;audio/x-m4b&quot;, &quot;audio/x-m4p&quot;,
-        &quot;audio/x-m4r&quot;, &quot;audio/x-mp3&quot;, &quot;audio/x-mpeg&quot;, &quot;audio/x-mpeg3&quot;, &quot;audio/x-mpegurl&quot;, &quot;audio/x-scpls&quot;, &quot;audio/x-wav&quot;,
-        &quot;video/3gpp&quot;, &quot;video/3gpp2&quot;, &quot;video/mp4&quot;, &quot;video/quicktime&quot;, &quot;video/x-m4v&quot;
-    };
-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; typeHash;
-    if (!typeHash.get().size()) {
-        for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(types); ++i)
-            typeHash.get().add(types[i]);
-    }
-
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; typeHash = []() {
+        static const char* const types[] = {
+            &quot;application/vnd.apple.mpegurl&quot;, &quot;application/x-mpegurl&quot;, &quot;audio/3gpp&quot;, &quot;audio/3gpp2&quot;, &quot;audio/aac&quot;, &quot;audio/aiff&quot;,
+            &quot;audio/amr&quot;, &quot;audio/basic&quot;, &quot;audio/mp3&quot;, &quot;audio/mp4&quot;, &quot;audio/mpeg&quot;, &quot;audio/mpeg3&quot;, &quot;audio/mpegurl&quot;, &quot;audio/scpls&quot;,
+            &quot;audio/wav&quot;, &quot;audio/x-aac&quot;, &quot;audio/x-aiff&quot;, &quot;audio/x-caf&quot;, &quot;audio/x-m4a&quot;, &quot;audio/x-m4b&quot;, &quot;audio/x-m4p&quot;,
+            &quot;audio/x-m4r&quot;, &quot;audio/x-mp3&quot;, &quot;audio/x-mpeg&quot;, &quot;audio/x-mpeg3&quot;, &quot;audio/x-mpegurl&quot;, &quot;audio/x-scpls&quot;, &quot;audio/x-wav&quot;,
+            &quot;video/3gpp&quot;, &quot;video/3gpp2&quot;, &quot;video/mp4&quot;, &quot;video/quicktime&quot;, &quot;video/x-m4v&quot;
+        };
+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; set;
+        for (auto&amp; type : types)
+            set.add(type);
+        return set;
+    }();
</ins><span class="cx">     return typeHash.get().contains(mimeType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool QuickTimePluginReplacement::supportsFileExtension(const String&amp; extension)
</span><span class="cx"> {
</span><del>-    static const char* extensions[] = {
-        &quot;3g2&quot;, &quot;3gp&quot;, &quot;3gp2&quot;, &quot;3gpp&quot;, &quot;aac&quot;, &quot;adts&quot;, &quot;aif&quot;, &quot;aifc&quot;, &quot;aiff&quot;, &quot;AMR&quot;, &quot;au&quot;, &quot;bwf&quot;, &quot;caf&quot;, &quot;cdda&quot;, &quot;m3u&quot;,
-        &quot;m3u8&quot;, &quot;m4a&quot;, &quot;m4b&quot;, &quot;m4p&quot;, &quot;m4r&quot;, &quot;m4v&quot;, &quot;mov&quot;, &quot;mp3&quot;, &quot;mp3&quot;, &quot;mp4&quot;, &quot;mpeg&quot;, &quot;mpg&quot;, &quot;mqv&quot;, &quot;pls&quot;, &quot;qt&quot;,
-        &quot;snd&quot;, &quot;swa&quot;, &quot;ts&quot;, &quot;ulw&quot;, &quot;wav&quot;
-    };
-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; extensionHash;
-    if (!extensionHash.get().size()) {
-        for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(extensions); ++i)
-            extensionHash.get().add(extensions[i]);
-    }
-
-    return extensionHash.get().contains(extension);
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; extensionSet = []() {
+        static const char* const extensions[] = {
+            &quot;3g2&quot;, &quot;3gp&quot;, &quot;3gp2&quot;, &quot;3gpp&quot;, &quot;aac&quot;, &quot;adts&quot;, &quot;aif&quot;, &quot;aifc&quot;, &quot;aiff&quot;, &quot;AMR&quot;, &quot;au&quot;, &quot;bwf&quot;, &quot;caf&quot;, &quot;cdda&quot;, &quot;m3u&quot;,
+            &quot;m3u8&quot;, &quot;m4a&quot;, &quot;m4b&quot;, &quot;m4p&quot;, &quot;m4r&quot;, &quot;m4v&quot;, &quot;mov&quot;, &quot;mp3&quot;, &quot;mp3&quot;, &quot;mp4&quot;, &quot;mpeg&quot;, &quot;mpg&quot;, &quot;mqv&quot;, &quot;pls&quot;, &quot;qt&quot;,
+            &quot;snd&quot;, &quot;swa&quot;, &quot;ts&quot;, &quot;ulw&quot;, &quot;wav&quot;
+        };
+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; set;
+        for (auto&amp; extension : extensions)
+            set.add(extension);
+        return set;
+    }();
+    return extensionSet.get().contains(extension);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> QuickTimePluginReplacement::QuickTimePluginReplacement(HTMLPlugInElement&amp; plugin, const Vector&lt;String&gt;&amp; paramNames, const Vector&lt;String&gt;&amp; paramValues)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsYouTubePluginReplacementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">         
</span><span class="cx">         // Save the key and the value.
</span><span class="cx">         if (keyLength &amp;&amp; valueLength) {
</span><del>-            const String&amp; key = queryString.substring(keyLocation, keyLength).lower();
</del><ins>+            String key = queryString.substring(keyLocation, keyLength).convertToASCIILowercase();
</ins><span class="cx">             String value = queryString.substring(valueLocation, valueLength);
</span><span class="cx">             value.replace('+', ' ');
</span><span class="cx"> 
</span><span class="lines">@@ -181,14 +181,13 @@
</span><span class="cx">     
</span><span class="cx"> static bool isYouTubeURL(const URL&amp; url)
</span><span class="cx"> {
</span><del>-    const String&amp; hostName = url.host().lower();
-    
-    return hostName == &quot;m.youtube.com&quot;
-        || hostName == &quot;youtu.be&quot;
-        || hostName == &quot;www.youtube.com&quot;
-        || hostName == &quot;youtube.com&quot;
-        || hostName == &quot;www.youtube-nocookie.com&quot;
-        || hostName == &quot;youtube-nocookie.com&quot;;
</del><ins>+    String hostName = url.host();
+    return equalLettersIgnoringASCIICase(hostName, &quot;m.youtube.com&quot;)
+        || equalLettersIgnoringASCIICase(hostName, &quot;youtu.be&quot;)
+        || equalLettersIgnoringASCIICase(hostName, &quot;www.youtube.com&quot;)
+        || equalLettersIgnoringASCIICase(hostName, &quot;youtube.com&quot;)
+        || equalLettersIgnoringASCIICase(hostName, &quot;www.youtube-nocookie.com&quot;)
+        || equalLettersIgnoringASCIICase(hostName, &quot;youtube-nocookie.com&quot;);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const String&amp; valueForKey(const YouTubePluginReplacement::KeyValueMap&amp; dictionary, const String&amp; key)
</span><span class="lines">@@ -202,24 +201,22 @@
</span><span class="cx"> 
</span><span class="cx"> static URL processAndCreateYouTubeURL(const URL&amp; url, bool&amp; isYouTubeShortenedURL)
</span><span class="cx"> {
</span><del>-    if (!url.protocolIs(&quot;http&quot;) &amp;&amp; !url.protocolIs(&quot;https&quot;))
</del><ins>+    if (!url.protocolIsInHTTPFamily())
</ins><span class="cx">         return URL();
</span><del>-    
</del><ins>+
</ins><span class="cx">     // Bail out early if we aren't even on www.youtube.com or youtube.com.
</span><span class="cx">     if (!isYouTubeURL(url))
</span><span class="cx">         return URL();
</span><del>-    
-    const String&amp; hostName = url.host().lower();
-    
-    bool isYouTubeMobileWebAppURL = hostName == &quot;m.youtube.com&quot;;
-    isYouTubeShortenedURL = hostName == &quot;youtu.be&quot;;
-    
</del><ins>+
+    String hostName = url.host();
+    bool isYouTubeMobileWebAppURL = equalLettersIgnoringASCIICase(hostName, &quot;m.youtube.com&quot;);
+    isYouTubeShortenedURL = equalLettersIgnoringASCIICase(hostName, &quot;youtu.be&quot;);
+
</ins><span class="cx">     // Short URL of the form: http://youtu.be/v1d301D
</span><span class="cx">     if (isYouTubeShortenedURL) {
</span><del>-        const String&amp; videoID = url.lastPathComponent();
</del><ins>+        String videoID = url.lastPathComponent();
</ins><span class="cx">         if (videoID.isEmpty() || videoID == &quot;/&quot;)
</span><span class="cx">             return URL();
</span><del>-        
</del><span class="cx">         return createYouTubeURL(videoID, emptyString());
</span><span class="cx">     }
</span><span class="cx">     
</span><span class="lines">@@ -241,7 +238,7 @@
</span><span class="cx">         fragment = emptyString();
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    if (path.lower() == &quot;/watch&quot;) {
</del><ins>+    if (equalLettersIgnoringASCIICase(path, &quot;/watch&quot;)) {
</ins><span class="cx">         if (!query.isEmpty()) {
</span><span class="cx">             const auto&amp; queryDictionary = queryKeysAndValues(query);
</span><span class="cx">             String videoID = valueForKey(queryDictionary, &quot;v&quot;);
</span><span class="lines">@@ -303,8 +300,9 @@
</span><span class="cx">     
</span><span class="cx">         // From the original URL, we need to get the part before /path/VideoId.
</span><span class="cx">         locationOfPathBeforeVideoID = srcString.find(srcPath.substring(0, locationOfVideoIDInPath));
</span><del>-    } else if (srcPath.lower() == &quot;/watch&quot;) {
</del><ins>+    } else if (equalLettersIgnoringASCIICase(srcPath, &quot;/watch&quot;)) {
</ins><span class="cx">         // From the original URL, we need to get the part before /watch/#!v=VideoID
</span><ins>+        // FIXME: Shouldn't this be ASCII case-insensitive?
</ins><span class="cx">         locationOfPathBeforeVideoID = srcString.find(&quot;/watch&quot;);
</span><span class="cx">     } else
</span><span class="cx">         return srcString;
</span></span></pre></div>
<a id="trunkSourceWebCoreModuleswebsocketsWebSocketHandshakecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(url.protocolIs(&quot;wss&quot;) == secure);
</span><span class="cx">     StringBuilder builder;
</span><del>-    builder.append(url.host().lower());
</del><ins>+    builder.append(url.host().convertToASCIILowercase());
</ins><span class="cx">     if (url.port() &amp;&amp; ((!secure &amp;&amp; url.port() != 80) || (secure &amp;&amp; url.port() != 443))) {
</span><span class="cx">         builder.append(':');
</span><span class="cx">         builder.appendNumber(url.port());
</span><span class="lines">@@ -143,9 +143,10 @@
</span><span class="cx">     m_url = url.isolatedCopy();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: Return type should just be String, not const String.
</ins><span class="cx"> const String WebSocketHandshake::host() const
</span><span class="cx"> {
</span><del>-    return m_url.host().lower();
</del><ins>+    return m_url.host().convertToASCIILowercase();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const String&amp; WebSocketHandshake::clientProtocol() const
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatkWebKitAccessibleWrapperAtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -410,7 +410,7 @@
</span><span class="cx">     if (element) {
</span><span class="cx">         String tagName = element-&gt;tagName();
</span><span class="cx">         if (!tagName.isEmpty())
</span><del>-            attributeSet = addToAtkAttributeSet(attributeSet, &quot;tag&quot;, tagName.lower().utf8().data());
</del><ins>+            attributeSet = addToAtkAttributeSet(attributeSet, &quot;tag&quot;, tagName.convertToASCIILowercase().utf8().data());
</ins><span class="cx">         String id = element-&gt;getIdAttribute().string();
</span><span class="cx">         if (!id.isEmpty())
</span><span class="cx">             attributeSet = addToAtkAttributeSet(attributeSet, &quot;html-id&quot;, id.utf8().data());
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGrammaryin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGrammar.y.in        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -589,7 +589,7 @@
</span><span class="cx"> 
</span><span class="cx"> base_media_query_exp: '(' maybe_space IDENT maybe_space maybe_media_value ')' {
</span><span class="cx">         std::unique_ptr&lt;CSSParserValueList&gt; mediaValue($5);
</span><del>-        $3.lower();
</del><ins>+        $3.convertToASCIILowercaseInPlace();
</ins><span class="cx">         $$ = new MediaQueryExp($3, mediaValue.get());
</span><span class="cx">     }
</span><span class="cx">     ;
</span><span class="lines">@@ -644,7 +644,7 @@
</span><span class="cx">     }
</span><span class="cx">     |
</span><span class="cx">     maybe_media_restrictor maybe_space IDENT maybe_space maybe_and_media_query_exp_list {
</span><del>-        $3.lower();
</del><ins>+        $3.convertToASCIILowercaseInPlace();
</ins><span class="cx">         $$ = new MediaQuery($1, $3, std::unique_ptr&lt;Vector&lt;std::unique_ptr&lt;MediaQueryExp&gt;&gt;&gt;($5));
</span><span class="cx">     }
</span><span class="cx">     ;
</span><span class="lines">@@ -1234,7 +1234,7 @@
</span><span class="cx">         $$ = new CSSParserSelector;
</span><span class="cx">         $$-&gt;setMatch(CSSSelector::Id);
</span><span class="cx">         if (parser-&gt;m_context.mode == CSSQuirksMode)
</span><del>-            $1.lower();
</del><ins>+            $1.convertToASCIILowercaseInPlace();
</ins><span class="cx">         $$-&gt;setValue($1);
</span><span class="cx">     }
</span><span class="cx">   | HEX {
</span><span class="lines">@@ -1244,7 +1244,7 @@
</span><span class="cx">             $$ = new CSSParserSelector;
</span><span class="cx">             $$-&gt;setMatch(CSSSelector::Id);
</span><span class="cx">             if (parser-&gt;m_context.mode == CSSQuirksMode)
</span><del>-                $1.lower();
</del><ins>+                $1.convertToASCIILowercaseInPlace();
</ins><span class="cx">             $$-&gt;setValue($1);
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -1258,7 +1258,7 @@
</span><span class="cx">         $$ = new CSSParserSelector;
</span><span class="cx">         $$-&gt;setMatch(CSSSelector::Class);
</span><span class="cx">         if (parser-&gt;m_context.mode == CSSQuirksMode)
</span><del>-            $2.lower();
</del><ins>+            $2.convertToASCIILowercaseInPlace();
</ins><span class="cx">         $$-&gt;setValue($2);
</span><span class="cx">     }
</span><span class="cx">   ;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -340,34 +340,18 @@
</span><span class="cx">     clearProperties();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template &lt;typename CharacterType&gt;
-ALWAYS_INLINE static void makeLower(const CharacterType* input, CharacterType* output, unsigned length)
</del><ins>+template&lt;typename CharacterType&gt; ALWAYS_INLINE static void convertToASCIILowercaseInPlace(CharacterType* characters, unsigned length)
</ins><span class="cx"> {
</span><del>-    // FIXME: If we need Unicode lowercasing here, then we probably want the real kind
-    // that can potentially change the length of the string rather than the character
-    // by character kind. If we don't need Unicode lowercasing, it would be good to
-    // simplify this function.
-
-    if (charactersAreAllASCII(input, length)) {
-        // Fast case for all-ASCII.
-        for (unsigned i = 0; i &lt; length; ++i)
-            output[i] = toASCIILower(input[i]);
-    } else {
-        for (unsigned i = 0; i &lt; length; ++i) {
-            ASSERT(u_tolower(input[i]) &lt;= 0xFFFF);
-            output[i] = u_tolower(input[i]);
-        }
-    }
</del><ins>+    for (unsigned i = 0; i &lt; length; ++i)
+        characters[i] = toASCIILower(characters[i]);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CSSParserString::lower()
</del><ins>+void CSSParserString::convertToASCIILowercaseInPlace()
</ins><span class="cx"> {
</span><del>-    if (is8Bit()) {
-        makeLower(characters8(), characters8(), length());
-        return;
-    }
-
-    makeLower(characters16(), characters16(), length());
</del><ins>+    if (is8Bit())
+        WebCore::convertToASCIILowercaseInPlace(characters8(), length());
+    else
+        WebCore::convertToASCIILowercaseInPlace(characters16(), length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSParser::setupParser(const char* prefix, unsigned prefixLength, StringView string, const char* suffix, unsigned suffixLength)
</span><span class="lines">@@ -1198,17 +1182,24 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool isUniversalKeyword(const String&amp; string)
+{
+    // These keywords can be used for all properties.
+    return equalLettersIgnoringASCIICase(string, &quot;initial&quot;)
+        || equalLettersIgnoringASCIICase(string, &quot;inherit&quot;)
+        || equalLettersIgnoringASCIICase(string, &quot;unset&quot;)
+        || equalLettersIgnoringASCIICase(string, &quot;revert&quot;);
+}
+
</ins><span class="cx"> static CSSParser::ParseResult parseKeywordValue(MutableStyleProperties* declaration, CSSPropertyID propertyId, const String&amp; string, bool important, const CSSParserContext&amp; parserContext, StyleSheetContents* styleSheetContents)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!string.isEmpty());
</span><span class="cx"> 
</span><span class="cx">     if (!isKeywordPropertyID(propertyId)) {
</span><del>-        // All properties accept the values of &quot;initial&quot; and &quot;inherit&quot;.
-        String lowerCaseString = string.lower();
-        if (lowerCaseString != &quot;initial&quot; &amp;&amp; lowerCaseString != &quot;inherit&quot; &amp;&amp; lowerCaseString != &quot;unset&quot; &amp;&amp; lowerCaseString != &quot;revert&quot;)
</del><ins>+        if (!isUniversalKeyword(string))
</ins><span class="cx">             return CSSParser::ParseResult::Error;
</span><span class="cx"> 
</span><del>-        // Parse initial/inherit/unset/revert shorthands using the CSSParser.
</del><ins>+        // Don't try to parse initial/inherit/unset/revert shorthands; return an error so the caller will use the full CSS parser.
</ins><span class="cx">         if (shorthandForProperty(propertyId).length())
</span><span class="cx">             return CSSParser::ParseResult::Error;
</span><span class="cx">     }
</span><span class="lines">@@ -4342,17 +4333,19 @@
</span><span class="cx">     if (argument.unit != CSSPrimitiveValue::CSS_IDENT)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    String attrName = argument.string;
</del><ins>+    ASSERT(argument.string.length());
+
</ins><span class="cx">     // CSS allows identifiers with &quot;-&quot; at the start, like &quot;-webkit-mask-image&quot;.
</span><span class="cx">     // But HTML attribute names can't have those characters, and we should not
</span><span class="cx">     // even parse them inside attr().
</span><del>-    if (attrName[0] == '-')
</del><ins>+    if (argument.string[0] == '-')
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (m_context.isHTMLDocument)
</span><del>-        attrName = attrName.lower();
</del><ins>+        argument.string.convertToASCIILowercaseInPlace();
</ins><span class="cx"> 
</span><del>-    return CSSValuePool::singleton().createValue(attrName, CSSPrimitiveValue::CSS_ATTR);
</del><ins>+    // FIXME: Is there some small benefit to creating an AtomicString here instead of a String?
+    return CSSValuePool::singleton().createValue(String(argument.string), CSSPrimitiveValue::CSS_ATTR);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseBackgroundColor()
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/css/CSSParserValues.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -199,7 +199,7 @@
</span><span class="cx"> 
</span><span class="cx"> CSSParserSelector* CSSParserSelector::parsePseudoElementSelector(CSSParserString&amp; pseudoTypeString)
</span><span class="cx"> {
</span><del>-    pseudoTypeString.lower();
</del><ins>+    pseudoTypeString.convertToASCIILowercaseInPlace();
</ins><span class="cx">     AtomicString name = pseudoTypeString;
</span><span class="cx"> 
</span><span class="cx">     CSSSelector::PseudoElementType pseudoType = CSSSelector::parsePseudoElementType(name);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/css/CSSParserValues.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -33,9 +33,7 @@
</span><span class="cx"> class CSSValue;
</span><span class="cx"> class QualifiedName;
</span><span class="cx"> 
</span><del>-// This can't be a StringView for 2 reasons:
-// 1. lower() clobbers the data we point to.
-// 2. We are an element of a union (in CSSParserValue) so we need to have a trivial destructor.
</del><ins>+// This should be a StringView but currently it can't because it's used as an element of a union in CSSParserValue.
</ins><span class="cx"> struct CSSParserString {
</span><span class="cx">     void init(LChar* characters, unsigned length)
</span><span class="cx">     {
</span><span class="lines">@@ -73,13 +71,12 @@
</span><span class="cx">     bool is8Bit() const { return m_is8Bit; }
</span><span class="cx">     LChar* characters8() const { ASSERT(is8Bit()); return m_data.characters8; }
</span><span class="cx">     UChar* characters16() const { ASSERT(!is8Bit()); return m_data.characters16; }
</span><del>-    template &lt;typename CharacterType&gt;
-    CharacterType* characters() const;
</del><ins>+    template&lt;typename CharacterType&gt; CharacterType* characters() const;
</ins><span class="cx"> 
</span><span class="cx">     unsigned length() const { return m_length; }
</span><span class="cx">     void setLength(unsigned length) { m_length = length; }
</span><span class="cx"> 
</span><del>-    void lower();
</del><ins>+    void convertToASCIILowercaseInPlace();
</ins><span class="cx"> 
</span><span class="cx">     UChar operator[](unsigned i) const
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSelector.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSelector.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/css/CSSSelector.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -805,28 +805,27 @@
</span><span class="cx"> // a helper function for parsing nth-arguments
</span><span class="cx"> bool CSSSelector::RareData::parseNth()
</span><span class="cx"> {
</span><del>-    String argument = m_argument.lower();
-
-    if (argument.isEmpty())
</del><ins>+    if (m_argument.isEmpty())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    m_a = 0;
-    m_b = 0;
-    if (argument == &quot;odd&quot;) {
</del><ins>+    if (equalLettersIgnoringASCIICase(m_argument, &quot;odd&quot;)) {
</ins><span class="cx">         m_a = 2;
</span><span class="cx">         m_b = 1;
</span><del>-    } else if (argument == &quot;even&quot;) {
</del><ins>+    } else if (equalLettersIgnoringASCIICase(m_argument, &quot;even&quot;)) {
</ins><span class="cx">         m_a = 2;
</span><span class="cx">         m_b = 0;
</span><span class="cx">     } else {
</span><del>-        size_t n = argument.find('n');
</del><ins>+        m_a = 0;
+        m_b = 0;
+
+        size_t n = std::min(m_argument.find('n'), m_argument.find('N'));
</ins><span class="cx">         if (n != notFound) {
</span><del>-            if (argument[0] == '-') {
</del><ins>+            if (m_argument[0] == '-') {
</ins><span class="cx">                 if (n == 1)
</span><span class="cx">                     m_a = -1; // -n == -1n
</span><span class="cx">                 else {
</span><span class="cx">                     bool ok;
</span><del>-                    m_a = argument.substringSharingImpl(0, n).toIntStrict(&amp;ok);
</del><ins>+                    m_a = StringView(m_argument).substring(0, n).toIntStrict(ok);
</ins><span class="cx">                     if (!ok)
</span><span class="cx">                         return false;
</span><span class="cx">                 }
</span><span class="lines">@@ -834,29 +833,29 @@
</span><span class="cx">                 m_a = 1; // n == 1n
</span><span class="cx">             else {
</span><span class="cx">                 bool ok;
</span><del>-                m_a = argument.substringSharingImpl(0, n).toIntStrict(&amp;ok);
</del><ins>+                m_a = StringView(m_argument).substring(0, n).toIntStrict(ok);
</ins><span class="cx">                 if (!ok)
</span><span class="cx">                     return false;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            size_t p = argument.find('+', n);
</del><ins>+            size_t p = m_argument.find('+', n);
</ins><span class="cx">             if (p != notFound) {
</span><span class="cx">                 bool ok;
</span><del>-                m_b = argument.substringSharingImpl(p + 1, argument.length() - p - 1).toIntStrict(&amp;ok);
</del><ins>+                m_b = StringView(m_argument).substring(p + 1).toIntStrict(ok);
</ins><span class="cx">                 if (!ok)
</span><span class="cx">                     return false;
</span><span class="cx">             } else {
</span><del>-                p = argument.find('-', n);
</del><ins>+                p = m_argument.find('-', n);
</ins><span class="cx">                 if (p != notFound) {
</span><span class="cx">                     bool ok;
</span><del>-                    m_b = -argument.substringSharingImpl(p + 1, argument.length() - p - 1).toIntStrict(&amp;ok);
</del><ins>+                    m_b = -StringView(m_argument).substring(p + 1).toIntStrict(ok);
</ins><span class="cx">                     if (!ok)
</span><span class="cx">                         return false;
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><span class="cx">             bool ok;
</span><del>-            m_b = argument.toIntStrict(&amp;ok);
</del><ins>+            m_b = m_argument.string().toIntStrict(&amp;ok);
</ins><span class="cx">             if (!ok)
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQuerycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQuery.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQuery.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/css/MediaQuery.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> 
</span><span class="cx"> MediaQuery::MediaQuery(Restrictor r, const String&amp; mediaType, std::unique_ptr&lt;ExpressionVector&gt; exprs)
</span><span class="cx">     : m_restrictor(r)
</span><del>-    , m_mediaType(mediaType.lower())
</del><ins>+    , m_mediaType(mediaType.convertToASCIILowercase())
</ins><span class="cx">     , m_expressions(WTFMove(exprs))
</span><span class="cx">     , m_ignored(false)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryExpcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryExp.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryExp.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/css/MediaQueryExp.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx"> 
</span><span class="cx">     StringBuilder result;
</span><span class="cx">     result.append('(');
</span><del>-    result.append(m_mediaFeature.lower());
</del><ins>+    result.append(m_mediaFeature.convertToASCIILowercase());
</ins><span class="cx">     if (m_value) {
</span><span class="cx">         result.appendLiteral(&quot;: &quot;);
</span><span class="cx">         result.append(m_value-&gt;cssText());
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -3278,59 +3278,40 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Though isspace() considers \t and \v to be whitespace, Win IE doesn't.
-static bool isSeparator(UChar c)
</del><ins>+static bool isSeparator(UChar character)
</ins><span class="cx"> {
</span><del>-    return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '=' || c == ',' || c == '\0';
</del><ins>+    return character == ' ' || character == '\t' || character == '\n' || character == '\r' || character == '=' || character == ',';
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::processArguments(const String&amp; features, void* data, ArgumentsCallback callback)
</del><ins>+static void processArguments(StringView features, std::function&lt;void(StringView type, StringView value)&gt; callback)
</ins><span class="cx"> {
</span><del>-    // Tread lightly in this code -- it was specifically designed to mimic Win IE's parsing behavior.
-    unsigned keyBegin, keyEnd;
-    unsigned valueBegin, valueEnd;
-
-    String buffer = features.lower();
-    unsigned length = buffer.length();
</del><ins>+    unsigned length = features.length();
</ins><span class="cx">     for (unsigned i = 0; i &lt; length; ) {
</span><del>-        // skip to first non-separator, but don't skip past the end of the string
-        while (isSeparator(buffer[i])) {
-            if (i &gt;= length)
-                break;
-            i++;
-        }
-        keyBegin = i;
</del><ins>+        // skip to first non-separator
+        while (i &lt; length &amp;&amp; isSeparator(features[i]))
+            ++i;
+        unsigned keyBegin = i;
</ins><span class="cx"> 
</span><span class="cx">         // skip to first separator
</span><del>-        while (!isSeparator(buffer[i]))
</del><ins>+        while (i &lt; length &amp;&amp; !isSeparator(features[i]))
</ins><span class="cx">             i++;
</span><del>-        keyEnd = i;
</del><ins>+        unsigned keyEnd = i;
</ins><span class="cx"> 
</span><del>-        // skip to first '=', but don't skip past a ',' or the end of the string
-        while (buffer[i] != '=') {
-            if (buffer[i] == ',' || i &gt;= length)
-                break;
-            i++;
-        }
</del><ins>+        // skip to first '=', but don't skip past a ','
+        while (i &lt; length &amp;&amp; features[i] != '=' &amp;&amp; features[i] != ',')
+            ++i;
</ins><span class="cx"> 
</span><del>-        // skip to first non-separator, but don't skip past a ',' or the end of the string
-        while (isSeparator(buffer[i])) {
-            if (buffer[i] == ',' || i &gt;= length)
-                break;
-            i++;
-        }
-        valueBegin = i;
</del><ins>+        // skip to first non-separator, but don't skip past a ','
+        while (i &lt; length &amp;&amp; isSeparator(features[i]) &amp;&amp; features[i] != ',')
+            ++i;
+        unsigned valueBegin = i;
</ins><span class="cx"> 
</span><span class="cx">         // skip to first separator
</span><del>-        while (!isSeparator(buffer[i]))
-            i++;
-        valueEnd = i;
</del><ins>+        while (i &lt; length &amp;&amp; !isSeparator(features[i]))
+            ++i;
+        unsigned valueEnd = i;
</ins><span class="cx"> 
</span><del>-        ASSERT_WITH_SECURITY_IMPLICATION(i &lt;= length);
-
-        String keyString = buffer.substring(keyBegin, keyEnd - keyBegin);
-        String valueString = buffer.substring(valueBegin, valueEnd - valueBegin);
-        callback(keyString, valueString, this, data);
</del><ins>+        callback(features.substring(keyBegin, keyEnd - keyBegin), features.substring(valueBegin, valueEnd - valueBegin));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3342,8 +3323,11 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_viewportArguments = ViewportArguments(origin);
</span><del>-    processArguments(features, (void*)&amp;m_viewportArguments, setViewportFeature);
</del><span class="cx"> 
</span><ins>+    processArguments(features, [this](StringView key, StringView value) {
+        setViewportFeature(m_viewportArguments, *this, key, value);
+    });
+
</ins><span class="cx">     updateViewportArguments();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3362,17 +3346,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-// FIXME: Find a better place for this functionality.
-void setParserFeature(const String&amp; key, const String&amp; value, Document* document, void*)
-{
-    if (key == &quot;telephone&quot; &amp;&amp; equalLettersIgnoringASCIICase(value, &quot;no&quot;))
-        document-&gt;setIsTelephoneNumberParsingAllowed(false);
-}
-
</del><span class="cx"> void Document::processFormatDetection(const String&amp; features)
</span><span class="cx"> {
</span><del>-    ASSERT(!features.isNull());
-    processArguments(features, nullptr, setParserFeature);
</del><ins>+    // FIXME: Find a better place for this function.
+    processArguments(features, [this](StringView key, StringView value) {
+        if (equalLettersIgnoringASCIICase(key, &quot;telephone&quot;) &amp;&amp; equalLettersIgnoringASCIICase(value, &quot;no&quot;))
+            setIsTelephoneNumberParsingAllowed(false);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::processWebAppOrientations()
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/dom/Document.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1344,9 +1344,6 @@
</span><span class="cx">     void createRenderTree();
</span><span class="cx">     void detachParser();
</span><span class="cx"> 
</span><del>-    typedef void (*ArgumentsCallback)(const String&amp; keyString, const String&amp; valueString, Document*, void* data);
-    void processArguments(const String&amp; features, void* data, ArgumentsCallback);
-
</del><span class="cx">     // FontSelectorClient
</span><span class="cx">     virtual void fontsNeedUpdate(FontSelector&amp;) override final;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Element.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Element.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/dom/Element.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1201,7 +1201,7 @@
</span><span class="cx"> static inline AtomicString makeIdForStyleResolution(const AtomicString&amp; value, bool inQuirksMode)
</span><span class="cx"> {
</span><span class="cx">     if (inQuirksMode)
</span><del>-        return value.lower();
</del><ins>+        return value.convertToASCIILowercase();
</ins><span class="cx">     return value;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptElement.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptElement.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/dom/ScriptElement.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -149,17 +149,21 @@
</span><span class="cx">     // FIXME: isLegacySupportedJavaScriptLanguage() is not valid HTML5. It is used here to maintain backwards compatibility with existing layout tests. The specific violations are:
</span><span class="cx">     // - Allowing type=javascript. type= should only support MIME types, such as text/javascript.
</span><span class="cx">     // - Allowing a different set of languages for language= and type=. language= supports Javascript 1.1 and 1.4-1.6, but type= does not.
</span><del>-
</del><span class="cx">     String type = typeAttributeValue();
</span><span class="cx">     String language = languageAttributeValue();
</span><del>-    if (type.isEmpty() &amp;&amp; language.isEmpty())
-        return true; // Assume text/javascript.
</del><span class="cx">     if (type.isEmpty()) {
</span><del>-        type = &quot;text/&quot; + language.lower();
-        if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type) || isLegacySupportedJavaScriptLanguage(language))
</del><ins>+        if (language.isEmpty())
+            return true; // Assume text/javascript.
+        if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(&quot;text/&quot; + language))
</ins><span class="cx">             return true;
</span><del>-    } else if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSpace().lower()) || (supportLegacyTypes == AllowLegacyTypeInTypeAttribute &amp;&amp; isLegacySupportedJavaScriptLanguage(type)))
</del><ins>+        if (isLegacySupportedJavaScriptLanguage(language))
+            return true;
+        return false;
+    }
+    if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSpace()))
</ins><span class="cx">         return true;
</span><ins>+    if (supportLegacyTypes == AllowLegacyTypeInTypeAttribute &amp;&amp; isLegacySupportedJavaScriptLanguage(type))
+        return true;
</ins><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomViewportArgumentscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ViewportArguments.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ViewportArguments.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/dom/ViewportArguments.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -286,28 +286,30 @@
</span><span class="cx">         result.maximumScale = result.minimumScale = result.initialScale;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static float numericPrefix(const String&amp; keyString, const String&amp; valueString, Document* document, bool* ok = nullptr)
</del><ins>+static void reportViewportWarning(Document&amp;, ViewportErrorCode, StringView replacement1 = { }, StringView replacement2 = { });
+
+static float numericPrefix(Document&amp; document, StringView key, StringView value, bool* ok = nullptr)
</ins><span class="cx"> {
</span><span class="cx">     size_t parsedLength;
</span><del>-    float value;
-    if (valueString.is8Bit())
-        value = charactersToFloat(valueString.characters8(), valueString.length(), parsedLength);
</del><ins>+    float numericValue;
+    if (value.is8Bit())
+        numericValue = charactersToFloat(value.characters8(), value.length(), parsedLength);
</ins><span class="cx">     else
</span><del>-        value = charactersToFloat(valueString.characters16(), valueString.length(), parsedLength);
</del><ins>+        numericValue = charactersToFloat(value.characters16(), value.length(), parsedLength);
</ins><span class="cx">     if (!parsedLength) {
</span><del>-        reportViewportWarning(document, UnrecognizedViewportArgumentValueError, valueString, keyString);
</del><ins>+        reportViewportWarning(document, UnrecognizedViewportArgumentValueError, value, key);
</ins><span class="cx">         if (ok)
</span><span class="cx">             *ok = false;
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><del>-    if (parsedLength &lt; valueString.length())
-        reportViewportWarning(document, TruncatedViewportArgumentValueError, valueString, keyString);
</del><ins>+    if (parsedLength &lt; value.length())
+        reportViewportWarning(document, TruncatedViewportArgumentValueError, value, key);
</ins><span class="cx">     if (ok)
</span><span class="cx">         *ok = true;
</span><del>-    return value;
</del><ins>+    return numericValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static float findSizeValue(const String&amp; keyString, const String&amp; valueString, Document* document, bool* valueWasExplicit = nullptr)
</del><ins>+static float findSizeValue(Document&amp; document, StringView key, StringView value, bool* valueWasExplicit = nullptr)
</ins><span class="cx"> {
</span><span class="cx">     // 1) Non-negative number values are translated to px lengths.
</span><span class="cx">     // 2) Negative number values are translated to auto.
</span><span class="lines">@@ -317,13 +319,13 @@
</span><span class="cx">     if (valueWasExplicit)
</span><span class="cx">         *valueWasExplicit = true;
</span><span class="cx"> 
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;device-width&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;device-width&quot;))
</ins><span class="cx">         return ViewportArguments::ValueDeviceWidth;
</span><span class="cx"> 
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;device-height&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;device-height&quot;))
</ins><span class="cx">         return ViewportArguments::ValueDeviceHeight;
</span><span class="cx"> 
</span><del>-    float sizeValue = numericPrefix(keyString, valueString, document);
</del><ins>+    float sizeValue = numericPrefix(document, key, value);
</ins><span class="cx"> 
</span><span class="cx">     if (sizeValue &lt; 0) {
</span><span class="cx">         if (valueWasExplicit)
</span><span class="lines">@@ -334,7 +336,7 @@
</span><span class="cx">     return sizeValue;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static float findScaleValue(const String&amp; keyString, const String&amp; valueString, Document* document)
</del><ins>+static float findScaleValue(Document&amp; document, StringView key, StringView value)
</ins><span class="cx"> {
</span><span class="cx">     // 1) Non-negative number values are translated to &lt;number&gt; values.
</span><span class="cx">     // 2) Negative number values are translated to auto.
</span><span class="lines">@@ -342,74 +344,68 @@
</span><span class="cx">     // 4) device-width and device-height are translated to 10.0.
</span><span class="cx">     // 5) no and unknown values are translated to 0.0
</span><span class="cx"> 
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;yes&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;yes&quot;))
</ins><span class="cx">         return 1;
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;no&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;no&quot;))
</ins><span class="cx">         return 0;
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;device-width&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;device-width&quot;))
</ins><span class="cx">         return 10;
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;device-height&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;device-height&quot;))
</ins><span class="cx">         return 10;
</span><span class="cx"> 
</span><del>-    float value = numericPrefix(keyString, valueString, document);
</del><ins>+    float numericValue = numericPrefix(document, key, value);
</ins><span class="cx"> 
</span><del>-    if (value &lt; 0)
</del><ins>+    if (numericValue &lt; 0)
</ins><span class="cx">         return ViewportArguments::ValueAuto;
</span><span class="cx"> 
</span><del>-    if (value &gt; 10.0)
-        reportViewportWarning(document, MaximumScaleTooLargeError, String(), String());
</del><ins>+    if (numericValue &gt; 10.0)
+        reportViewportWarning(document, MaximumScaleTooLargeError);
</ins><span class="cx"> 
</span><del>-    return value;
</del><ins>+    return numericValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static float findBooleanValue(const String&amp; keyString, const String&amp; valueString, Document* document)
</del><ins>+// FIXME: It's kind of bizarre to use floating point values of 1 and 0 to represent true and false.
+static float findBooleanValue(Document&amp; document, StringView key, StringView value)
</ins><span class="cx"> {
</span><span class="cx">     // yes and no are used as keywords.
</span><span class="cx">     // Numbers &gt;= 1, numbers &lt;= -1, device-width and device-height are mapped to yes.
</span><span class="cx">     // Numbers in the range &lt;-1, 1&gt;, and unknown values, are mapped to no.
</span><span class="cx"> 
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;yes&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;yes&quot;))
</ins><span class="cx">         return 1;
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;no&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;no&quot;))
</ins><span class="cx">         return 0;
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;device-width&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;device-width&quot;))
</ins><span class="cx">         return 1;
</span><del>-    if (equalLettersIgnoringASCIICase(valueString, &quot;device-height&quot;))
</del><ins>+    if (equalLettersIgnoringASCIICase(value, &quot;device-height&quot;))
</ins><span class="cx">         return 1;
</span><del>-
-    float value = numericPrefix(keyString, valueString, document);
-
-    if (fabs(value) &lt; 1)
-        return 0;
-
-    return 1;
</del><ins>+    return std::abs(numericPrefix(document, key, value)) &gt;= 1 ? 1 : 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void setViewportFeature(const String&amp; keyString, const String&amp; valueString, Document* document, void* data)
</del><ins>+void setViewportFeature(ViewportArguments&amp; arguments, Document&amp; document, StringView key, StringView value)
</ins><span class="cx"> {
</span><del>-    ViewportArguments* arguments = static_cast&lt;ViewportArguments*&gt;(data);
-
-    if (keyString == &quot;width&quot;)
-        arguments-&gt;width = findSizeValue(keyString, valueString, document, &amp;arguments-&gt;widthWasExplicit);
-    else if (keyString == &quot;height&quot;)
-        arguments-&gt;height = findSizeValue(keyString, valueString, document);
-    else if (keyString == &quot;initial-scale&quot;)
-        arguments-&gt;zoom = findScaleValue(keyString, valueString, document);
-    else if (keyString == &quot;minimum-scale&quot;)
-        arguments-&gt;minZoom = findScaleValue(keyString, valueString, document);
-    else if (keyString == &quot;maximum-scale&quot;)
-        arguments-&gt;maxZoom = findScaleValue(keyString, valueString, document);
-    else if (keyString == &quot;user-scalable&quot;)
-        arguments-&gt;userZoom = findBooleanValue(keyString, valueString, document);
</del><ins>+    if (equalLettersIgnoringASCIICase(key, &quot;width&quot;))
+        arguments.width = findSizeValue(document, key, value, &amp;arguments.widthWasExplicit);
+    else if (equalLettersIgnoringASCIICase(key, &quot;height&quot;))
+        arguments.height = findSizeValue(document, key, value);
+    else if (equalLettersIgnoringASCIICase(key, &quot;initial-scale&quot;))
+        arguments.zoom = findScaleValue(document, key, value);
+    else if (equalLettersIgnoringASCIICase(key, &quot;minimum-scale&quot;))
+        arguments.minZoom = findScaleValue(document, key, value);
+    else if (equalLettersIgnoringASCIICase(key, &quot;maximum-scale&quot;))
+        arguments.maxZoom = findScaleValue(document, key, value);
+    else if (equalLettersIgnoringASCIICase(key, &quot;user-scalable&quot;))
+        arguments.userZoom = findBooleanValue(document, key, value);
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>-    else if (keyString == &quot;minimal-ui&quot;)
-        // FIXME: Ignore silently for now. This should eventually fall back to the warning.
-        { }
</del><ins>+    else if (equalLettersIgnoringASCIICase(key, &quot;minimal-ui&quot;)) {
+        // FIXME: Ignore silently for now. This code should eventually be removed
+        // so we start giving the warning in the web inspector as for other unimplemented keys.
+    }
</ins><span class="cx"> #endif
</span><del>-    else if (keyString == &quot;shrink-to-fit&quot;)
-        arguments-&gt;shrinkToFit = findBooleanValue(keyString, valueString, document);
</del><ins>+    else if (equalLettersIgnoringASCIICase(key, &quot;shrink-to-fit&quot;))
+        arguments.shrinkToFit = findBooleanValue(document, key, value);
</ins><span class="cx">     else
</span><del>-        reportViewportWarning(document, UnrecognizedViewportArgumentKeyError, keyString, String());
</del><ins>+        reportViewportWarning(document, UnrecognizedViewportArgumentKeyError, key);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const char* viewportErrorMessageTemplate(ViewportErrorCode errorCode)
</span><span class="lines">@@ -439,23 +435,24 @@
</span><span class="cx">     return MessageLevel::Error;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void reportViewportWarning(Document* document, ViewportErrorCode errorCode, const String&amp; replacement1, const String&amp; replacement2)
</del><ins>+void reportViewportWarning(Document&amp; document, ViewportErrorCode errorCode, StringView replacement1, StringView replacement2)
</ins><span class="cx"> {
</span><del>-    Frame* frame = document-&gt;frame();
-    if (!frame)
</del><ins>+    // FIXME: Why is this null check needed? Can't addConsoleMessage deal with this?
+    if (!document.frame())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     String message = viewportErrorMessageTemplate(errorCode);
</span><span class="cx">     if (!replacement1.isNull())
</span><del>-        message.replace(&quot;%replacement1&quot;, replacement1);
</del><ins>+        message.replace(&quot;%replacement1&quot;, replacement1.toStringWithoutCopying());
+    // FIXME: This will do the wrong thing if replacement1 contains the substring &quot;%replacement2&quot;.
</ins><span class="cx">     if (!replacement2.isNull())
</span><del>-        message.replace(&quot;%replacement2&quot;, replacement2);
</del><ins>+        message.replace(&quot;%replacement2&quot;, replacement2.toStringWithoutCopying());
</ins><span class="cx"> 
</span><del>-    if ((errorCode == UnrecognizedViewportArgumentValueError || errorCode == TruncatedViewportArgumentValueError) &amp;&amp; replacement1.find(';') != WTF::notFound)
</del><ins>+    if ((errorCode == UnrecognizedViewportArgumentValueError || errorCode == TruncatedViewportArgumentValueError) &amp;&amp; replacement1.contains(';'))
</ins><span class="cx">         message.append(&quot; Note that ';' is not a separator in viewport values. The list should be comma-separated.&quot;);
</span><span class="cx"> 
</span><span class="cx">     // FIXME: This message should be moved off the console once a solution to https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
</span><del>-    document-&gt;addConsoleMessage(MessageSource::Rendering, viewportErrorMessageLevel(errorCode), message);
</del><ins>+    document.addConsoleMessage(MessageSource::Rendering, viewportErrorMessageLevel(errorCode), message);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> TextStream&amp; operator&lt;&lt;(TextStream&amp; ts, const ViewportArguments&amp; viewportArguments)
</span></span></pre></div>
<a id="trunkSourceWebCoredomViewportArgumentsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ViewportArguments.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ViewportArguments.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/dom/ViewportArguments.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -134,8 +134,7 @@
</span><span class="cx"> WEBCORE_EXPORT void restrictScaleFactorToInitialScaleIfNotUserScalable(ViewportAttributes&amp; result);
</span><span class="cx"> float computeMinimumScaleFactorForContentContained(const ViewportAttributes&amp; result, const IntSize&amp; viewportSize, const IntSize&amp; contentSize);
</span><span class="cx"> 
</span><del>-void setViewportFeature(const String&amp; keyString, const String&amp; valueString, Document*, void* data);
-void reportViewportWarning(Document*, ViewportErrorCode, const String&amp; replacement1, const String&amp; replacement2);
</del><ins>+void setViewportFeature(ViewportArguments&amp;, Document&amp;, StringView key, StringView value);
</ins><span class="cx"> 
</span><span class="cx"> TextStream&amp; operator&lt;&lt;(TextStream&amp;, const ViewportArguments&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorCommandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/EditorCommand.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -411,7 +411,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool executeFormatBlock(Frame&amp; frame, Event*, EditorCommandSource, const String&amp; value)
</span><span class="cx"> {
</span><del>-    String tagName = value.lower();
</del><ins>+    String tagName = value.convertToASCIILowercase();
</ins><span class="cx">     if (tagName[0] == '&lt;' &amp;&amp; tagName[tagName.length() - 1] == '&gt;')
</span><span class="cx">         tagName = tagName.substring(1, tagName.length() - 2);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/fileapi/Blob.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(DeserializationContructor, const URL&amp; srcURL, const String&amp; type, long long size)
</span><del>-    : m_type(Blob::normalizedContentType(type))
</del><ins>+    : m_type(normalizedContentType(type))
</ins><span class="cx">     , m_size(size)
</span><span class="cx"> {
</span><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(const URL&amp; srcURL, long long start, long long end, const String&amp; type)
</span><del>-    : m_type(Blob::normalizedContentType(type))
</del><ins>+    : m_type(normalizedContentType(type))
</ins><span class="cx">     , m_size(-1) // size is not necessarily equal to end - start.
</span><span class="cx"> {
</span><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx">         // FIXME: JavaScript cannot represent sizes as large as unsigned long long, we need to
</span><span class="cx">         // come up with an exception to throw if file size is not representable.
</span><span class="cx">         unsigned long long actualSize = ThreadableBlobRegistry::blobSize(m_internalURL);
</span><del>-        m_size = (WTF::isInBounds&lt;long long&gt;(actualSize)) ? static_cast&lt;long long&gt;(actualSize) : 0;
</del><ins>+        m_size = WTF::isInBounds&lt;long long&gt;(actualSize) ? static_cast&lt;long long&gt;(actualSize) : 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return static_cast&lt;unsigned long long&gt;(m_size);
</span><span class="lines">@@ -130,61 +130,38 @@
</span><span class="cx"> 
</span><span class="cx"> bool Blob::isValidContentType(const String&amp; contentType)
</span><span class="cx"> {
</span><del>-    if (contentType.isNull())
-        return true;
-
-    size_t length = contentType.length();
-    if (contentType.is8Bit()) {
-        const LChar* characters = contentType.characters8();
-        for (size_t i = 0; i &lt; length; ++i) {
-            if (characters[i] &lt; 0x20 || characters[i] &gt; 0x7e)
-                return false;
-        }
-    } else {
-        const UChar* characters = contentType.characters16();
-        for (size_t i = 0; i &lt; length; ++i) {
-            if (characters[i] &lt; 0x20 || characters[i] &gt; 0x7e)
-                return false;
-        }
</del><ins>+    // FIXME: Do we really want to treat the empty string and null string as valid content types?
+    unsigned length = contentType.length();
+    for (unsigned i = 0; i &lt; length; ++i) {
+        if (contentType[i] &lt; 0x20 || contentType[i] &gt; 0x7e)
+            return false;
</ins><span class="cx">     }
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String Blob::normalizedContentType(const String&amp; contentType)
</span><span class="cx"> {
</span><del>-    if (Blob::isValidContentType(contentType))
-        return contentType.lower();
-    return emptyString();
</del><ins>+    if (!isValidContentType(contentType))
+        return emptyString();
+    return contentType.convertToASCIILowercase();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Blob::isNormalizedContentType(const String&amp; contentType)
</span><span class="cx"> {
</span><del>-    if (contentType.isNull())
-        return true;
-
-    size_t length = contentType.length();
-    if (contentType.is8Bit()) {
-        const LChar* characters = contentType.characters8();
-        for (size_t i = 0; i &lt; length; ++i) {
-            if (characters[i] &lt; 0x20 || characters[i] &gt; 0x7e)
-                return false;
-            if (isASCIIUpper(characters[i]))
-                return false;
-        }
-    } else {
-        const UChar* characters = contentType.characters16();
-        for (size_t i = 0; i &lt; length; ++i) {
-            if (characters[i] &lt; 0x20 || characters[i] &gt; 0x7e)
-                return false;
-            if (isASCIIUpper(characters[i]))
-                return false;
-        }
</del><ins>+    // FIXME: Do we really want to treat the empty string and null string as valid content types?
+    unsigned length = contentType.length();
+    for (size_t i = 0; i &lt; length; ++i) {
+        if (contentType[i] &lt; 0x20 || contentType[i] &gt; 0x7e)
+            return false;
+        if (isASCIIUpper(contentType[i]))
+            return false;
</ins><span class="cx">     }
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Blob::isNormalizedContentType(const CString&amp; contentType)
</span><span class="cx"> {
</span><ins>+    // FIXME: Do we really want to treat the empty string and null string as valid content types?
</ins><span class="cx">     size_t length = contentType.length();
</span><span class="cx">     const char* characters = contentType.data();
</span><span class="cx">     for (size_t i = 0; i &lt; length; ++i) {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -26,10 +26,10 @@
</span><span class="cx"> #include &quot;HTMLParserIdioms.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Decimal.h&quot;
</span><ins>+#include &quot;QualifiedName.h&quot;
</ins><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &lt;limits&gt;
</span><span class="cx"> #include &lt;wtf/MathExtras.h&gt;
</span><del>-#include &lt;wtf/text/AtomicString.h&gt;
</del><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlparserHTMLParserIdiomsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -25,18 +25,21 @@
</span><span class="cx"> #ifndef HTMLParserIdioms_h
</span><span class="cx"> #define HTMLParserIdioms_h
</span><span class="cx"> 
</span><del>-#include &quot;QualifiedName.h&quot;
</del><ins>+#include &lt;unicode/uchar.h&gt;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><del>-#include &lt;wtf/text/WTFString.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Decimal;
</span><ins>+class QualifiedName;
</ins><span class="cx"> 
</span><span class="cx"> // Space characters as defined by the HTML specification.
</span><ins>+template&lt;typename CharacterType&gt; bool isHTMLSpace(CharacterType);
+template&lt;typename CharacterType&gt; bool isComma(CharacterType);
+template&lt;typename CharacterType&gt; bool isHTMLSpaceOrComma(CharacterType);
</ins><span class="cx"> bool isHTMLLineBreak(UChar);
</span><span class="cx"> bool isNotHTMLSpace(UChar);
</span><del>-bool isHTMLSpaceButNotLineBreak(UChar character);
</del><ins>+bool isHTMLSpaceButNotLineBreak(UChar);
</ins><span class="cx"> 
</span><span class="cx"> // Strip leading and trailing whitespace as defined by the HTML specification. 
</span><span class="cx"> WEBCORE_EXPORT String stripLeadingAndTrailingHTMLSpaces(const String&amp;);
</span><span class="lines">@@ -59,9 +62,11 @@
</span><span class="cx"> // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-negative-integers
</span><span class="cx"> bool parseHTMLNonNegativeInteger(const String&amp;, unsigned int&amp;);
</span><span class="cx"> 
</span><ins>+bool threadSafeMatch(const QualifiedName&amp;, const QualifiedName&amp;);
+
</ins><span class="cx"> // Inline implementations of some of the functions declared above.
</span><del>-template&lt;typename CharType&gt;
-inline bool isHTMLSpace(CharType character)
</del><ins>+
+template&lt;typename CharacterType&gt; inline bool isHTMLSpace(CharacterType character)
</ins><span class="cx"> {
</span><span class="cx">     // Histogram from Apple's page load test combined with some ad hoc browsing some other test suites.
</span><span class="cx">     //
</span><span class="lines">@@ -81,16 +86,14 @@
</span><span class="cx">     return character &lt;= '\r' &amp;&amp; (character == '\n' || character == '\r');
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename CharType&gt;
-inline bool isComma(CharType character)
</del><ins>+template&lt;typename CharacterType&gt; inline bool isComma(CharacterType character)
</ins><span class="cx"> {
</span><span class="cx">     return character == ',';
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;typename CharType&gt;
-inline bool isHTMLSpaceOrComma(CharType character)
</del><ins>+template&lt;typename CharacterType&gt; inline bool isHTMLSpaceOrComma(CharacterType character)
</ins><span class="cx"> {
</span><del>-    return isComma(character) || isHTMLSpace&lt;CharType&gt;(character);
</del><ins>+    return isComma(character) || isHTMLSpace(character);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline bool isNotHTMLSpace(UChar character)
</span><span class="lines">@@ -103,8 +106,6 @@
</span><span class="cx">     return isHTMLSpace(character) &amp;&amp; !isHTMLLineBreak(character);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool threadSafeMatch(const QualifiedName&amp;, const QualifiedName&amp;);
-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderarchiveArchiveFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/loader/archive/ArchiveFactory.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -91,9 +91,8 @@
</span><span class="cx"> 
</span><span class="cx"> void ArchiveFactory::registerKnownArchiveMIMETypes()
</span><span class="cx"> {
</span><del>-    HashSet&lt;String&gt;&amp; mimeTypes = MIMETypeRegistry::getSupportedNonImageMIMETypes();
-    
-    for (const auto&amp; mimeType : archiveMIMETypes().keys())
</del><ins>+    auto&amp; mimeTypes = MIMETypeRegistry::getSupportedNonImageMIMETypes();
+    for (auto&amp; mimeType : archiveMIMETypes().keys())
</ins><span class="cx">         mimeTypes.add(mimeType);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMIMETypeRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MIMETypeRegistry.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -140,15 +140,15 @@
</span><span class="cx">     { &quot;audio/x-wav&quot;, &quot;wav&quot; }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-static HashSet&lt;String&gt;* supportedImageResourceMIMETypes;
-static HashSet&lt;String&gt;* supportedImageMIMETypes;
-static HashSet&lt;String&gt;* supportedImageMIMETypesForEncoding;
-static HashSet&lt;String&gt;* supportedJavaScriptMIMETypes;
-static HashSet&lt;String&gt;* supportedNonImageMIMETypes;
-static HashSet&lt;String&gt;* supportedMediaMIMETypes;
-static HashSet&lt;String&gt;* pdfMIMETypes;
-static HashSet&lt;String&gt;* pdfAndPostScriptMIMETypes;
-static HashSet&lt;String&gt;* unsupportedTextMIMETypes;
</del><ins>+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* supportedImageResourceMIMETypes;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* supportedImageMIMETypes;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* supportedImageMIMETypesForEncoding;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* supportedJavaScriptMIMETypes;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* supportedNonImageMIMETypes;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* supportedMediaMIMETypes;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* pdfMIMETypes;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* pdfAndPostScriptMIMETypes;
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;* unsupportedTextMIMETypes;
</ins><span class="cx"> 
</span><span class="cx"> typedef HashMap&lt;String, Vector&lt;String&gt;*, ASCIICaseInsensitiveHash&gt; MediaMIMETypeMap;
</span><span class="cx">     
</span><span class="lines">@@ -210,9 +210,9 @@
</span><span class="cx">         &quot;image/x-bmp&quot;, &quot;image/x-win-bitmap&quot;, &quot;image/x-windows-bmp&quot;, &quot;image/ms-bmp&quot;, &quot;image/x-ms-bmp&quot;,
</span><span class="cx">         &quot;application/bmp&quot;, &quot;application/x-bmp&quot;, &quot;application/x-win-bitmap&quot;,
</span><span class="cx">     };
</span><del>-    for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(malformedMIMETypes); ++i) {
-        supportedImageMIMETypes-&gt;add(malformedMIMETypes[i]);
-        supportedImageResourceMIMETypes-&gt;add(malformedMIMETypes[i]);
</del><ins>+    for (auto&amp; type : malformedMIMETypes) {
+        supportedImageMIMETypes-&gt;add(type);
+        supportedImageResourceMIMETypes-&gt;add(type);
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -228,9 +228,9 @@
</span><span class="cx">         &quot;image/x-icon&quot;,    // ico
</span><span class="cx">         &quot;image/x-xbitmap&quot;  // xbm
</span><span class="cx">     };
</span><del>-    for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(types); ++i) {
-        supportedImageMIMETypes-&gt;add(types[i]);
-        supportedImageResourceMIMETypes-&gt;add(types[i]);
</del><ins>+    for (auto&amp; type : types) {
+        supportedImageMIMETypes-&gt;add(type);
+        supportedImageResourceMIMETypes-&gt;add(type);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if USE(WEBP)
</span><span class="lines">@@ -243,7 +243,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void initializeSupportedImageMIMETypesForEncoding()
</span><span class="cx"> {
</span><del>-    supportedImageMIMETypesForEncoding = new HashSet&lt;String&gt;;
</del><ins>+    supportedImageMIMETypesForEncoding = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -307,8 +307,8 @@
</span><span class="cx">         &quot;application/pdf&quot;,
</span><span class="cx">         &quot;text/pdf&quot;
</span><span class="cx">     };
</span><del>-    for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(types); ++i)
-        pdfMIMETypes-&gt;add(types[i]);
</del><ins>+    for (auto&amp; type : types)
+        pdfMIMETypes-&gt;add(type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void initializePostScriptMIMETypes()
</span><span class="lines">@@ -337,14 +337,12 @@
</span><span class="cx">         &quot;application/x-ftp-directory&quot;,
</span><span class="cx"> #endif
</span><span class="cx">         &quot;multipart/x-mixed-replace&quot;
</span><del>-        // Note: ADDING a new type here will probably render it as HTML. This can
-        // result in cross-site scripting.
</del><ins>+        // Note: Adding a new type here will probably render it as HTML.
+        // This can result in cross-site scripting vulnerabilities.
</ins><span class="cx">     };
</span><del>-    COMPILE_ASSERT(sizeof(types) / sizeof(types[0]) &lt;= 16,
-                   nonimage_mime_types_must_be_less_than_or_equal_to_16);
</del><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(types); ++i)
-        supportedNonImageMIMETypes-&gt;add(types[i]);
</del><ins>+    for (auto&amp; type : types)
+        supportedNonImageMIMETypes-&gt;add(type);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_ARCHIVE) || ENABLE(MHTML)
</span><span class="cx">     ArchiveFactory::registerKnownArchiveMIMETypes();
</span><span class="lines">@@ -414,7 +412,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void initializeSupportedMediaMIMETypes()
</span><span class="cx"> {
</span><del>-    supportedMediaMIMETypes = new HashSet&lt;String&gt;;
</del><ins>+    supportedMediaMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;;
</ins><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx">     MediaPlayer::getSupportedTypes(*supportedMediaMIMETypes);
</span><span class="cx"> #endif
</span><span class="lines">@@ -441,29 +439,29 @@
</span><span class="cx">         &quot;text/vnd.sun.j2me.app-descriptor&quot;,
</span><span class="cx"> #endif
</span><span class="cx">     };
</span><del>-    for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(types); ++i)
-      unsupportedTextMIMETypes-&gt;add(types[i]);
</del><ins>+    for (auto&amp; type : types)
+        unsupportedTextMIMETypes-&gt;add(type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void initializeMIMETypeRegistry()
</span><span class="cx"> {
</span><del>-    supportedJavaScriptMIMETypes = new HashSet&lt;String&gt;;
</del><ins>+    supportedJavaScriptMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;;
</ins><span class="cx">     initializeSupportedJavaScriptMIMETypes();
</span><span class="cx"> 
</span><del>-    supportedNonImageMIMETypes = new HashSet&lt;String&gt;(*supportedJavaScriptMIMETypes);
</del><ins>+    supportedNonImageMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;(*supportedJavaScriptMIMETypes);
</ins><span class="cx">     initializeSupportedNonImageMimeTypes();
</span><span class="cx"> 
</span><del>-    supportedImageResourceMIMETypes = new HashSet&lt;String&gt;;
-    supportedImageMIMETypes = new HashSet&lt;String&gt;;
</del><ins>+    supportedImageResourceMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;;
+    supportedImageMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;;
</ins><span class="cx">     initializeSupportedImageMIMETypes();
</span><span class="cx"> 
</span><del>-    pdfMIMETypes = new HashSet&lt;String&gt;;
</del><ins>+    pdfMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;;
</ins><span class="cx">     initializePDFMIMETypes();
</span><span class="cx"> 
</span><del>-    pdfAndPostScriptMIMETypes = new HashSet&lt;String&gt;(*pdfMIMETypes);
</del><ins>+    pdfAndPostScriptMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;(*pdfMIMETypes);
</ins><span class="cx">     initializePostScriptMIMETypes();
</span><span class="cx"> 
</span><del>-    unsupportedTextMIMETypes = new HashSet&lt;String&gt;;
</del><ins>+    unsupportedTextMIMETypes = new HashSet&lt;String, ASCIICaseInsensitiveHash&gt;;
</ins><span class="cx">     initializeUnsupportedTextMIMETypes();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -584,35 +582,35 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getSupportedImageMIMETypes()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getSupportedImageMIMETypes()
</ins><span class="cx"> {
</span><span class="cx">     if (!supportedImageMIMETypes)
</span><span class="cx">         initializeMIMETypeRegistry();
</span><span class="cx">     return *supportedImageMIMETypes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getSupportedImageResourceMIMETypes()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getSupportedImageResourceMIMETypes()
</ins><span class="cx"> {
</span><span class="cx">     if (!supportedImageResourceMIMETypes)
</span><span class="cx">         initializeMIMETypeRegistry();
</span><span class="cx">     return *supportedImageResourceMIMETypes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
</ins><span class="cx"> {
</span><span class="cx">     if (!supportedImageMIMETypesForEncoding)
</span><span class="cx">         initializeSupportedImageMIMETypesForEncoding();
</span><span class="cx">     return *supportedImageMIMETypesForEncoding;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getSupportedNonImageMIMETypes()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getSupportedNonImageMIMETypes()
</ins><span class="cx"> {
</span><span class="cx">     if (!supportedNonImageMIMETypes)
</span><span class="cx">         initializeMIMETypeRegistry();
</span><span class="cx">     return *supportedNonImageMIMETypes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getSupportedMediaMIMETypes()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getSupportedMediaMIMETypes()
</ins><span class="cx"> {
</span><span class="cx">     if (!supportedMediaMIMETypes)
</span><span class="cx">         initializeSupportedMediaMIMETypes();
</span><span class="lines">@@ -620,21 +618,21 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getPDFMIMETypes()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getPDFMIMETypes()
</ins><span class="cx"> {
</span><span class="cx">     if (!pdfMIMETypes)
</span><span class="cx">         initializeMIMETypeRegistry();
</span><span class="cx">     return *pdfMIMETypes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getPDFAndPostScriptMIMETypes()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getPDFAndPostScriptMIMETypes()
</ins><span class="cx"> {
</span><span class="cx">     if (!pdfAndPostScriptMIMETypes)
</span><span class="cx">         initializeMIMETypeRegistry();
</span><span class="cx">     return *pdfAndPostScriptMIMETypes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-HashSet&lt;String&gt;&amp; MIMETypeRegistry::getUnsupportedTextMIMETypes()
</del><ins>+HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MIMETypeRegistry::getUnsupportedTextMIMETypes()
</ins><span class="cx"> {
</span><span class="cx">     if (!unsupportedTextMIMETypes)
</span><span class="cx">         initializeMIMETypeRegistry();
</span><span class="lines">@@ -648,23 +646,29 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !USE(CURL)
</span><ins>+
+// FIXME: Not sure why it makes sense to have a cross-platform function when only CURL has the concept
+// of a &quot;normalized&quot; MIME type.
</ins><span class="cx"> String MIMETypeRegistry::getNormalizedMIMEType(const String&amp; mimeType)
</span><span class="cx"> {
</span><span class="cx">     return mimeType;
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> 
</span><del>-#if USE(CURL)
-typedef HashMap&lt;String, String&gt; MIMETypeAssociationMap;
</del><ins>+#else
</ins><span class="cx"> 
</span><ins>+typedef HashMap&lt;String, String, ASCIICaseInsensitiveHash&gt; MIMETypeAssociationMap;
+
</ins><span class="cx"> static const MIMETypeAssociationMap&amp; mimeTypeAssociationMap()
</span><span class="cx"> {
</span><span class="cx">     static MIMETypeAssociationMap* mimeTypeMap = 0;
</span><span class="cx">     if (mimeTypeMap)
</span><span class="cx">         return *mimeTypeMap;
</span><span class="cx"> 
</span><ins>+    // FIXME: Should not allocate this on the heap; use NeverDestroyed instead.
</ins><span class="cx">     mimeTypeMap = new MIMETypeAssociationMap;
</span><span class="cx"> 
</span><ins>+    // FIXME: Writing the function out like this will create a giant function.
+    // Should use a loop instead.
</ins><span class="cx">     mimeTypeMap-&gt;add(ASCIILiteral(&quot;image/x-ms-bmp&quot;), ASCIILiteral(&quot;image/bmp&quot;));
</span><span class="cx">     mimeTypeMap-&gt;add(ASCIILiteral(&quot;image/x-windows-bmp&quot;), ASCIILiteral(&quot;image/bmp&quot;));
</span><span class="cx">     mimeTypeMap-&gt;add(ASCIILiteral(&quot;image/x-bmp&quot;), ASCIILiteral(&quot;image/bmp&quot;));
</span><span class="lines">@@ -716,13 +720,12 @@
</span><span class="cx"> 
</span><span class="cx"> String MIMETypeRegistry::getNormalizedMIMEType(const String&amp; mimeType)
</span><span class="cx"> {
</span><del>-    MIMETypeAssociationMap::const_iterator it = mimeTypeAssociationMap().find(mimeType);
-
</del><ins>+    auto it = mimeTypeAssociationMap().find(mimeType);
</ins><span class="cx">     if (it != mimeTypeAssociationMap().end())
</span><span class="cx">         return it-&gt;value;
</span><del>-
</del><span class="cx">     return mimeType;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMIMETypeRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MIMETypeRegistry.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MIMETypeRegistry.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/MIMETypeRegistry.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static String getMIMETypeForExtension(const String&amp; extension);
</span><span class="cx"> 
</span><ins>+    // FIXME: WebKit coding style says we should not have the word &quot;get&quot; in the names of these functions.
</ins><span class="cx">     static Vector&lt;String&gt; getExtensionsForMIMEType(const String&amp; type);
</span><span class="cx">     WEBCORE_EXPORT static String getPreferredExtensionForMIMEType(const String&amp; type);
</span><span class="cx">     static String getMediaMIMETypeForExtension(const String&amp; extension);
</span><span class="lines">@@ -44,57 +45,60 @@
</span><span class="cx"> 
</span><span class="cx">     static String getMIMETypeForPath(const String&amp; path);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is suitable for being loaded inline as an
</del><ins>+    // Check to see if a MIME type is suitable for being loaded inline as an
</ins><span class="cx">     // image (e.g., &lt;img&gt; tags).
</span><span class="cx">     WEBCORE_EXPORT static bool isSupportedImageMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is suitable for being loaded as an image
</del><ins>+    // Check to see if a MIME type is suitable for being loaded as an image
</ins><span class="cx">     // document in a frame.
</span><span class="cx">     WEBCORE_EXPORT static bool isSupportedImageResourceMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is suitable for being encoded.
</del><ins>+    // Check to see if a MIME type is suitable for being encoded.
</ins><span class="cx">     static bool isSupportedImageMIMETypeForEncoding(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is suitable for being loaded as a JavaScript
-    // resource.
</del><ins>+    // Check to see if a MIME type is suitable for being loaded as a JavaScript resource.
</ins><span class="cx">     static bool isSupportedJavaScriptMIMEType(const String&amp; mimeType);    
</span><span class="cx"> 
</span><del>-    // Check to see if a non-image mime type is suitable for being loaded as a
</del><ins>+    // Check to see if a non-image MIME type is suitable for being loaded as a
</ins><span class="cx">     // document in a frame.  Includes supported JavaScript MIME types.
</span><span class="cx">     WEBCORE_EXPORT static bool isSupportedNonImageMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is suitable for being loaded using &lt;video&gt; and &lt;audio&gt;
</del><ins>+    // Check to see if a MIME type is suitable for being loaded using &lt;video&gt; and &lt;audio&gt;.
</ins><span class="cx">     WEBCORE_EXPORT static bool isSupportedMediaMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if the mime type is not suitable for being loaded as a text
-    // document in a frame. Only valid for mime types begining with &quot;text/&quot;.
</del><ins>+    // Check to see if the MIME type is not suitable for being loaded as a text
+    // document in a frame. Only valid for MIME types begining with &quot;text/&quot;.
</ins><span class="cx">     static bool isUnsupportedTextMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is a valid Java applet mime type
</del><ins>+    // Check to see if a MIME type is a valid Java applet mime type.
</ins><span class="cx">     WEBCORE_EXPORT static bool isJavaAppletMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is a plugin implemented by the
-    // browser (e.g. a Qt Plugin).
</del><ins>+    // Check to see if a MIME type is a plugin implemented by the browser.
</ins><span class="cx">     static bool isApplicationPluginMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is one of the common PDF/PS types.
</del><ins>+    // Check to see if a MIME type is one of the common PDF/PS types.
</ins><span class="cx">     WEBCORE_EXPORT static bool isPDFOrPostScriptMIMEType(const String&amp; mimeType);
</span><span class="cx">     static bool isPDFMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    // Check to see if a mime type is suitable for being shown inside a page.
-    // Returns true if any of isSupportedImageMIMEType(), isSupportedNonImageMIMEType(), isSupportedMediaMIMEType() returns true
-    // or if given mime type begins with &quot;text/&quot; and isUnsupportedTextMIMEType() returns false.
</del><ins>+    // Check to see if a MIME type is suitable for being shown inside a page.
+    // Returns true if any of isSupportedImageMIMEType(), isSupportedNonImageMIMEType(), or
+    // isSupportedMediaMIMEType() returns true or if the given MIME type begins with
+    // &quot;text/&quot; and isUnsupportedTextMIMEType() returns false.
</ins><span class="cx">     WEBCORE_EXPORT static bool canShowMIMEType(const String&amp; mimeType);
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT static HashSet&lt;String&gt;&amp; getSupportedImageMIMETypes();
-    static HashSet&lt;String&gt;&amp; getSupportedImageResourceMIMETypes();
-    static HashSet&lt;String&gt;&amp; getSupportedImageMIMETypesForEncoding();
-    WEBCORE_EXPORT static HashSet&lt;String&gt;&amp; getSupportedNonImageMIMETypes();
-    WEBCORE_EXPORT static HashSet&lt;String&gt;&amp; getSupportedMediaMIMETypes();
-    WEBCORE_EXPORT static HashSet&lt;String&gt;&amp; getPDFMIMETypes();
-    static HashSet&lt;String&gt;&amp; getPDFAndPostScriptMIMETypes();
-    WEBCORE_EXPORT static HashSet&lt;String&gt;&amp; getUnsupportedTextMIMETypes();
</del><ins>+    // FIXME: WebKit coding style says we should not have the word &quot;get&quot; in the names of these functions.
+    // FIXME: Would be nice to find a way to avoid exposing these sets, even worse exposing non-const references.
+    WEBCORE_EXPORT static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getSupportedImageMIMETypes();
+    static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getSupportedImageResourceMIMETypes();
+    static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getSupportedImageMIMETypesForEncoding();
+    WEBCORE_EXPORT static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getSupportedNonImageMIMETypes();
+    WEBCORE_EXPORT static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getSupportedMediaMIMETypes();
+    WEBCORE_EXPORT static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getPDFMIMETypes();
+    static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getPDFAndPostScriptMIMETypes();
+    WEBCORE_EXPORT static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; getUnsupportedTextMIMETypes();
</ins><span class="cx"> 
</span><ins>+    // FIXME: WebKit coding style says we should not have the word &quot;get&quot; in the name of this function.
+    // FIXME: Unclear what the concept of a normalized MIME type is; currently it's a platform-specific notion.
</ins><span class="cx">     static String getNormalizedMIMEType(const String&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformSchemeRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/SchemeRegistry.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/SchemeRegistry.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/SchemeRegistry.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -96,9 +96,9 @@
</span><span class="cx">     return emptyDocumentSchemes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static HashSet&lt;String&gt;&amp; schemesForbiddenFromDomainRelaxation()
</del><ins>+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; schemesForbiddenFromDomainRelaxation()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; schemes;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; schemes;
</ins><span class="cx">     return schemes;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URL.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URL.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/URL.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -2121,15 +2121,19 @@
</span><span class="cx"> String mimeTypeFromDataURL(const String&amp; url)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(protocolIs(url, &quot;data&quot;));
</span><del>-    size_t index = url.find(';');
</del><ins>+
+    // FIXME: What's the right behavior when the URL has a comma first, but a semicolon later?
+    // Currently this code will break at the semicolon in that case. Not sure that's correct.
+    auto index = url.find(';', 5);
</ins><span class="cx">     if (index == notFound)
</span><del>-        index = url.find(',');
-    if (index != notFound) {
-        if (index &gt; 5)
-            return url.substring(5, index - 5).lower();
-        return &quot;text/plain&quot;; // Data URLs with no MIME type are considered text/plain.
</del><ins>+        index = url.find(',', 5);
+    if (index == notFound) {
+        // FIXME: There was an old comment here that made it sound like this should be returning text/plain.
+        // But we have been returning empty string here for some time, so not changing its behavior at this time.
+        return emptyString();
</ins><span class="cx">     }
</span><del>-    return &quot;&quot;;
</del><ins>+    ASSERT(index &gt;= 5);
+    return url.substring(5, index - 5).convertToASCIILowercase();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String mimeTypeFromURL(const URL&amp; url)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -865,10 +865,10 @@
</span><span class="cx">     return engine-&gt;supportsTypeAndCodecs(parameters);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayer::getSupportedTypes(HashSet&lt;String&gt;&amp; types)
</del><ins>+void MediaPlayer::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types)
</ins><span class="cx"> {
</span><span class="cx">     for (auto&amp; engine : installedMediaEngines()) {
</span><del>-        HashSet&lt;String&gt; engineTypes;
</del><ins>+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; engineTypes;
</ins><span class="cx">         engine.getSupportedTypes(engineTypes);
</span><span class="cx">         types.add(engineTypes.begin(), engineTypes.end());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx">     // Media engine support.
</span><span class="cx">     enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
</span><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;, const MediaPlayerSupportsTypeClient*);
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp;);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp;);
</ins><span class="cx">     static bool isAvailable();
</span><span class="cx">     static void getSitesInMediaCache(Vector&lt;String&gt;&amp;);
</span><span class="cx">     static void clearMediaCache();
</span><span class="lines">@@ -631,7 +631,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> typedef std::function&lt;std::unique_ptr&lt;MediaPlayerPrivateInterface&gt; (MediaPlayer*)&gt; CreateMediaEnginePlayer;
</span><del>-typedef void (*MediaEngineSupportedTypes)(HashSet&lt;String&gt;&amp; types);
</del><ins>+typedef void (*MediaEngineSupportedTypes)(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx"> typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters&amp; parameters);
</span><span class="cx"> typedef void (*MediaEngineGetSitesInMediaCache)(Vector&lt;String&gt;&amp;);
</span><span class="cx"> typedef void (*MediaEngineClearMediaCache)();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1111,12 +1111,12 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const HashSet&lt;String&gt;&amp; MediaPlayerPrivateAVFoundation::staticMIMETypeList()
</del><ins>+const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; MediaPlayerPrivateAVFoundation::staticMIMETypeList()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache = []() {
-        HashSet&lt;String&gt; types;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache = []() {
+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; types;
</ins><span class="cx"> 
</span><del>-        static const char* typeNames[] = {
</del><ins>+        static const char* const typeNames[] = {
</ins><span class="cx">             &quot;application/vnd.apple.mpegurl&quot;,
</span><span class="cx">             &quot;application/x-mpegurl&quot;,
</span><span class="cx">             &quot;audio/3gpp&quot;,
</span><span class="lines">@@ -1148,8 +1148,8 @@
</span><span class="cx">             &quot;video/x-mpeg&quot;,
</span><span class="cx">             &quot;video/x-mpg&quot;,
</span><span class="cx">         };
</span><del>-        for (size_t i = 0; i &lt; WTF_ARRAY_LENGTH(typeNames); ++i)
-            types.add(typeNames[i]);
</del><ins>+        for (auto&amp; type : typeNames)
+            types.add(type);
</ins><span class="cx"> 
</span><span class="cx">         return types;
</span><span class="cx">     }();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -259,7 +259,7 @@
</span><span class="cx">     virtual void updateVideoLayerGravity() = 0;
</span><span class="cx"> 
</span><span class="cx">     static bool isUnsupportedMIMEType(const String&amp;);
</span><del>-    static const HashSet&lt;String&gt;&amp; staticMIMETypeList();
</del><ins>+    static const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; staticMIMETypeList();
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     void updateStates();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -882,25 +882,21 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-static const HashSet&lt;String&gt;&amp; avfMIMETypes()
</del><ins>+static const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; avfMIMETypes()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache = []() {
-        HashSet&lt;String&gt; types;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache = []() {
+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; types;
</ins><span class="cx">         RetainPtr&lt;CFArrayRef&gt; avTypes = adoptCF(AVCFURLAssetCopyAudiovisualMIMETypes());
</span><del>-
</del><span class="cx">         CFIndex typeCount = CFArrayGetCount(avTypes.get());
</span><del>-        for (CFIndex i = 0; i &lt; typeCount; ++i) {
-            String mimeType = (CFStringRef)(CFArrayGetValueAtIndex(avTypes.get(), i));
-            types.add(mimeType.lower());
-        }
-
</del><ins>+        for (CFIndex i = 0; i &lt; typeCount; ++i)
+            types.add((CFStringRef)CFArrayGetValueAtIndex(avTypes.get(), i));
</ins><span class="cx">         return types;
</span><span class="cx">     }();
</span><span class="cx"> 
</span><span class="cx">     return cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateAVFoundationCF::getSupportedTypes(HashSet&lt;String&gt;&amp; supportedTypes)
</del><ins>+void MediaPlayerPrivateAVFoundationCF::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; supportedTypes)
</ins><span class="cx"> {
</span><span class="cx">     supportedTypes = avfMIMETypes();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     static void registerMediaEngine(MediaEngineRegistrar);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx">     static bool supportsKeySystem(const String&amp; keySystem, const String&amp; mimeType);
</span><span class="cx">     static bool isAvailable();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // engine support
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx">     static bool supportsKeySystem(const String&amp; keySystem, const String&amp; mimeType);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1505,22 +1505,17 @@
</span><span class="cx">         context.setImageInterpolationQuality(InterpolationLow);
</span><span class="cx">         IntRect paintRect(IntPoint(0, 0), IntSize(rect.width(), rect.height()));
</span><span class="cx">         CGContextDrawImage(context.platformContext(), CGRectMake(0, 0, paintRect.width(), paintRect.height()), image.get());
</span><del>-        image = 0;
</del><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const HashSet&lt;String&gt;&amp; avfMIMETypes()
</del><ins>+static const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; avfMIMETypes()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache = [] () {
-        HashSet&lt;String&gt; types;
-
-        NSArray *nsTypes = [AVURLAsset audiovisualMIMETypes];
-        for (NSString *mimeType in nsTypes)
-            types.add([mimeType lowercaseString]);
-
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache = []() {
+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; types;
+        for (NSString *type in [AVURLAsset audiovisualMIMETypes])
+            types.add(type);
</ins><span class="cx">         return types;
</span><span class="cx">     }();
</span><del>-
</del><span class="cx">     
</span><span class="cx">     return cache;
</span><span class="cx"> }
</span><span class="lines">@@ -1547,7 +1542,7 @@
</span><span class="cx">     return image;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet&lt;String&gt;&amp; supportedTypes)
</del><ins>+void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; supportedTypes)
</ins><span class="cx"> {
</span><span class="cx">     supportedTypes = avfMIMETypes();
</span><span class="cx"> } 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx"> 
</span><span class="cx">     // MediaPlayer Factory Methods
</span><span class="cx">     static bool isAvailable();
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx"> 
</span><span class="cx">     void addDisplayLayer(AVSampleBufferDisplayLayer*);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaSourceAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -218,9 +218,9 @@
</span><span class="cx">         &amp;&amp; class_getInstanceMethod(getAVSampleBufferAudioRendererClass(), @selector(setMuted:));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const HashSet&lt;String&gt;&amp; mimeTypeCache()
</del><ins>+static const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; mimeTypeCache()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache;
</ins><span class="cx">     static bool typeListInitialized = false;
</span><span class="cx"> 
</span><span class="cx">     if (typeListInitialized)
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx">     return cache;
</span><span class="cx"> } 
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet&lt;String&gt;&amp; types)
</del><ins>+void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types)
</ins><span class="cx"> {
</span><span class="cx">     types = mimeTypeCache();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx"> 
</span><span class="cx">     // MediaPlayer Factory Methods
</span><span class="cx">     static bool isAvailable();
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx"> 
</span><span class="cx">     MediaPlayer::NetworkState networkState() const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateMediaStreamAVFObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -83,9 +83,9 @@
</span><span class="cx">     return AVFoundationLibrary() &amp;&amp; isCoreMediaFrameworkAvailable();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet&lt;String&gt;&amp; types)
</del><ins>+void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types)
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache;
</ins><span class="cx">     types = cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include &lt;limits&gt;
</span><span class="cx"> #include &lt;wtf/HexNumber.h&gt;
</span><span class="cx"> #include &lt;wtf/MediaTime.h&gt;
</span><ins>+#include &lt;wtf/NeverDestroyed.h&gt;
</ins><span class="cx"> #include &lt;wtf/glib/GUniquePtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -1659,116 +1660,111 @@
</span><span class="cx">     m_readyTimerHandler.stop();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static HashSet&lt;String&gt; mimeTypeCache()
</del><ins>+// FIXME: In what sense is this a &quot;cache&quot;?
+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; mimeTypeCache()
</ins><span class="cx"> {
</span><del>-    initializeGStreamerAndRegisterWebKitElements();
-
-    DEPRECATED_DEFINE_STATIC_LOCAL(HashSet&lt;String&gt;, cache, ());
-    static bool typeListInitialized = false;
-
-    if (typeListInitialized)
-        return cache;
-
-    const char* mimeTypes[] = {
-        &quot;application/ogg&quot;,
-        &quot;application/vnd.apple.mpegurl&quot;,
-        &quot;application/vnd.rn-realmedia&quot;,
-        &quot;application/x-3gp&quot;,
-        &quot;application/x-pn-realaudio&quot;,
-        &quot;application/x-mpegurl&quot;,
-        &quot;audio/3gpp&quot;,
-        &quot;audio/aac&quot;,
-        &quot;audio/flac&quot;,
-        &quot;audio/iLBC-sh&quot;,
-        &quot;audio/midi&quot;,
-        &quot;audio/mobile-xmf&quot;,
-        &quot;audio/mp1&quot;,
-        &quot;audio/mp2&quot;,
-        &quot;audio/mp3&quot;,
-        &quot;audio/mp4&quot;,
-        &quot;audio/mpeg&quot;,
-        &quot;audio/ogg&quot;,
-        &quot;audio/opus&quot;,
-        &quot;audio/qcelp&quot;,
-        &quot;audio/riff-midi&quot;,
-        &quot;audio/speex&quot;,
-        &quot;audio/wav&quot;,
-        &quot;audio/webm&quot;,
-        &quot;audio/x-ac3&quot;,
-        &quot;audio/x-aiff&quot;,
-        &quot;audio/x-amr-nb-sh&quot;,
-        &quot;audio/x-amr-wb-sh&quot;,
-        &quot;audio/x-au&quot;,
-        &quot;audio/x-ay&quot;,
-        &quot;audio/x-celt&quot;,
-        &quot;audio/x-dts&quot;,
-        &quot;audio/x-flac&quot;,
-        &quot;audio/x-gbs&quot;,
-        &quot;audio/x-gsm&quot;,
-        &quot;audio/x-gym&quot;,
-        &quot;audio/x-imelody&quot;,
-        &quot;audio/x-ircam&quot;,
-        &quot;audio/x-kss&quot;,
-        &quot;audio/x-m4a&quot;,
-        &quot;audio/x-mod&quot;,
-        &quot;audio/x-mp3&quot;,
-        &quot;audio/x-mpeg&quot;,
-        &quot;audio/x-musepack&quot;,
-        &quot;audio/x-nist&quot;,
-        &quot;audio/x-nsf&quot;,
-        &quot;audio/x-paris&quot;,
-        &quot;audio/x-sap&quot;,
-        &quot;audio/x-sbc&quot;,
-        &quot;audio/x-sds&quot;,
-        &quot;audio/x-shorten&quot;,
-        &quot;audio/x-sid&quot;,
-        &quot;audio/x-spc&quot;,
-        &quot;audio/x-speex&quot;,
-        &quot;audio/x-svx&quot;,
-        &quot;audio/x-ttafile&quot;,
-        &quot;audio/x-vgm&quot;,
-        &quot;audio/x-voc&quot;,
-        &quot;audio/x-vorbis+ogg&quot;,
-        &quot;audio/x-w64&quot;,
-        &quot;audio/x-wav&quot;,
-        &quot;audio/x-wavpack&quot;,
-        &quot;audio/x-wavpack-correction&quot;,
-        &quot;video/3gpp&quot;,
-        &quot;video/flv&quot;,
-        &quot;video/mj2&quot;,
-        &quot;video/mp2t&quot;,
-        &quot;video/mp4&quot;,
-        &quot;video/mpeg&quot;,
-        &quot;video/mpegts&quot;,
-        &quot;video/ogg&quot;,
-        &quot;video/quicktime&quot;,
-        &quot;video/vivo&quot;,
-        &quot;video/webm&quot;,
-        &quot;video/x-cdxa&quot;,
-        &quot;video/x-dirac&quot;,
-        &quot;video/x-dv&quot;,
-        &quot;video/x-fli&quot;,
-        &quot;video/x-flv&quot;,
-        &quot;video/x-h263&quot;,
-        &quot;video/x-ivf&quot;,
-        &quot;video/x-m4v&quot;,
-        &quot;video/x-matroska&quot;,
-        &quot;video/x-mng&quot;,
-        &quot;video/x-ms-asf&quot;,
-        &quot;video/x-msvideo&quot;,
-        &quot;video/x-mve&quot;,
-        &quot;video/x-nuv&quot;,
-        &quot;video/x-vcd&quot;
-    };
-
-    for (unsigned i = 0; i &lt; (sizeof(mimeTypes) / sizeof(*mimeTypes)); ++i)
-        cache.add(String(mimeTypes[i]));
-
-    typeListInitialized = true;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache = []() {
+        initializeGStreamerAndRegisterWebKitElements();
+        HashSet&lt;String, ASCIICaseInsensitiveHash&gt; set;
+        const char* mimeTypes[] = {
+            &quot;application/ogg&quot;,
+            &quot;application/vnd.apple.mpegurl&quot;,
+            &quot;application/vnd.rn-realmedia&quot;,
+            &quot;application/x-3gp&quot;,
+            &quot;application/x-pn-realaudio&quot;,
+            &quot;application/x-mpegurl&quot;,
+            &quot;audio/3gpp&quot;,
+            &quot;audio/aac&quot;,
+            &quot;audio/flac&quot;,
+            &quot;audio/iLBC-sh&quot;,
+            &quot;audio/midi&quot;,
+            &quot;audio/mobile-xmf&quot;,
+            &quot;audio/mp1&quot;,
+            &quot;audio/mp2&quot;,
+            &quot;audio/mp3&quot;,
+            &quot;audio/mp4&quot;,
+            &quot;audio/mpeg&quot;,
+            &quot;audio/ogg&quot;,
+            &quot;audio/opus&quot;,
+            &quot;audio/qcelp&quot;,
+            &quot;audio/riff-midi&quot;,
+            &quot;audio/speex&quot;,
+            &quot;audio/wav&quot;,
+            &quot;audio/webm&quot;,
+            &quot;audio/x-ac3&quot;,
+            &quot;audio/x-aiff&quot;,
+            &quot;audio/x-amr-nb-sh&quot;,
+            &quot;audio/x-amr-wb-sh&quot;,
+            &quot;audio/x-au&quot;,
+            &quot;audio/x-ay&quot;,
+            &quot;audio/x-celt&quot;,
+            &quot;audio/x-dts&quot;,
+            &quot;audio/x-flac&quot;,
+            &quot;audio/x-gbs&quot;,
+            &quot;audio/x-gsm&quot;,
+            &quot;audio/x-gym&quot;,
+            &quot;audio/x-imelody&quot;,
+            &quot;audio/x-ircam&quot;,
+            &quot;audio/x-kss&quot;,
+            &quot;audio/x-m4a&quot;,
+            &quot;audio/x-mod&quot;,
+            &quot;audio/x-mp3&quot;,
+            &quot;audio/x-mpeg&quot;,
+            &quot;audio/x-musepack&quot;,
+            &quot;audio/x-nist&quot;,
+            &quot;audio/x-nsf&quot;,
+            &quot;audio/x-paris&quot;,
+            &quot;audio/x-sap&quot;,
+            &quot;audio/x-sbc&quot;,
+            &quot;audio/x-sds&quot;,
+            &quot;audio/x-shorten&quot;,
+            &quot;audio/x-sid&quot;,
+            &quot;audio/x-spc&quot;,
+            &quot;audio/x-speex&quot;,
+            &quot;audio/x-svx&quot;,
+            &quot;audio/x-ttafile&quot;,
+            &quot;audio/x-vgm&quot;,
+            &quot;audio/x-voc&quot;,
+            &quot;audio/x-vorbis+ogg&quot;,
+            &quot;audio/x-w64&quot;,
+            &quot;audio/x-wav&quot;,
+            &quot;audio/x-wavpack&quot;,
+            &quot;audio/x-wavpack-correction&quot;,
+            &quot;video/3gpp&quot;,
+            &quot;video/flv&quot;,
+            &quot;video/mj2&quot;,
+            &quot;video/mp2t&quot;,
+            &quot;video/mp4&quot;,
+            &quot;video/mpeg&quot;,
+            &quot;video/mpegts&quot;,
+            &quot;video/ogg&quot;,
+            &quot;video/quicktime&quot;,
+            &quot;video/vivo&quot;,
+            &quot;video/webm&quot;,
+            &quot;video/x-cdxa&quot;,
+            &quot;video/x-dirac&quot;,
+            &quot;video/x-dv&quot;,
+            &quot;video/x-fli&quot;,
+            &quot;video/x-flv&quot;,
+            &quot;video/x-h263&quot;,
+            &quot;video/x-ivf&quot;,
+            &quot;video/x-m4v&quot;,
+            &quot;video/x-matroska&quot;,
+            &quot;video/x-mng&quot;,
+            &quot;video/x-ms-asf&quot;,
+            &quot;video/x-msvideo&quot;,
+            &quot;video/x-mve&quot;,
+            &quot;video/x-nuv&quot;,
+            &quot;video/x-vcd&quot;
+        };
+        for (auto&amp; type : mimeTypes)
+            set.add(type);
+        return set;
+    }();
</ins><span class="cx">     return cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateGStreamer::getSupportedTypes(HashSet&lt;String&gt;&amp; types)
</del><ins>+void MediaPlayerPrivateGStreamer::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types)
</ins><span class="cx"> {
</span><span class="cx">     types = mimeTypeCache();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp;);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp;);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx"> 
</span><span class="cx">     static bool isAvailable();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // engine support
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx"> 
</span><span class="cx">     static void getSitesInMediaCache(Vector&lt;String&gt;&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacMediaPlayerPrivateQTKitmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1232,14 +1232,13 @@
</span><span class="cx"> {
</span><span class="cx">     // QTKit will return non-video MIME types which it claims to support, but which we
</span><span class="cx">     // do not support in the &lt;video&gt; element. Disclaim all non video/ or audio/ types.
</span><del>-    return !type.startsWith(&quot;video/&quot;) &amp;&amp; !type.startsWith(&quot;audio/&quot;);
</del><ins>+    return !type.startsWith(&quot;video/&quot;, false) &amp;&amp; !type.startsWith(&quot;audio/&quot;, false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void addFileTypesToCache(NSArray * fileTypes, HashSet&lt;String&gt; &amp;cache)
</del><ins>+static void addFileTypesToCache(NSArray *fileTypes, HashSet&lt;String, ASCIICaseInsensitiveHash&gt; &amp;cache)
</ins><span class="cx"> {
</span><del>-    int count = [fileTypes count];
-    for (int n = 0; n &lt; count; n++) {
-        CFStringRef ext = reinterpret_cast&lt;CFStringRef&gt;([fileTypes objectAtIndex:n]);
</del><ins>+    for (NSString *fileType : fileTypes) {
+        CFStringRef ext = reinterpret_cast&lt;CFStringRef&gt;(fileType);
</ins><span class="cx">         RetainPtr&lt;CFStringRef&gt; uti = adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, ext, NULL));
</span><span class="cx">         if (!uti)
</span><span class="cx">             continue;
</span><span class="lines">@@ -1254,25 +1253,18 @@
</span><span class="cx">         if (CFStringGetCharacterAtIndex(ext, 0) != '\'') {
</span><span class="cx">             // UTI is missing many media related MIME types supported by QTKit (see rdar://6434168), and not all
</span><span class="cx">             // web servers use the MIME type UTI returns for an extension (see rdar://7875393), so even if UTI 
</span><del>-            // has a type for this extension add any types in hard coded table in the MIME type regsitry.
-            Vector&lt;String&gt; typesForExtension = MIMETypeRegistry::getMediaMIMETypesForExtension(ext);
-            unsigned count = typesForExtension.size();
-            for (unsigned ndx = 0; ndx &lt; count; ++ndx) {
-                String type = typesForExtension[ndx].lower();
-
-                if (shouldRejectMIMEType(type))
-                    continue;
-
-                if (!cache.contains(type))
</del><ins>+            // has a type for this extension add any types in hard coded table in the MIME type registry.
+            for (auto&amp; type : MIMETypeRegistry::getMediaMIMETypesForExtension(ext)) {
+                if (!shouldRejectMIMEType(type))
</ins><span class="cx">                     cache.add(type);
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }    
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static HashSet&lt;String&gt; mimeCommonTypesCache()
</del><ins>+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt; mimeCommonTypesCache()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache;
</ins><span class="cx">     static bool typeListInitialized = false;
</span><span class="cx"> 
</span><span class="cx">     if (!typeListInitialized) {
</span><span class="lines">@@ -1284,9 +1276,9 @@
</span><span class="cx">     return cache;
</span><span class="cx"> } 
</span><span class="cx"> 
</span><del>-static HashSet&lt;String&gt; mimeModernTypesCache()
</del><ins>+static HashSet&lt;String, ASCIICaseInsensitiveHash&gt; mimeModernTypesCache()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache;
</ins><span class="cx">     static bool typeListInitialized = false;
</span><span class="cx">     
</span><span class="cx">     if (!typeListInitialized) {
</span><span class="lines">@@ -1298,15 +1290,13 @@
</span><span class="cx">     return cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void concatenateHashSets(HashSet&lt;String&gt;&amp; destination, const HashSet&lt;String&gt;&amp; source)
</del><ins>+static void concatenateHashSets(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; destination, const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; source)
</ins><span class="cx"> {
</span><del>-    HashSet&lt;String&gt;::const_iterator it = source.begin();
-    HashSet&lt;String&gt;::const_iterator end = source.end();
-    for (; it != end; ++it)
-        destination.add(*it);
</del><ins>+    for (auto&amp; type : source)
+        destination.add(type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateQTKit::getSupportedTypes(HashSet&lt;String&gt;&amp; supportedTypes)
</del><ins>+void MediaPlayerPrivateQTKit::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; supportedTypes)
</ins><span class="cx"> {
</span><span class="cx">     concatenateHashSets(supportedTypes, mimeModernTypesCache());
</span><span class="cx"> 
</span><span class="lines">@@ -1378,22 +1368,26 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    static HashSet&lt;String&gt;* allowedTrackTypes = 0;
-    if (!allowedTrackTypes) {
-        allowedTrackTypes = new HashSet&lt;String&gt;;
-        allowedTrackTypes-&gt;add(QTMediaTypeVideo);
-        allowedTrackTypes-&gt;add(QTMediaTypeSound);
-        allowedTrackTypes-&gt;add(QTMediaTypeText);
-        allowedTrackTypes-&gt;add(QTMediaTypeBase);
-        allowedTrackTypes-&gt;add(QTMediaTypeMPEG);
-        allowedTrackTypes-&gt;add(&quot;clcp&quot;); // Closed caption
-        allowedTrackTypes-&gt;add(&quot;sbtl&quot;); // Subtitle
-        allowedTrackTypes-&gt;add(&quot;odsm&quot;); // MPEG-4 object descriptor stream
-        allowedTrackTypes-&gt;add(&quot;sdsm&quot;); // MPEG-4 scene description stream
-        allowedTrackTypes-&gt;add(&quot;tmcd&quot;); // timecode
-        allowedTrackTypes-&gt;add(&quot;tc64&quot;); // timcode-64
-        allowedTrackTypes-&gt;add(&quot;tmet&quot;); // timed metadata
-    }
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; allowedTrackTypes = []() {
+        NSString *types[] = {
+            QTMediaTypeVideo,
+            QTMediaTypeSound,
+            QTMediaTypeText,
+            QTMediaTypeBase,
+            QTMediaTypeMPEG,
+            @&quot;clcp&quot;, // Closed caption
+            @&quot;sbtl&quot;, // Subtitle
+            @&quot;odsm&quot;, // MPEG-4 object descriptor stream
+            @&quot;sdsm&quot;, // MPEG-4 scene description stream
+            @&quot;tmcd&quot;, // timecode
+            @&quot;tc64&quot;, // timcode-64
+            @&quot;tmet&quot;, // timed metadata
+        };
+        HashSet&lt;String&gt; set;
+        for (auto&amp; type : types)
+            set.add(type);
+        return set;
+    }();
</ins><span class="cx">     
</span><span class="cx">     NSArray *tracks = [m_qtMovie.get() tracks];
</span><span class="cx">     
</span><span class="lines">@@ -1419,7 +1413,7 @@
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         // Test whether the media type is in our white list.
</span><del>-        if (!allowedTrackTypes-&gt;contains(mediaType)) {
</del><ins>+        if (!allowedTrackTypes.get().contains(mediaType)) {
</ins><span class="cx">             // If this track type is not allowed, then we need to disable it.
</span><span class="cx">             [track setEnabled:NO];
</span><span class="cx">             --m_enabledTrackCount;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateMediaFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -120,9 +120,9 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const HashSet&lt;String&gt;&amp; mimeTypeCache()
</del><ins>+static const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; mimeTypeCache()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cachedTypes;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cachedTypes;
</ins><span class="cx"> 
</span><span class="cx">     if (cachedTypes.get().size() &gt; 0)
</span><span class="cx">         return cachedTypes;
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">     return cachedTypes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MediaPlayerPrivateMediaFoundation::getSupportedTypes(HashSet&lt;String&gt;&amp; types)
</del><ins>+void MediaPlayerPrivateMediaFoundation::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types)
</ins><span class="cx"> {
</span><span class="cx">     types = mimeTypeCache();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinMediaPlayerPrivateMediaFoundationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     ~MediaPlayerPrivateMediaFoundation();
</span><span class="cx">     static void registerMediaEngine(MediaEngineRegistrar);
</span><span class="cx"> 
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx">     static bool isAvailable();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -45,9 +45,9 @@
</span><span class="cx">         supportsType, 0, 0, 0, 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static const HashSet&lt;String&gt;&amp; mimeTypeCache()
</del><ins>+static const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; mimeTypeCache()
</ins><span class="cx"> {
</span><del>-    static NeverDestroyed&lt;HashSet&lt;String&gt;&gt; cache;
</del><ins>+    static NeverDestroyed&lt;HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&gt; cache;
</ins><span class="cx">     static bool isInitialized = false;
</span><span class="cx"> 
</span><span class="cx">     if (!isInitialized) {
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     return cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MockMediaPlayerMediaSource::getSupportedTypes(HashSet&lt;String&gt;&amp; supportedTypes)
</del><ins>+void MockMediaPlayerMediaSource::getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; supportedTypes)
</ins><span class="cx"> {
</span><span class="cx">     supportedTypes = mimeTypeCache();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmockmediasourceMockMediaPlayerMediaSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> 
</span><span class="cx">     // MediaPlayer Engine Support
</span><span class="cx">     WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar);
</span><del>-    static void getSupportedTypes(HashSet&lt;String&gt;&amp; types);
</del><ins>+    static void getSupportedTypes(HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; types);
</ins><span class="cx">     static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual ~MockMediaPlayerMediaSource();
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-01-31  Darin Adler  &lt;darin@apple.com&gt;
+
+        Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
+        https://bugs.webkit.org/show_bug.cgi?id=153732
+
+        Reviewed by Dean Jackson.
+
+        * WebView/WebHTMLRepresentation.mm:
+        (newArrayWithStrings): Updated to use HashSet&lt;String, ASCIICaseInsensitiveHash&gt;
+        and also to use a modern for loop.
+
</ins><span class="cx"> 2016-01-31  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Remove __has_include guards around use of WebKitAdditions
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLRepresentationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm (195950 => 195951)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm        2016-02-01 04:44:07 UTC (rev 195950)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm        2016-02-01 05:46:20 UTC (rev 195951)
</span><span class="lines">@@ -87,13 +87,12 @@
</span><span class="cx"> 
</span><span class="cx"> @implementation WebHTMLRepresentation
</span><span class="cx"> 
</span><del>-static NSMutableArray *newArrayWithStrings(const HashSet&lt;String&gt;&amp; set) NS_RETURNS_RETAINED;
-static NSMutableArray *newArrayWithStrings(const HashSet&lt;String&gt;&amp; set)
</del><ins>+static NSMutableArray *newArrayWithStrings(const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp;) NS_RETURNS_RETAINED;
+static NSMutableArray *newArrayWithStrings(const HashSet&lt;String, ASCIICaseInsensitiveHash&gt;&amp; set)
</ins><span class="cx"> {
</span><span class="cx">     NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:set.size()];
</span><del>-    HashSet&lt;String&gt;::const_iterator end = set.end();
-    for (HashSet&lt;String&gt;::const_iterator it = set.begin(); it != end; ++it)
-        [array addObject:(NSString *)(*it)];
</del><ins>+    for (auto&amp; string : set)
+        [array addObject:(NSString *)string];
</ins><span class="cx">     return array;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>