In fixing issue 605661 for EME (require codecs attribute for media MIME types), I've discovered that ParsedContentType does not treat attribute names as case-insensitive. Calling parameterValueForName("codecs") on: 'video/webm; codecs="vp8"' returns "vp8" 'video/webm; Codecs="vp8"' returns "" 'video/webm; CODECS="vp8"' returns "" This is found in one of the EME layout tests [1]. Currently the tests pass as Chrome allows container only MIME types. The documentation in the code for ParsedContentType [2] states: // parameter := attribute "=" value // // attribute := token // ; Matching of attributes // ; is ALWAYS case-insensitive. Other media code uses ContentType, which is case-insensitive for attribute names. The code should be fixed so that the comment and the code do the same thing. [1] https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-requestmediakeysystemaccess.html?l=272 [2] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/network/ParsedContentType.cpp?l=114
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d133322623bc4dca3cfcf69e1e83d979cf2dfd9c commit d133322623bc4dca3cfcf69e1e83d979cf2dfd9c Author: yhirano <yhirano@chromium.org> Date: Tue Feb 21 04:03:22 2017 Add unittests to ParsedContentType This CL doesn't include a behavioral change. BUG= 689731 Review-Url: https://codereview.chromium.org/2704143002 Cr-Commit-Position: refs/heads/master@{#451697} [modify] https://crrev.com/d133322623bc4dca3cfcf69e1e83d979cf2dfd9c/third_party/WebKit/Source/platform/BUILD.gn [add] https://crrev.com/d133322623bc4dca3cfcf69e1e83d979cf2dfd9c/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d4c7568248450ac03286a4af6fe46380b582ed68 commit d4c7568248450ac03286a4af6fe46380b582ed68 Author: yhirano <yhirano@chromium.org> Date: Wed Feb 22 14:51:18 2017 ParsedContentType refactoring This is a preliminary refactoring for fixing compatibility issues of ParsedContentType. BUG= 689731 Review-Url: https://codereview.chromium.org/2704153002 Cr-Commit-Position: refs/heads/master@{#452045} [modify] https://crrev.com/d4c7568248450ac03286a4af6fe46380b582ed68/third_party/WebKit/Source/core/loader/PingLoader.cpp [modify] https://crrev.com/d4c7568248450ac03286a4af6fe46380b582ed68/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp [modify] https://crrev.com/d4c7568248450ac03286a4af6fe46380b582ed68/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp [modify] https://crrev.com/d4c7568248450ac03286a4af6fe46380b582ed68/third_party/WebKit/Source/platform/network/ParsedContentType.cpp [modify] https://crrev.com/d4c7568248450ac03286a4af6fe46380b582ed68/third_party/WebKit/Source/platform/network/ParsedContentType.h [modify] https://crrev.com/d4c7568248450ac03286a4af6fe46380b582ed68/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/53a17807c9046399134294373031a0633e75e3d6 commit 53a17807c9046399134294373031a0633e75e3d6 Author: yhirano <yhirano@chromium.org> Date: Wed Feb 22 14:57:13 2017 Make ParsedContentType more conformant to the spec This CL fixes token and quoted-string handling. MHTML needs "relaxed" parsing, so this CL adds a mode for the usage. BUG= 689731 Review-Url: https://codereview.chromium.org/2708523003 Cr-Commit-Position: refs/heads/master@{#452047} [modify] https://crrev.com/53a17807c9046399134294373031a0633e75e3d6/third_party/WebKit/Source/platform/mhtml/MHTMLParser.cpp [modify] https://crrev.com/53a17807c9046399134294373031a0633e75e3d6/third_party/WebKit/Source/platform/network/ParsedContentType.cpp [modify] https://crrev.com/53a17807c9046399134294373031a0633e75e3d6/third_party/WebKit/Source/platform/network/ParsedContentType.h [modify] https://crrev.com/53a17807c9046399134294373031a0633e75e3d6/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/55d2881ba47ca3ba4eb6fe93f08ad98613777c5f commit 55d2881ba47ca3ba4eb6fe93f08ad98613777c5f Author: yhirano <yhirano@chromium.org> Date: Thu Feb 23 05:15:40 2017 ParsedContentType parameter name matching should be case insensitive As specified in RFC (and as written in the comment), MIME parameter attribute matching should be always case-insensitive. BUG= 689731 Review-Url: https://codereview.chromium.org/2708043002 Cr-Commit-Position: refs/heads/master@{#452403} [modify] https://crrev.com/55d2881ba47ca3ba4eb6fe93f08ad98613777c5f/third_party/WebKit/Source/platform/network/ParsedContentType.cpp [modify] https://crrev.com/55d2881ba47ca3ba4eb6fe93f08ad98613777c5f/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp
Comment 1 by jrumm...@chromium.org
, Feb 14 2017