Changeset 83191 in webkit


Ignore:
Timestamp:
Apr 7, 2011 11:46:23 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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 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):
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83189 r83191  
     12011-04-07  Nancy Piedra  <nancy.piedra@nokia.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        Add tests for parsing codecs parameter in video-can-play-type.html
     6        https://bugs.webkit.org/show_bug.cgi?id=53275
     7
     8        * media/video-can-play-type-expected.txt:
     9        * media/video-can-play-type.html:
     10
    1112011-04-07  Jessie Berlin  <jberlin@apple.com>
    212
  • trunk/LayoutTests/media/video-can-play-type-expected.txt

    r66023 r83191  
    88EXPECTED (video.canPlayType('audio/mpeg') == 'maybe') OK
    99EXPECTED (video.canPlayType('audio/Wav') == 'maybe') OK
     10EXPECTED (video.canPlayType('video/blahblah; codecs=blah') == '') OK
     11EXPECTED (video.canPlayType('video/blahblah; codecs="blah"') == '') OK
     12EXPECTED (video.canPlayType('video/blahblah; codecs="badcontent') == '') OK
     13EXPECTED (video.canPlayType('video/blahblah; codecs=badcontent"') == '') OK
     14EXPECTED (video.canPlayType('video/blahblah; codecs="badcontent"') == '') OK
    1015END OF TEST
    1116
  • trunk/LayoutTests/media/video-can-play-type.html

    r82909 r83191  
    2323            testExpected("video.canPlayType('audio/mpeg')", "maybe");
    2424            testExpected("video.canPlayType('audio/Wav')", "maybe");
     25            testExpected("video.canPlayType('video/blahblah; codecs=blah')", "");
     26            testExpected("video.canPlayType('video/blahblah; codecs=\"blah\"')", "");
     27            testExpected("video.canPlayType('video/blahblah; codecs=\"badcontent')", "");
     28            testExpected("video.canPlayType('video/blahblah; codecs=badcontent\"')", "");
     29            testExpected("video.canPlayType('video/blahblah; codecs=&quot;badcontent&quot;')", "");
    2530
    2631            endTest();
  • trunk/Source/WebCore/ChangeLog

    r83190 r83191  
     12011-04-07  Nancy Piedra  <nancy.piedra@nokia.com>
     2
     3        Reviewed by Eric Carlson.
     4
     5        Parse quotes from content type parameters
     6        https://bugs.webkit.org/show_bug.cgi?id=53275
     7
     8        This functionality is tested in video-can-play-type.html layout test
     9        where I've added codecs parameter with good and bad formatting.
     10
     11        * platform/ContentType.cpp:
     12        (WebCore::ContentType::parameter):
     13
    1142011-04-07  Pavel Feldman  <pfeldman@google.com>
    215
  • trunk/Source/WebCore/platform/ContentType.cpp

    r65468 r83191  
    4646        size_t start = strippedType.find(parameterName, semi + 1, false);
    4747        if (start != notFound) {
    48             start = strippedType.find('=', start + 6);
     48            start = strippedType.find('=', start + parameterName.length());
    4949            if (start != notFound) {
    50                 size_t end = strippedType.find(';', start + 6);
    51                 if (end == notFound)
    52                     end = strippedType.length();
     50                size_t quote = strippedType.find('\"', start + 1);
     51                size_t end = strippedType.find('\"', start + 2);
     52                if (quote != notFound && end != notFound)
     53                    start = quote;
     54                else {
     55                    end = strippedType.find(';', start + 1);
     56                    if (end == notFound)
     57                        end = strippedType.length();
     58                }
    5359                parameterValue = strippedType.substring(start + 1, end - (start + 1)).stripWhiteSpace();
    5460            }
Note: See TracChangeset for help on using the changeset viewer.