Bug 117818 - [Mac] Downloaded file name encoding is incorrect when download link opens in a new window
Summary: [Mac] Downloaded file name encoding is incorrect when download link opens in ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-06-19 21:23 PDT by Alexey Proskuryakov
Modified: 2013-06-20 13:06 PDT (History)
2 users (show)

See Also:


Attachments
proposed fix (2.47 KB, patch)
2013-06-19 22:08 PDT, Alexey Proskuryakov
beidson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2013-06-19 21:23:48 PDT
We set up downloaded file name encoding via FrameLoader::addExtraFieldsToRequest(), and one of the options is referring document's encoding.

But FrameLoader::addExtraFieldsToRequest() is called at poorly defined times, one of which is after policy delegate. If the download link is target="_blank", then this happens after a new tab opens, and we overwrite a perfectly good fallback encoding array with one from a blank document.

<rdar://problem/14212635>
Comment 1 Alexey Proskuryakov 2013-06-19 22:08:01 PDT
Created attachment 205056 [details]
proposed fix
Comment 2 Brady Eidson 2013-06-20 12:42:37 PDT
Comment on attachment 205056 [details]
proposed fix

This code is gross.

This fix is good for this bug, though.
Comment 3 Alexey Proskuryakov 2013-06-20 13:06:36 PDT
Committed <http://trac.webkit.org/r151793>.