GNOME Bugzilla – Bug 581985
By default gtkhtml not support data URI
Last modified: 2014-12-02 01:07:40 UTC
By default gtkhtml not support data URI(http://en.wikipedia.org/wiki/Data_URI) as engine component. Support this need add in result application.
Created attachment 134307 [details] [review] add support data url in gtkhtml.c Add support data url to inner engine (gtkhtml.c). To test it can be used http://acid2.acidtests.org/ - must render red rectangle.
This is a good start, but appears to only handle a subset of RFC 2397. A few things I noticed after examining the syntax: dataurl := "data:" [ mediatype ] [ ";base64" ] "," data mediatype := [ type "/" subtype ] *( ";" parameter ) data := *urlchar parameter := attribute "=" value - The "mediatype" and ";base64" parts are optional, but the patch requires both of them to be present. The absence of "mediatype" implies "text/plain;charset=US-ASCII". - %xx hex decoding is only necessary if ";base64" is absent. The patch does it on base64-encoded data, which is incorrect. - The patch lacks any handling of parameters such as "charset". If the intent -is- to only support data URIs of the form "data:" type "/" subtype ";base64" "," data then that's fine for now, but there needs to be a comment stating so and mentioning the other forms that we do not (yet) support. This is for the benefit of future developers or contributors that may want to pick it up and finish it. In any case, I'd also like to see a comment near the string comparison for "data:" mentioning RFC 2397. This makes it easier for others to discover whether GtkHtml supports data URIs.
Thunk you. I work on full support, think on this week add new patch. >> %xx hex decoding is only necessary if ";base64" is absent. The patch does it on base64-encoded data, which is incorrect. if not unescape uri I receive original url with percent ( http://acid2.acidtests.org/: <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAFSDNYfAAAAaklEQVR42u3XQQrAIAwAQeP%2F%2F6wf8CJBJTK9lnQ7FpHGaOurt1I34nfH9pMMZAZ8BwMGEvvh%2BBsJCAgICLwIOA8EBAQEBAQEBAQEBK79H5RfIQAAAAAAAAAAAAAAAAAAAAAAAAAAAID%2FABMSqAfj%2FsLmvAAAAABJRU5ErkJggg%3D%3D" ...) and broken image.
Created attachment 134551 [details] Some test cases for data url
Created attachment 134552 [details] [review] Add support for data url (tested with inline image and text)
Created attachment 136332 [details] [review] Add support for data url Add fix for expanding url Add set href(base usrl) and mime type for html stream. Add support for data uri to all type query(html_engine_url_requested_cb, html_engine_redirect_cb, html_engine_submit_cb, link_cliked) Also add test for data uri
Created attachment 137725 [details] [review] Only update last patch
Thanks for the updated patch, Denis. I've committed the README changes, along with a few of my own. I've also removed the RPM spec file from our repo, since it was hopelessly out-of-date and I'm not interested in maintaining it. I'll need a little more time to review the rest of your patch. I noticed that it breaks libgtkhtml's ABI (sizeof GtkhtmlStream changed) so we'll have to defer it until 3.29 development begins and then bump the library's soname.
Matt, I would suggest that, see if there are any users of GtkHTML, who specially use the stream (Im not very sure). If GtkHTML changed, its fine for a bump. If there aren't any consumers for stream, avoid a so bump, and make Evo dependencies well to the correct version. An so bump is always a pain.
Debian rdepends shows the following -known- packages using GtkHtml (excluding Evolution): balsa bibledit libhildonhelp0 libtinymail-gnome-desktop-1.0-0 libtinymailui-gtkhtml-1.0-0 I'm not going to check them all, but feel free. I'd rather keep the soname accurate than play these games. Not bumping it and then finding out something out there broken as a result is even more painful than doing it right.
Created attachment 139751 [details] [review] Updated patch Updated patch applies cleanly to master and fixes a few cosmetic issues.
Created attachment 145650 [details] [review] Move support to testgtkhtml It's more useful place, with this change change url history - also tracked datauri. Maybe need create patch to support datauri in evolution without changes in gtkhtml?
Created attachment 145652 [details] [review] only support datauri Only support datauri without changes href and contenttype logic(in previous patch value this params been attached to htmlstream)
Hi! May be need some rework for this patch? Please review again.
Created attachment 240879 [details] [review] Added support of datauri to testgtkhtml This change don't change ABI for gtkhtml. Only support of DataURI. All older changes i marked as obsolete.
Since version 3.6, Evolution uses WebKit instead of GtkHtml for displaying messages. (And for completeness, Evolution 3.14 is planned to use WebKit also for composing and editing messages so GtkHtml will not receive any fixes anymore.) Hence I am closing this GtkHtml rendering bug report. We are sorry that your request was not handled in time when it was reported but unfortunately manpower is very limited (and does not allow testing every single reported issue separately again either). Please feel free to reopen this report (and move it to the "Evolution" product and the "Mail" component) if the problem described in this bug report still happens in a recent supported Evolution version which uses WebKit (the current stable Evolution version is 3.12).