After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 581985 - By default gtkhtml not support data URI
By default gtkhtml not support data URI
Status: RESOLVED WONTFIX
Product: GtkHtml
Classification: Other
Component: Rendering
3.28.x
Other Linux
: Normal normal
: ---
Assigned To: gtkhtml-maintainers
gtkhtml-maintainers
gnome[unmaintained]
Depends on:
Blocks:
 
 
Reported: 2009-05-09 13:19 UTC by Denis Pauk
Modified: 2014-12-02 01:07 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
add support data url in gtkhtml.c (3.38 KB, patch)
2009-05-09 13:34 UTC, Denis Pauk
needs-work Details | Review
Some test cases for data url (2.94 KB, text/html)
2009-05-13 09:17 UTC, Denis Pauk
  Details
Add support for data url (tested with inline image and text) (6.39 KB, patch)
2009-05-13 09:18 UTC, Denis Pauk
none Details | Review
Add support for data url (39.62 KB, patch)
2009-06-11 11:47 UTC, Denis Pauk
none Details | Review
Only update last patch (39.68 KB, patch)
2009-07-02 10:29 UTC, Denis Pauk
reviewed Details | Review
Updated patch (36.77 KB, patch)
2009-08-02 20:09 UTC, Matthew Barnes
none Details | Review
Move support to testgtkhtml (35.10 KB, patch)
2009-10-17 07:08 UTC, Denis Pauk
none Details | Review
only support datauri (4.70 KB, patch)
2009-10-17 09:07 UTC, Denis Pauk
none Details | Review
Added support of datauri to testgtkhtml (5.84 KB, patch)
2013-04-07 12:12 UTC, Denis Pauk
none Details | Review

Description Denis Pauk 2009-05-09 13:19:28 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.
Comment 1 Denis Pauk 2009-05-09 13:34:14 UTC
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.
Comment 2 Matthew Barnes 2009-05-11 12:18:09 UTC
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.
Comment 3 Denis Pauk 2009-05-11 20:08:36 UTC
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.
Comment 4 Denis Pauk 2009-05-13 09:17:06 UTC
Created attachment 134551 [details]
Some test cases for data url
Comment 5 Denis Pauk 2009-05-13 09:18:51 UTC
Created attachment 134552 [details] [review]
Add support for data url (tested with inline image and text)
Comment 6 Denis Pauk 2009-06-11 11:47:18 UTC
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
Comment 7 Denis Pauk 2009-07-02 10:29:28 UTC
Created attachment 137725 [details] [review]
Only update last patch
Comment 8 Matthew Barnes 2009-08-02 17:40:11 UTC
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.
Comment 9 Srinivasa Ragavan 2009-08-02 18:53:57 UTC
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.
Comment 10 Matthew Barnes 2009-08-02 19:40:36 UTC
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.
Comment 11 Matthew Barnes 2009-08-02 20:09:23 UTC
Created attachment 139751 [details] [review]
Updated patch

Updated patch applies cleanly to master and fixes a few cosmetic issues.
Comment 12 Denis Pauk 2009-10-17 07:08:33 UTC
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?
Comment 13 Denis Pauk 2009-10-17 09:07:58 UTC
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)
Comment 14 Denis Pauk 2011-02-01 09:18:37 UTC
Hi! 

May be need some rework for this patch? 
Please review again.
Comment 15 Denis Pauk 2013-04-07 12:12:30 UTC
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.
Comment 16 André Klapper 2014-12-02 01:07:40 UTC
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).