IFRAME element stub
Hi all Dillo developers ! There is a very small patch to support IFRAME HTML element. It does nothing except handling IFRAME via FRAME handler so special IFAME attributes (width and height) are not handled but this patch is suitable for current temporary solution (as we do not have real frame support for now). Your, Nikita diff -pruN dillo/src/html.c dillo-iframe/src/html.c --- dillo/src/html.c 2003-06-06 14:13:00.000000000 +0700 +++ dillo-iframe/src/html.c 2003-06-11 16:50:54.000000000 +0700 @@ -3795,6 +3795,7 @@ static const TagInfo Tags[] = { {"hr", Html_tag_open_hr, Html_tag_close_nop}, /* html */ {"i", Html_tag_open_i, Html_tag_close_default}, + {"iframe", Html_tag_open_frame, Html_tag_close_nop}, {"img", Html_tag_open_img, Html_tag_close_nop}, {"input", Html_tag_open_input, Html_tag_close_nop}, /* ins */
On Wed, 11 Jun 2003 20:30:32 +1000 TheStar <thestar@tpg.com.au> wrote:
There is a very small patch to support IFRAME HTML element. It does nothing except handling IFRAME via FRAME handler so special IFAME attributes(width and height) are not handled but this patch is suitable for current temporary solution (as we do not have real frame support for now).
This implies that Dillo can now handle frames (perhaps by re-rendering to tables), on at least one developer's computer - Correct?
No, not on my computer. Dillo (CVS version and all releases) cannot handle frames as needed. It currently follows HTML specification in handling frames by browsers which do not have an ability to show them so it gives you only links to frames. This patch only adds ability to draw link to IFRAME source. Some work is in progress which may implement frames (see last week postings about tabbed version) but it is not currenly done. Yours, Nikita
Nikita,
Hi all Dillo developers !
There is a very small patch to support IFRAME HTML element. It does nothing except handling IFRAME via FRAME handler so special IFAME attributes (width and height) are not handled but this patch is suitable for current temporary solution (as we do not have real frame support for now).
Done! Cheers Jorge.-
On Wed, 11 Jun 2003 11:32:22 -0400 (CLT) Jorge Arellano Cid <jcid@softhome.net> wrote:
Nikita,
Hi all Dillo developers !
There is a very small patch to support IFRAME HTML element. It does nothing except handling IFRAME via FRAME handler so special IFAME attributes(width and height) are not handled but this patch is suitable for current temporary solution (as we do not have real frame support for now).
Done!
Just a comment about this - I'm using a recent CVS version some time after this was integrated, and it causes some display issues with a lot of sites. In particular, sites that use narrow IFRAMEs for ads in a table(e.g. http://www.osnews.com, http://arstechnica.com/ ). The displayed URL seems to force the column width to be much, much wider than it normally would, making these websites look very bad (very wide column with ads, very narrow column with actual text :/ ) It's great having this patch apart from the display issues it causes. Would it be possible to make the displayed URL wrap? -- Stephen Lewis slewis@paradise.net.nz
Hello, Stephen ! Stephen Lewis wrote:
There is a very small patch to support IFRAME HTML element. It does nothing except handling IFRAME via FRAME handler so special IFAME attributes(width and height) are not handled but this patch is suitable for current temporary solution (as we do not have real frame support for now).
Just a comment about this - I'm using a recent CVS version some time after this was integrated, and it causes some display issues with a lot of sites. In particular, sites that use narrow IFRAMEs for ads in a table(e.g. http://www.osnews.com, http://arstechnica.com/ ). The displayed URL seems to force the column width to be much, much wider than it normally would, making these websites look very bad (very wide column with ads, very narrow column with actual text :/ )
It's great having this patch apart from the display issues it causes. Would it be possible to make the displayed URL wrap?
This is a consequence of currently used way to handle frames, as Links has. This IFRAME handler may be redesigned to use supplyed width and height, I think it is not too hard but I expect it is a _temporary_ solution intended just for having a link to IFRAME content until we do not have normal frames.
Stephen Lewis slewis@paradise.net.nz
Yours, Nikita
On Sat, 14 Jun 2003 15:22:48 +0700 (NOVST) "Nikita V. Borodikhin" <eliterr@tkk.ru> wrote:
Hello, Stephen !
Stephen Lewis wrote:
There is a very small patch to support IFRAME HTML element. It does> > nothing except handling IFRAME via FRAME handler so special IFAME> > attributes(width and height) are not handled but this patch is> > suitable for current temporary solution (as we do not have real frame support for now).
Just a comment about this - I'm using a recent CVS version some time after this was integrated, and it causes some display issues with a lot of sites. In particular, sites that use narrow IFRAMEs for ads <snip>
This is a consequence of currently used way to handle frames, as Links has. This IFRAME handler may be redesigned to use supplyed width and height, I think it is not too hard but I expect it is a _temporary_ solution intended just for having a link to IFRAME content until we do not have normal frames.
OK, thanks for the response - I just wanted to make sure it hadn't slipped through unnoticed. Of course, if I'd actually read your original message thoroughly, I would have noticed that you'd said it was a temporary solution anyway... knee-jerk bug reporting reactions strike again! As an aside, it was quite an eye-opener viewing websites with this patch, I discovered many sites which I had thought to be free from advertising were in fact saturated with it - they were having about as much effect on me using Dillo as all of those pop up/under ads I hear about all the time ;) -- Stephen Lewis slewis@paradise.net.nz
On Sat, 14 Jun 2003, Stephen Lewis wrote:
Just a comment about this - I'm using a recent CVS version some time after this was integrated, and it causes some display issues with a lot of sites. In particular, sites that use narrow IFRAMEs for ads in a table(e.g. http://www.osnews.com, http://arstechnica.com/ ). The displayed URL seems to force the column width to be much, much wider than it normally would, making these websites look very bad (very wide column with ads, very narrow column with actual text :/ )
It's great having this patch apart from the display issues it causes. Would it be possible to make the displayed URL wrap?
I made it to replace the middle of long urls with ... for iframes: diff -pru -x CVS -x configure -x 'aclocal*' -x 'Makefile*' -x config.h.in cvs/dillo/src/html.c dillo/src/html.c --- cvs/dillo/src/html.c 2003-06-11 23:43:07.000000000 +0300 +++ dillo/src/html.c 2003-06-12 21:18:36.000000000 +0300 @@ -1603,12 +1612,12 @@ static void Html_tag_open_tr(DilloHtml * static void Html_tag_open_frame (DilloHtml *html, gchar *tag, gint tagsize) { const char *attrbuf; - gchar *src; + gchar *src, *buf, *name; DilloUrl *url; DwPage *page; DwStyle style_attrs, *link_style; DwWidget *bullet; - gint dummy; + gint dummy, len; page = DW_PAGE(html->dw); @@ -1641,10 +1650,18 @@ static void Html_tag_open_frame (DilloHt a_Dw_page_add_space(page, html->stack[html->stack_top].style); /* If 'name' tag is present use it, if not use 'src' value */ - if ( !(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + if ( !!(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + } else if (tolower(tag[1]) != 'i' || (len = strlen(name = src)) < 16 || + (name += 7, len -= 7) < 16) { a_Dw_page_add_text(page, g_strdup(src), link_style); } else { - a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + buf = g_malloc(16); + memcpy(buf, name, 6); + strcpy(buf + 6, "..."); + memcpy(buf + 9, name + (len - 6), 6); + buf[15] = 0; + a_Dw_page_add_text(page, buf, link_style); } a_Dw_page_add_parbreak(page, 5, html->stack[(html)->stack_top].style);
Madis Janson writes:
+ gchar *src, *buf, *name; + gint dummy, len; - if ( !(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + if ( !!(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + } else if (tolower(tag[1]) != 'i' || (len = strlen(name = src)) < 16 || + (name += 7, len -= 7) < 16) { - a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + buf = g_malloc(16); + memcpy(buf, name, 6); + strcpy(buf + 6, "..."); + memcpy(buf + 9, name + (len - 6), 6); + buf[15] = 0; + a_Dw_page_add_text(page, buf, link_style);
Two questions: 1. Where does buf get free()'d? 2. If you know the exact size you need for buf, why not just use an array of that size? char buf[16]; bzero(buf, 16);
On Sat, 14 Jun 2003 16:49:45 -0700 Chris Palmer <chris@nodewarrior.org> wrote:
Madis Janson writes:
+ gchar *src, *buf, *name; + gint dummy, len; - if ( !(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + if ( !!(attrbuf = Html_get_attr(html, tag, tagsize, "name")) ) { + a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + } else if (tolower(tag[1]) != 'i' || (len = strlen(name = src)) < 16 ||+ (name += 7, len -= 7) < 16) { - a_Dw_page_add_text(page, g_strdup(attrbuf), link_style); + buf = g_malloc(16); + memcpy(buf, name, 6); + strcpy(buf + 6, "..."); + memcpy(buf + 9, name + (len - 6), 6); + buf[15] = 0; + a_Dw_page_add_text(page, buf, link_style);
Two questions:
1. Where does buf get free()'d?
I had a quick look around for this and found the following comment for a_Dw_page_add_text (from src/dw_page.c): /* * Add a word to the page structure. Stashes the argument pointer in * the page data structure so that it will be deallocated on destroy. */ Which I guess answers the second question too. It's always such a pleasant surprise to have actual, useful comments in code! But then, I've come to expect pleasant surprises with Dillo ;) -- Stephen Lewis slewis@paradise.net.nz
On Sat, 14 Jun 2003 11:51:35 +0300 (EEST) Madis Janson <madis@ats.cyber.ee> wrote:
On Sat, 14 Jun 2003, Stephen Lewis wrote:
<snip>
It's great having this patch apart from the display issues it causes. Would it be possible to make the displayed URL wrap?
I made it to replace the middle of long urls with ... for iframes: <snip>
That patch works very nicely, thank you! -- Stephen Lewis slewis@paradise.net.nz
On Sat, 14 Jun 2003, Stephen Lewis wrote:
On Wed, 11 Jun 2003 11:32:22 -0400 (CLT) Jorge Arellano Cid <jcid@softhome.net> wrote:
Nikita,
Hi all Dillo developers !
There is a very small patch to support IFRAME HTML element. It does nothing except handling IFRAME via FRAME handler so special IFAME attributes(width and height) are not handled but this patch is suitable for current temporary solution (as we do not have real frame support for now).
Done!
Just a comment about this - I'm using a recent CVS version some time after this was integrated, and it causes some display issues with a lot of sites. In particular, sites that use narrow IFRAMEs for ads in a table(e.g. http://www.osnews.com, http://arstechnica.com/ ). The displayed URL seems to force the column width to be much, much wider than it normally would, making these websites look very bad (very wide column with ads, very narrow column with actual text :/ )
It's great having this patch apart from the display issues it causes. Would it be possible to make the displayed URL wrap?
[...] I just wanted to make sure it hadn't slipped through unnoticed. Of course, if I'd actually read your
Well, I noticed the problem shortly after commiting, but as I'm working hevily in dpid (with Ferdi) I didn't have the time to address it.
As an aside, it was quite an eye-opener viewing websites with this patch, I discovered many sites which I had thought to be free from advertising were in fact saturated with it - they were having about as much effect on me using Dillo as all of those pop up/under ads I hear about all the time ;)
Dillo helps a lot with advertising filtering. Also, popups don't show because of no javascript support. Yes, it was an "eye opener" to see those instrumentations. After some thought I decided to name the link "IFRAME" (the destination shows on the status bar). The patch is now in the CVS. There may still be some problems (if IFRAME is used as a web bug; i.e. invisible IFRAME for spying). I think it will be very interesting to browse and "see" what comes down the line. Another goodie of this approach is that you can search for the "IFRAME" word, and locate them. Cheers Jorge.-
participants (5)
-
Chris Palmer
-
Jorge Arellano Cid
-
Madis Janson
-
Nikita V. Borodikhin
-
Stephen Lewis