Simplify and streamline code that creates an appropriate document based on MIME type
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 18:10:48 +0000 (18:10 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Jan 2019 18:10:48 +0000 (18:10 +0000)
commit19d7d3c237e916b1b935991c107a13c719b713fb
tree316d88227baa069833b7df5da762e75e2bfe428e
parent86842f78fe3f7fbb30651d8de32cd464478bb653
Simplify and streamline code that creates an appropriate document based on MIME type
https://bugs.webkit.org/show_bug.cgi?id=193756

Reviewed by Chris Dumez.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Use equalLettersIgnoringASCIICase rather
than == for all the MIME type checks. Use MIMETypeRegistry::isSupportedImageMIMEType
instead of Image::supportsType. Rearranged checks so that all the combinations that
that take precedence over plug-ins are checked first, fixing some unimportant edge
cases where the plug-in database is initialized and doesn't need to be. Straightened
out the logic for various special types so that the checks are more independent from
each other and hence easier to understand.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/DOMImplementation.cpp