NEW 12755
WebFrame should have a method - (NSData *)data to return an NSData representation of a document
https://bugs.webkit.org/show_bug.cgi?id=12755
Summary WebFrame should have a method - (NSData *)data to return an NSData representa...
Robert Burns
Reported 2007-02-12 22:17:44 PST
This would balance the method -(void)loadData which loads a file from data. Currently, this requires getting a string from the documentElement and converting it to data. This loses the DTD and XML declarations if present. Consequently mthods to roundtrip load data and save data are not there.
Attachments
Alexey Proskuryakov
Comment 1 2007-02-13 03:21:17 PST
It is correct that document.documentElement serialization does not include the DTD or XML declaration, but I believe that serialization of the document itself should include those, and I think it's a WebKit bug that it doesn't. Try javascript:alert((new XMLSerializer).serializeToString(document)) in Safari and in Firefox to compare the results.
Robert Burns
Comment 2 2007-02-13 22:48:35 PST
reported to http://bugreport.apple.com/ as 4995330
Robert Burns
Comment 3 2007-02-13 23:27:29 PST
> It is correct that document.documentElement serialization does not include the > DTD or XML declaration, but I believe that serialization of the document itself > should include those, and I think it's a WebKit bug that it doesn't. Just to clarify, this bug is referring to the WebFrame class that has a corresponding element to loadData, but not one to unload data that has been edited. A related bug that should probably be reported separately is that there is no method to serialize the document that preserves the original DocType and XML preambles ( if any).
Note You need to log in before you can comment on or make changes to this bug.