Changeset 269875 in webkit


Ignore:
Timestamp:
Nov 16, 2020 1:45:15 PM (3 years ago)
Author:
commit-queue@webkit.org
Message:

FileReaderLoader::convertToDataURL should use application/octet-stream if MIME type is empty
https://bugs.webkit.org/show_bug.cgi?id=218993

Patch by Alex Christensen <achristensen@webkit.org> on 2020-11-16
Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

  • web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt:

Source/WebCore:

This matches Chrome and Firefox, and is covered by a web platform test.

  • fileapi/FileReaderLoader.cpp:

(WebCore::FileReaderLoader::convertToDataURL):

LayoutTests:

  • fast/files/read-blob-async-expected.txt:
  • fast/files/workers/worker-read-blob-async-expected.txt:
  • fast/files/workers/worker-read-blob-sync-expected.txt:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r269872 r269875  
     12020-11-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        FileReaderLoader::convertToDataURL should use application/octet-stream if MIME type is empty
     4        https://bugs.webkit.org/show_bug.cgi?id=218993
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * fast/files/read-blob-async-expected.txt:
     9        * fast/files/workers/worker-read-blob-async-expected.txt:
     10        * fast/files/workers/worker-read-blob-sync-expected.txt:
     11
    1122020-11-13  Ryan Haddad  <ryanhaddad@apple.com>
    213
  • trunk/LayoutTests/fast/files/read-blob-async-expected.txt

    r267644 r269875  
    6565Received load event
    6666readyState: 2
    67 result size: 21
    68 result: data:;base64,Rmlyc3Q=
     67result size: 45
     68result: data:application/octet-stream;base64,Rmlyc3Q=
    6969Received loadend event
    7070Test reading a blob containing single text as data URL (optional content type provided)
  • trunk/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt

    r267644 r269875  
    6666Received load event
    6767readyState: 2
    68 result size: 21
    69 result: data:;base64,Rmlyc3Q=
     68result size: 45
     69result: data:application/octet-stream;base64,Rmlyc3Q=
    7070Received loadend event
    7171Test reading a blob containing single text as data URL (optional content type provided)
  • trunk/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt

    r267644 r269875  
    2828Received exception undefined: TypeError
    2929Test reading a blob containing single text as data URL
    30 result size: 21
    31 result: data:;base64,Rmlyc3Q=
     30result size: 45
     31result: data:application/octet-stream;base64,Rmlyc3Q=
    3232Received exception undefined: TypeError
    3333Test reading a blob containing single text as data URL (optional content type provided)
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r269866 r269875  
     12020-11-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        FileReaderLoader::convertToDataURL should use application/octet-stream if MIME type is empty
     4        https://bugs.webkit.org/show_bug.cgi?id=218993
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt:
     9
    1102020-11-16  Yusuke Suzuki  <ysuzuki@apple.com>
    211
  • trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_readAsDataURL-expected.txt

    r268054 r269875  
    22PASS FileReader readyState during readAsDataURL
    33PASS readAsDataURL result for Blob with specified MIME type
    4 FAIL readAsDataURL result for Blob with unspecified MIME type assert_equals: expected "data:application/octet-stream;base64,VEVTVA==" but got "data:;base64,VEVTVA=="
     4PASS readAsDataURL result for Blob with unspecified MIME type
    55
  • trunk/Source/WebCore/ChangeLog

    r269873 r269875  
     12020-11-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        FileReaderLoader::convertToDataURL should use application/octet-stream if MIME type is empty
     4        https://bugs.webkit.org/show_bug.cgi?id=218993
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        This matches Chrome and Firefox, and is covered by a web platform test.
     9
     10        * fileapi/FileReaderLoader.cpp:
     11        (WebCore::FileReaderLoader::convertToDataURL):
     12
    1132020-11-16  Megan Gardner  <megan_gardner@apple.com>
    214
  • trunk/Source/WebCore/fileapi/FileReaderLoader.cpp

    r268228 r269875  
    347347    }
    348348
    349     builder.append(m_dataType);
     349    if (m_dataType.isEmpty())
     350        builder.append("application/octet-stream");
     351    else
     352        builder.append(m_dataType);
    350353    builder.appendLiteral(";base64,");
    351354
Note: See TracChangeset for help on using the changeset viewer.