Better type handling in HTMLImageElement resource selection

According to the spec there were several bugs in the handling of the "type" attribute on <source> elements as part of HTMLImageElement's resource selection.
Specifically, MIME type parameters weren't properly ignored and whitespace wasn't properly trimmed.

This CL fixes that.

BUG=418914

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

git-svn-id: svn://svn.chromium.org/blink/trunk@183450 bbb929c8-8fbe-4397-9dbb-9b2b20218538