Changeset 213062 in webkit


Ignore:
Timestamp:
Feb 27, 2017 6:48:43 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Downloads attributes tests are failing
https://bugs.webkit.org/show_bug.cgi?id=168871

Reviewed by Michael Catanzaro.

Source/WebCore:

Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
filenameFromHTTPContentDisposition().

Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html

fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html

  • platform/network/soup/ResourceResponseSoup.cpp:

(WebCore::ResourceResponse::platformSuggestedFilename):

LayoutTests:

Remove passing tests and add new baseline for
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html because libsoup handles slashes
differently but download succeeds.

  • platform/gtk/TestExpectations:
  • platform/gtk/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes-expected.txt: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r213055 r213062  
     12017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Downloads attributes tests are failing
     4        https://bugs.webkit.org/show_bug.cgi?id=168871
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Remove passing tests and add new baseline for
     9        fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html because libsoup handles slashes
     10        differently but download succeeds.
     11
     12        * platform/gtk/TestExpectations:
     13        * platform/gtk/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes-expected.txt: Added.
     14
    1152017-02-27  Antoine Quint  <graouts@apple.com>
    216
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r213006 r213062  
    29152915webkit.org/b/168719 fast/css/paint-order-shadow.html [ ImageOnlyFailure ]
    29162916
    2917 webkit.org/b/168871 fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html [ Failure ]
    2918 webkit.org/b/168871 fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html [ Failure ]
    2919 webkit.org/b/168871 fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html [ Timeout ]
    2920 
    29212917#////////////////////////////////////////////////////////////////////////////////////////
    29222918# End of non-crashing, non-flaky tests failing
  • trunk/Source/WebCore/ChangeLog

    r213055 r213062  
     12017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Downloads attributes tests are failing
     4        https://bugs.webkit.org/show_bug.cgi?id=168871
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
     9        filenameFromHTTPContentDisposition().
     10
     11        Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
     12               fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
     13
     14        * platform/network/soup/ResourceResponseSoup.cpp:
     15        (WebCore::ResourceResponse::platformSuggestedFilename):
     16
    1172017-02-27  Antoine Quint  <graouts@apple.com>
    218
  • trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp

    r206740 r213062  
    9797String ResourceResponse::platformSuggestedFilename() const
    9898{
     99    SoupMessageHeaders* soupHeaders = soup_message_headers_new(SOUP_MESSAGE_HEADERS_RESPONSE);
    99100    String contentDisposition(httpHeaderField(HTTPHeaderName::ContentDisposition));
    100     return filenameFromHTTPContentDisposition(String::fromUTF8WithLatin1Fallback(contentDisposition.characters8(), contentDisposition.length()));
     101    soup_message_headers_append(soupHeaders, "Content-Disposition", contentDisposition.utf8().data());
     102    GRefPtr<GHashTable> params;
     103    soup_message_headers_get_content_disposition(soupHeaders, nullptr, &params.outPtr());
     104    soup_message_headers_free(soupHeaders);
     105    char* filename = params ? static_cast<char*>(g_hash_table_lookup(params.get(), "filename")) : nullptr;
     106    return filename ? String::fromUTF8(filename) : String();
    101107}
    102108
Note: See TracChangeset for help on using the changeset viewer.