Reviewed by Eric Carlson.
Add tests for parsing codecs parameter in video-can-play-type.html
https://bugs.webkit.org/show_bug.cgi?id=53275
* media/video-can-play-type-expected.txt:
* media/video-can-play-type.html:
2011-04-07 Nancy Piedra <nancy.piedra@nokia.com>
Reviewed by Eric Carlson.
Parse quotes from content type parameters
https://bugs.webkit.org/show_bug.cgi?id=53275
This functionality is tested in video-can-play-type.html layout test
where I've added codecs parameter with good and bad formatting.
* platform/ContentType.cpp:
(WebCore::ContentType::parameter):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83191
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-04-07 Nancy Piedra <nancy.piedra@nokia.com>
+
+ Reviewed by Eric Carlson.
+
+ Add tests for parsing codecs parameter in video-can-play-type.html
+ https://bugs.webkit.org/show_bug.cgi?id=53275
+
+ * media/video-can-play-type-expected.txt:
+ * media/video-can-play-type.html:
+
2011-04-07 Jessie Berlin <jberlin@apple.com>
[WebKit2 Tests] fast/events/select-element.html failing since introduction in r83096
2011-04-07 Jessie Berlin <jberlin@apple.com>
[WebKit2 Tests] fast/events/select-element.html failing since introduction in r83096
EXPECTED (video.canPlayType(' Video/MP4 ; CODECS="mp4v.20.8, mp4a.40.2"') == 'probably') OK
EXPECTED (video.canPlayType('audio/mpeg') == 'maybe') OK
EXPECTED (video.canPlayType('audio/Wav') == 'maybe') OK
EXPECTED (video.canPlayType(' Video/MP4 ; CODECS="mp4v.20.8, mp4a.40.2"') == 'probably') OK
EXPECTED (video.canPlayType('audio/mpeg') == 'maybe') OK
EXPECTED (video.canPlayType('audio/Wav') == 'maybe') OK
+EXPECTED (video.canPlayType('video/blahblah; codecs=blah') == '') OK
+EXPECTED (video.canPlayType('video/blahblah; codecs="blah"') == '') OK
+EXPECTED (video.canPlayType('video/blahblah; codecs="badcontent') == '') OK
+EXPECTED (video.canPlayType('video/blahblah; codecs=badcontent"') == '') OK
+EXPECTED (video.canPlayType('video/blahblah; codecs="badcontent"') == '') OK
testExpected("video.canPlayType(' Video/MP4 ; CODECS=\"mp4v.20.8, mp4a.40.2\"')", "probably");
testExpected("video.canPlayType('audio/mpeg')", "maybe");
testExpected("video.canPlayType('audio/Wav')", "maybe");
testExpected("video.canPlayType(' Video/MP4 ; CODECS=\"mp4v.20.8, mp4a.40.2\"')", "probably");
testExpected("video.canPlayType('audio/mpeg')", "maybe");
testExpected("video.canPlayType('audio/Wav')", "maybe");
+ testExpected("video.canPlayType('video/blahblah; codecs=blah')", "");
+ testExpected("video.canPlayType('video/blahblah; codecs=\"blah\"')", "");
+ testExpected("video.canPlayType('video/blahblah; codecs=\"badcontent')", "");
+ testExpected("video.canPlayType('video/blahblah; codecs=badcontent\"')", "");
+ testExpected("video.canPlayType('video/blahblah; codecs="badcontent"')", "");
+2011-04-07 Nancy Piedra <nancy.piedra@nokia.com>
+
+ Reviewed by Eric Carlson.
+
+ Parse quotes from content type parameters
+ https://bugs.webkit.org/show_bug.cgi?id=53275
+
+ This functionality is tested in video-can-play-type.html layout test
+ where I've added codecs parameter with good and bad formatting.
+
+ * platform/ContentType.cpp:
+ (WebCore::ContentType::parameter):
+
2011-04-07 Pavel Feldman <pfeldman@google.com>
Reviewed by Yury Semikhatsky.
2011-04-07 Pavel Feldman <pfeldman@google.com>
Reviewed by Yury Semikhatsky.
if (semi != notFound) {
size_t start = strippedType.find(parameterName, semi + 1, false);
if (start != notFound) {
if (semi != notFound) {
size_t start = strippedType.find(parameterName, semi + 1, false);
if (start != notFound) {
- start = strippedType.find('=', start + 6);
+ start = strippedType.find('=', start + parameterName.length());
- size_t end = strippedType.find(';', start + 6);
- if (end == notFound)
- end = strippedType.length();
+ size_t quote = strippedType.find('\"', start + 1);
+ size_t end = strippedType.find('\"', start + 2);
+ if (quote != notFound && end != notFound)
+ start = quote;
+ else {
+ end = strippedType.find(';', start + 1);
+ if (end == notFound)
+ end = strippedType.length();
+ }
parameterValue = strippedType.substring(start + 1, end - (start + 1)).stripWhiteSpace();
}
}
parameterValue = strippedType.substring(start + 1, end - (start + 1)).stripWhiteSpace();
}
}