Don't use SVG resource documents with an unrecognized MIME-type

Before parsing/creating the actual document of a DocumentResource, make
sure that the resource in question was actually served as a reasonable
MIME-type - one of:

  image/svg+xml,
  text/xml,
  application/xml or
  application/xhtml+xml

Use the original Content-Type from the HTTP header when possible and
treat empty as invalid (matches Gecko).
This could help mitigate some issues with content sanitation. It seems
to match what Gecko is doing so is hopefully not too web-incompatible.

Move the commonly recurring *Resource::mimeType() helper from subclasses
to the baseclass (Resource) and rename it httpContentType() since that
should be a better match for what it is.

BUG=527514

Review URL: https://codereview.chromium.org/1706243002

Cr-Commit-Position: refs/heads/master@{#377560}
16 files changed