Bug 18372

Summary: data: urls are escaped
Product: WebKit Reporter: Eric Roman <eroman>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: annevk, ap, mitz
Priority: P2    
Version: 525.x (Safari 3.1)   
Hardware: PC   
OS: OS X 10.5   

Eric Roman
Reported 2008-04-08 18:31:28 PDT
data:urls are canonicalized in webcore by url-escaping their contents. neither Firefox nor Opera do this (which makes this a compatibility issue) i would argue that webcore should not url-escape either. it is also probably better on performance and memory consumption (especially for large data:urls) not to do this escaping business, since really the intent is to use it as data anyway. Here is a small example to repro the problem: <html> <a href="data:text/html,<p>test</p>" onclick="alert(this.href); return false">Click Me</a> </html> This opens an alert, which outputs differently in each browser: [Safari] data:text/html,%3Cp%3Etest%3C/p%3E [Firefox] data:text/html,<p>test</p> [Opera] data:text/html,<p>test</p> [IE8*] data:text/html,<p>test</p> *even so, IE8 doesn't actually support data:urls
Attachments
Eric Seidel (no email)
Comment 1 2008-04-08 19:02:08 PDT
Unless I'm missing something, it looks like the example you gave looks the same in all browsers *except* Safari.
Eric Roman
Comment 2 2008-04-08 23:01:22 PDT
Yes that is right, Safari is the only one that is url-escaping it.
Anne van Kesteren
Comment 3 2023-08-23 00:40:54 PDT
This was fixed by the URL rewrite presumably. Comment 0 no longer reproduces.
Note You need to log in before you can comment on or make changes to this bug.