Changeset 151793 in webkit


Ignore:
Timestamp:
Jun 20, 2013 1:06:02 PM (11 years ago)
Author:
ap@apple.com
Message:

[Mac] Downloaded file name encoding is incorrect when download link opens in a new window
https://bugs.webkit.org/show_bug.cgi?id=117818
<rdar://problem/14212635>

Reviewed by Brady Eidson.

No tests added. The machinery we have for logging downloaded file name is very
far from being able to work in a secondary window.

  • loader/FrameLoader.cpp: (WebCore::FrameLoader::addExtraFieldsToRequest): Made a targeted fix - don't update encoding fallback array if we already have one, there is no chance for it to be more correct. In this case, it's incorrect because it comes from a new blank window, instead of original referer. We have a lot of code in addExtraFieldsToRequest() to struggle with this, and we have a FIXME to try not calling it from policy delegate.
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r151788 r151793  
     12013-06-20  Alexey Proskuryakov  <ap@apple.com>
     2
     3        [Mac] Downloaded file name encoding is incorrect when download link opens in a new window
     4        https://bugs.webkit.org/show_bug.cgi?id=117818
     5        <rdar://problem/14212635>
     6
     7        Reviewed by Brady Eidson.
     8
     9        No tests added. The machinery we have for logging downloaded file name is very
     10        far from being able to work in a secondary window.
     11
     12        * loader/FrameLoader.cpp: (WebCore::FrameLoader::addExtraFieldsToRequest):
     13        Made a targeted fix - don't update encoding fallback array if we already have one,
     14        there is no chance for it to be more correct. In this case, it's incorrect because
     15        it comes from a new blank window, instead of original referer.
     16        We have a lot of code in addExtraFieldsToRequest() to struggle with this, and we have
     17        a FIXME to try not calling it from policy delegate.
     18
    1192013-06-18  Robert Hogan  <robert@webkit.org>
    220
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r151193 r151793  
    25012501    addHTTPOriginIfNeeded(request, String());
    25022502
    2503     // Always try UTF-8. If that fails, try frame encoding (if any) and then the default.
    2504     Settings* settings = m_frame->settings();
    2505     request.setResponseContentDispositionEncodingFallbackArray("UTF-8", m_frame->document()->encoding(), settings ? settings->defaultTextEncodingName() : String());
     2503    // Only set fallback array if it's still empty (later attempts may be incorrect, see bug 117818).
     2504    if (request.responseContentDispositionEncodingFallbackArray().isEmpty()) {
     2505        // Always try UTF-8. If that fails, try frame encoding (if any) and then the default.
     2506        Settings* settings = m_frame->settings();
     2507        request.setResponseContentDispositionEncodingFallbackArray("UTF-8", m_frame->document()->encoding(), settings ? settings->defaultTextEncodingName() : String());
     2508    }
    25062509}
    25072510
Note: See TracChangeset for help on using the changeset viewer.