Bug 19193

Summary: data:// URLs should not inherit charset from parent frame
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, annevk
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   

Description Alexey Proskuryakov 2008-05-22 09:43:26 PDT
In Firefox, data:// URLs do not inherit charset from parent frame. This is important because of cases such as <iframe src="data:image/svg+xml,..."> - the URL should be decoded as UTF-8 for correct round-tripping.

On Leopard, this is currently masked by <rdar://problem/5845875> -[NSURLResponse textEncoding] incorrectly reports us-ascii encoding for data: URLs. Yet, we can fix this for other operating systems.
Comment 1 Ahmad Saleem 2023-09-16 15:19:38 PDT
@Anne & @Alexey - Is this still applicable?
Comment 2 Alexey Proskuryakov 2023-09-18 08:07:35 PDT
FWIW, <rdar://problem/5845875> was fixed a long time ago. Other than that, I do not remember much about this, would need to investigate.
Comment 3 Anne van Kesteren 2023-09-18 09:04:32 PDT
I cannot reproduce inheritance with this test case:

data:text/html;charset=utf-8,%FF?%FF%3Ciframe%20src=%22data:text/html,%25FF?%25FF%22%3E

In particular the inner document shows ÿs as expected (and the outer �s).

Similar result here with a non-data: URL as top-level document:

http://software.hixie.ch/utilities/js/live-dom-viewer/saved/12013

I'd be inclined to close this as CONFIGURATION CHANGED based on that.