From 1f36e4837259ecb83f91568ff809ca02142d0e62 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 15 Jul 2012 01:02:33 +0100 Subject: Squash warnings --- render/html.c | 3 ++- render/html_forms.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/render/html.c b/render/html.c index 8c11f35b9..80e467c58 100644 --- a/render/html.c +++ b/render/html.c @@ -2050,7 +2050,8 @@ static bool html_convert(struct content *c) } /* Retrieve forms from parser */ - htmlc->forms = html_forms_get_forms(htmlc->encoding, htmlc->document); + htmlc->forms = html_forms_get_forms(htmlc->encoding, + (dom_html_document *) htmlc->document); for (f = htmlc->forms; f != NULL; f = f->prev) { char *action; url_func_result res; diff --git a/render/html_forms.c b/render/html_forms.c index 626fe4c0e..c8b3c7fe6 100644 --- a/render/html_forms.c +++ b/render/html_forms.c @@ -258,7 +258,7 @@ out: static struct form_control * parse_input_element(struct form *forms, dom_html_input_element *input) { - struct form_control *control; + struct form_control *control = NULL; dom_html_form_element *form = NULL; dom_string *ds_type = NULL; dom_string *ds_name = NULL; -- cgit v1.2.3 From 64f098dfc7000fe8a0b9e228a3527434e8dce094 Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 15 Jul 2012 01:17:04 +0100 Subject: Do not render noscript when script is enabled. --- render/box_construct.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/render/box_construct.c b/render/box_construct.c index 5f8b092c5..0044f6e21 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -114,6 +114,7 @@ static bool box_frameset(BOX_SPECIAL_PARAMS); static bool box_create_frameset(struct content_html_frames *f, dom_node *n, html_content *content); static bool box_select_add_option(struct form_control *control, dom_node *n); +static bool box_noscript(BOX_SPECIAL_PARAMS); static bool box_object(BOX_SPECIAL_PARAMS); static bool box_embed(BOX_SPECIAL_PARAMS); static bool box_pre(BOX_SPECIAL_PARAMS); @@ -139,6 +140,7 @@ static const struct element_entry element_table[] = { {"image", box_image}, {"img", box_image}, {"input", box_input}, + {"noscript", box_noscript}, {"object", box_object}, {"pre", box_pre}, {"select", box_select}, @@ -1749,6 +1751,20 @@ bool box_image(BOX_SPECIAL_PARAMS) } +/** + * Noscript element + */ + +bool box_noscript(BOX_SPECIAL_PARAMS) +{ + /* If scripting is enabled, do not display the contents of noscript */ + if (nsoption_bool(enable_javascript)) + *convert_children = false; + + return true; +} + + /** * Destructor for object_params, for elements * -- cgit v1.2.3 From fa3da41a941a149cff8e507d4882c84abc88f6e9 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 14 Jul 2012 18:24:09 -0600 Subject: fix stylesheet render --- render/html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/render/html.c b/render/html.c index 80e467c58..946555f6e 100644 --- a/render/html.c +++ b/render/html.c @@ -1690,7 +1690,7 @@ html_process_stylesheet(dom_node *node, dom_string *name, void *vctx) } /* if it is not a link node skip it */ - if (strcmp(dom_string_data(name), "link") != 0) { + if (strcmp(dom_string_data(name), "LINK") != 0) { return true; } -- cgit v1.2.3 From 1ecc94b187a94859fb347cd5f585d721e7d6e8be Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Sun, 15 Jul 2012 01:39:25 +0100 Subject: Use case insensitive string comparisions for nodes --- desktop/save_complete.c | 22 +++++++++++----------- desktop/tree_url_node.c | 13 +++++++------ render/box_construct.c | 16 +++++++++------- render/html.c | 14 ++++++++------ 4 files changed, 35 insertions(+), 30 deletions(-) diff --git a/desktop/save_complete.c b/desktop/save_complete.c index 33234ce2c..0ac64b515 100644 --- a/desktop/save_complete.c +++ b/desktop/save_complete.c @@ -589,28 +589,28 @@ bool rewrite_urls(xmlNode *n, const char *base, /* ignore */ } /* 1 */ - else if (strcmp((const char *) n->name, "object") == 0) { + else if (strcasecmp((const char *) n->name, "object") == 0) { if (!rewrite_url(n, "data", base, list)) return false; } /* 2 */ - else if (strcmp((const char *) n->name, "a") == 0 || - strcmp((const char *) n->name, "area") == 0 || - strcmp((const char *) n->name, "link") == 0) { + else if (strcasecmp((const char *) n->name, "a") == 0 || + strcasecmp((const char *) n->name, "area") == 0 || + strcasecmp((const char *) n->name, "link") == 0) { if (!rewrite_url(n, "href", base, list)) return false; } /* 3 */ - else if (strcmp((const char *) n->name, "frame") == 0 || - strcmp((const char *) n->name, "iframe") == 0 || - strcmp((const char *) n->name, "input") == 0 || - strcmp((const char *) n->name, "img") == 0 || - strcmp((const char *) n->name, "script") == 0) { + else if (strcasecmp((const char *) n->name, "frame") == 0 || + strcasecmp((const char *) n->name, "iframe") == 0 || + strcasecmp((const char *) n->name, "input") == 0 || + strcasecmp((const char *) n->name, "img") == 0 || + strcasecmp((const char *) n->name, "script") == 0) { if (!rewrite_url(n, "src", base, list)) return false; } /* 4 */ - else if (strcmp((const char *) n->name, "style") == 0) { + else if (strcasecmp((const char *) n->name, "style") == 0) { unsigned int len; xmlChar *content; @@ -642,7 +642,7 @@ bool rewrite_urls(xmlNode *n, const char *base, return true; } /* 5 */ - else if (strcmp((const char *) n->name, "base") == 0) { + else if (strcasecmp((const char *) n->name, "base") == 0) { /* simply remove any tags from the document */ xmlUnlinkNode(n); xmlFreeNode(n); diff --git a/desktop/tree_url_node.c b/desktop/tree_url_node.c index 380ba43b9..d477249c9 100644 --- a/desktop/tree_url_node.c +++ b/desktop/tree_url_node.c @@ -470,7 +470,7 @@ static xmlNode *tree_url_find_xml_element(xmlNode *node, const char *name) for (xmlnode = node->children; xmlnode && !(xmlnode->type == XML_ELEMENT_NODE && - strcmp((const char *) xmlnode->name, name) == 0); + strcasecmp((const char *) xmlnode->name, name) == 0); xmlnode = xmlnode->next) ; @@ -498,7 +498,7 @@ static void tree_url_load_entry(xmlNode *li, struct tree *tree, for (xmlnode = li->children; xmlnode; xmlnode = xmlnode->next) { /* The li must contain an "a" element */ if (xmlnode->type == XML_ELEMENT_NODE && - strcmp((const char *)xmlnode->name, "a") == 0) { + strcasecmp((const char *)xmlnode->name, "a") == 0) { url1 = (char *)xmlGetProp(xmlnode, (const xmlChar *) "href"); title = (char *)xmlNodeGetContent(xmlnode); @@ -590,12 +590,12 @@ static void tree_url_load_directory(xmlNode *ul, struct tree *tree, if (xmlnode->type != XML_ELEMENT_NODE) continue; - if (strcmp((const char *)xmlnode->name, "li") == 0) { + if (strcasecmp((const char *)xmlnode->name, "li") == 0) { /* entry */ tree_url_load_entry(xmlnode, tree, directory, callback, callback_data); - } else if (strcmp((const char *)xmlnode->name, "h4") == 0) { + } else if (strcasecmp((const char *)xmlnode->name, "h4") == 0) { /* directory */ bool dir_is_default = false; title = (char *) xmlNodeGetContent(xmlnode ); @@ -610,7 +610,7 @@ static void tree_url_load_directory(xmlNode *ul, struct tree *tree, xmlnode = xmlnode->next) ; if ((xmlnode == NULL) || - strcmp((const char *)xmlnode->name, "ul") != 0) { + strcasecmp((const char *)xmlnode->name, "ul") != 0) { /* next element isn't expected ul */ free(title); warn_user("TreeLoadError", "(Expected " @@ -620,7 +620,8 @@ static void tree_url_load_directory(xmlNode *ul, struct tree *tree, id = xmlGetProp(xmlnode, (const xmlChar *) "id"); if (id != NULL) { - if(strcmp((const char *)id, "default") == 0) + if (strcasecmp((const char *)id, + "default") == 0) dir_is_default = true; xmlFree(id); } diff --git a/render/box_construct.c b/render/box_construct.c index 0044f6e21..b968e0e4f 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -1939,7 +1939,7 @@ bool box_object(BOX_SPECIAL_PARAMS) return false; } - if (strcmp(dom_string_data(name), "param") != 0) { + if (strcasecmp(dom_string_data(name), "param") != 0) { /* The first non-param child is the start of * the alt html. Therefore, we should break * out of this loop. */ @@ -2192,9 +2192,11 @@ bool box_create_frameset(struct content_html_frames *f, dom_node *n, } if (type != DOM_ELEMENT_NODE || - (strcmp(dom_string_data(name), + (strcasecmp( + dom_string_data(name), "frame") != 0 && - strcmp(dom_string_data(name), + strcasecmp( + dom_string_data(name), "frameset") != 0)) { err = dom_node_get_next_sibling(c, &next); @@ -2225,7 +2227,7 @@ bool box_create_frameset(struct content_html_frames *f, dom_node *n, return false; } - if (strcmp(dom_string_data(s), "frameset") == 0) { + if (strcasecmp(dom_string_data(s), "frameset") == 0) { dom_string_unref(s); frame->border = 0; if (box_create_frameset(frame, c, @@ -2699,14 +2701,14 @@ bool box_select(BOX_SPECIAL_PARAMS) return false; } - if (strcmp(dom_string_data(name), "option") == 0) { + if (strcasecmp(dom_string_data(name), "option") == 0) { dom_string_unref(name); if (box_select_add_option(gadget, c) == false) { dom_node_unref(c); goto no_memory; } - } else if (strcmp(dom_string_data(name), "optgroup") == 0) { + } else if (strcasecmp(dom_string_data(name), "optgroup") == 0) { dom_string_unref(name); err = dom_node_get_first_child(c, &c2); @@ -2725,7 +2727,7 @@ bool box_select(BOX_SPECIAL_PARAMS) return false; } - if (strcmp(dom_string_data(c2_name), + if (strcasecmp(dom_string_data(c2_name), "option") == 0) { dom_string_unref(c2_name); diff --git a/render/html.c b/render/html.c index 946555f6e..8c5c76b8e 100644 --- a/render/html.c +++ b/render/html.c @@ -997,7 +997,8 @@ static bool html_meta_refresh(html_content *c, dom_node *head) } /* Recurse into noscript elements */ - if (strcmp(dom_string_data(name), "noscript") == 0) { + if (strcasecmp(dom_string_data(name), + "noscript") == 0) { if (html_meta_refresh(c, n) == false) { /* Some error occurred */ dom_node_unref(n); @@ -1007,7 +1008,8 @@ static bool html_meta_refresh(html_content *c, dom_node *head) dom_node_unref(n); return true; } - } else if (strcmp(dom_string_data(name), "meta") == 0) { + } else if (strcasecmp(dom_string_data(name), + "meta") == 0) { if (html_meta_refresh_process_element(c, n) == false) { /* Some error occurred */ @@ -1436,7 +1438,7 @@ html_process_style_element(html_content *c, /* type='text/css', or not present (invalid but common) */ exc = dom_element_get_attribute(style, html_dom_string_type, &val); if (exc == DOM_NO_ERR && val != NULL) { - if (strcmp(dom_string_data(val), "text/css") != 0) { + if (strcasecmp(dom_string_data(val), "text/css") != 0) { dom_string_unref(val); return true; } @@ -1683,14 +1685,14 @@ html_process_stylesheet(dom_node *node, dom_string *name, void *vctx) hlcache_child_context child; /* deal with style nodes */ - if (strcmp(dom_string_data(name), "style") == 0) { + if (strcasecmp(dom_string_data(name), "style") == 0) { if (!html_process_style_element(ctx->c, &ctx->count, node)) return false; return true; } /* if it is not a link node skip it */ - if (strcmp(dom_string_data(name), "LINK") != 0) { + if (strcasecmp(dom_string_data(name), "link") != 0) { return true; } @@ -1713,7 +1715,7 @@ html_process_stylesheet(dom_node *node, dom_string *name, void *vctx) /* type='text/css' or not present */ exc = dom_element_get_attribute(node, html_dom_string_type, &type_attr); if (exc == DOM_NO_ERR && type_attr != NULL) { - if (strcmp(dom_string_data(type_attr), "text/css") != 0) { + if (strcasecmp(dom_string_data(type_attr), "text/css") != 0) { dom_string_unref(type_attr); return true; } -- cgit v1.2.3 From 98e2b3f4df0475987c271e66b84862dcc410b95f Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 15 Jul 2012 13:56:33 +0100 Subject: git-testament: Cope with detached HEAD better --- utils/git-testament.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/git-testament.pl b/utils/git-testament.pl index dc6301b50..89c41ab5e 100644 --- a/utils/git-testament.pl +++ b/utils/git-testament.pl @@ -68,7 +68,7 @@ if ( $git_present ) { chomp $gitinfo{url}; $gitinfo{revision} = `git rev-parse HEAD`; chomp $gitinfo{revision}; - $gitinfo{branch} = `git for-each-ref --format="\%(refname:short)" \$(git symbolic-ref HEAD)`; + $gitinfo{branch} = `git for-each-ref --format="\%(refname:short)" \$(git symbolic-ref HEAD 2>/dev/null || git show-ref -s HEAD)`; chomp $gitinfo{branch}; @bits = split /\s+/, `git describe --tags --exact-match HEAD 2>/dev/null`; $bits[0] = "" unless exists $bits[0]; -- cgit v1.2.3 From f266e0569e954e68429c9ee4646275e904463d9a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 15 Jul 2012 14:06:37 +0100 Subject: Fix input type test to compare correct variable. --- css/select.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/css/select.c b/css/select.c index 1ea818f0e..174b73e35 100644 --- a/css/select.c +++ b/css/select.c @@ -2494,15 +2494,15 @@ node_presentational_hint_width(nscss_select_ctx *ctx, } if (input) { - err = dom_element_get_attribute(node, - nscss_dom_string_type, - &width); + err = dom_element_get_attribute(node, + nscss_dom_string_type, &width); if ((err != DOM_NO_ERR) || (width == NULL)) { return CSS_PROPERTY_NOT_SET; } - if (dom_string_isequal(name, nscss_dom_string_text) || - dom_string_isequal(name, nscss_dom_string_password)) { + if (dom_string_isequal(width, nscss_dom_string_text) || + dom_string_isequal(width, + nscss_dom_string_password)) { hint->data.length.unit = CSS_UNIT_EX; } -- cgit v1.2.3 From ae07dfbc3d6e53fd3ff14b6207cf06296f77e5d1 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 15 Jul 2012 17:30:48 +0100 Subject: Update some project urls. --- !NetSurf/Resources/en/licence.html,faf | 6 +++--- !NetSurf/Resources/it/licence.html,faf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/!NetSurf/Resources/en/licence.html,faf b/!NetSurf/Resources/en/licence.html,faf index f841f5b63..2f78da4ec 100644 --- a/!NetSurf/Resources/en/licence.html,faf +++ b/!NetSurf/Resources/en/licence.html,faf @@ -106,19 +106,19 @@ version.

MIT -
Libnsbmp
+
Libnsbmp
© 2006 Richard Wilson
© 2008 Sean Fox
MIT
-
Libnsfb
+
Libnsfb
© 2009–2011 Vincent Sanders
© 2009–2011 Michael Drake
MIT
-
Libnsgif
+
Libnsgif
© 2004 Richard Wilson
© 2008 Sean Fox
MIT diff --git a/!NetSurf/Resources/it/licence.html,faf b/!NetSurf/Resources/it/licence.html,faf index c54c589a1..06ab13925 100644 --- a/!NetSurf/Resources/it/licence.html,faf +++ b/!NetSurf/Resources/it/licence.html,faf @@ -98,19 +98,19 @@ dl.components > dd > span + span { MIT
-
Libnsbmp
+
Libnsbmp
© 2006 Richard Wilson
© 2008 Sean Fox
MIT
-
Libnsfb
+
Libnsfb
© 2009–2012 Vincent Sanders
© 2009–2012 Michael Drake
MIT
-
Libnsgif
+
Libnsgif
© 2004 Richard Wilson
© 2008 Sean Fox
MIT -- cgit v1.2.3 From f7683fd0195059b89b90f4eb9f7e6628c55492a5 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 15 Jul 2012 17:41:37 +0100 Subject: Update URLs for glyph data. --- framebuffer/nsfont_bold.c | 2 +- framebuffer/nsfont_italic.c | 2 +- framebuffer/nsfont_italic_bold.c | 2 +- framebuffer/nsfont_regular.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/framebuffer/nsfont_bold.c b/framebuffer/nsfont_bold.c index 824b76197..6ea4d71cd 100644 --- a/framebuffer/nsfont_bold.c +++ b/framebuffer/nsfont_bold.c @@ -10,7 +10,7 @@ * format and many glyphs added for use in the NetSurf project. * * Plain text font data: - * http://source.netsurf-browser.org/trunk/art/fonts/netsurf/glyph_data + * http://source.netsurf-browser.org/?p=art.git;a=blob_plain;f=fonts/netsurf/glyph_data;hb=HEAD * * Zap: http://zap.tartarus.org/ * NetSurf: http://www.netsurf-browser.org/ diff --git a/framebuffer/nsfont_italic.c b/framebuffer/nsfont_italic.c index 29444b2be..9dc29553a 100644 --- a/framebuffer/nsfont_italic.c +++ b/framebuffer/nsfont_italic.c @@ -10,7 +10,7 @@ * format and many glyphs added for use in the NetSurf project. * * Plain text font data: - * http://source.netsurf-browser.org/trunk/art/fonts/netsurf/glyph_data + * http://source.netsurf-browser.org/?p=art.git;a=blob_plain;f=fonts/netsurf/glyph_data;hb=HEAD * * Zap: http://zap.tartarus.org/ * NetSurf: http://www.netsurf-browser.org/ diff --git a/framebuffer/nsfont_italic_bold.c b/framebuffer/nsfont_italic_bold.c index feb4284c4..d70794668 100644 --- a/framebuffer/nsfont_italic_bold.c +++ b/framebuffer/nsfont_italic_bold.c @@ -10,7 +10,7 @@ * format and many glyphs added for use in the NetSurf project. * * Plain text font data: - * http://source.netsurf-browser.org/trunk/art/fonts/netsurf/glyph_data + * http://source.netsurf-browser.org/?p=art.git;a=blob_plain;f=fonts/netsurf/glyph_data;hb=HEAD * * Zap: http://zap.tartarus.org/ * NetSurf: http://www.netsurf-browser.org/ diff --git a/framebuffer/nsfont_regular.c b/framebuffer/nsfont_regular.c index eb9259d8c..829e3876b 100644 --- a/framebuffer/nsfont_regular.c +++ b/framebuffer/nsfont_regular.c @@ -10,7 +10,7 @@ * format and many glyphs added for use in the NetSurf project. * * Plain text font data: - * http://source.netsurf-browser.org/trunk/art/fonts/netsurf/glyph_data + * http://source.netsurf-browser.org/?p=art.git;a=blob_plain;f=fonts/netsurf/glyph_data;hb=HEAD * * Zap: http://zap.tartarus.org/ * NetSurf: http://www.netsurf-browser.org/ -- cgit v1.2.3 From 3bb15c459f86d85c653fd6369b3fd621c10c3515 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 15 Jul 2012 18:04:15 +0100 Subject: Update docs for Git. --- Docs/BUILDING-Cocoa | 2 +- Docs/BUILDING-Framebuffer | 2 +- Docs/BUILDING-GTK | 2 +- Docs/BUILDING-Monkey | 2 +- Docs/BUILDING-Windows | 2 +- Docs/LIBRARIES | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Docs/BUILDING-Cocoa b/Docs/BUILDING-Cocoa index 7bfac2937..31a58ee81 100644 --- a/Docs/BUILDING-Cocoa +++ b/Docs/BUILDING-Cocoa @@ -27,7 +27,7 @@ The remainder must be installed manually. Currently, some of the libraries developed as part of the NetSurf project have not had official releases. Hopefully they will soon be released with downloadable tarballs and packaged - in common distros. For now, you'll have to make do with svn checkouts. + in common distros. For now, you'll have to make do with Git checkouts. Package installation ---------------------- diff --git a/Docs/BUILDING-Framebuffer b/Docs/BUILDING-Framebuffer index 7cddc7e74..4eb993f13 100644 --- a/Docs/BUILDING-Framebuffer +++ b/Docs/BUILDING-Framebuffer @@ -211,7 +211,7 @@ Index: framebuffer/font_freetype.c The remainder must be installed manually. Currently, some of the libraries developed as part of the NetSurf project have not had official releases. Hopefully they will soon be released with downloadable tarballs and packaged - in common distros. For now, you'll have to make do with svn checkouts. + in common distros. For now, you'll have to make do with Git checkouts. Package installation ---------------------- diff --git a/Docs/BUILDING-GTK b/Docs/BUILDING-GTK index b01dbf021..2749bf4ec 100644 --- a/Docs/BUILDING-GTK +++ b/Docs/BUILDING-GTK @@ -51,7 +51,7 @@ The remainder must be installed manually. Currently, some of the libraries developed as part of the NetSurf project have not had official releases. Hopefully they will soon be released with downloadable tarballs and packaged - in common distros. For now, you'll have to make do with svn checkouts. + in common distros. For now, you'll have to make do with Git checkouts. Some of NetSurf's own libraries will be installed in /usr/local/ by default. Fedora, and perhaps some other distributions of Linux, do not ship a diff --git a/Docs/BUILDING-Monkey b/Docs/BUILDING-Monkey index aa77f99ec..b467c7c15 100644 --- a/Docs/BUILDING-Monkey +++ b/Docs/BUILDING-Monkey @@ -47,7 +47,7 @@ The remainder must be installed manually. Currently, some of the libraries developed as part of the NetSurf project have not had official releases. Hopefully they will soon be released with downloadable tarballs and packaged - in common distros. For now, you'll have to make do with svn checkouts. + in common distros. For now, you'll have to make do with Git checkouts. Some of NetSurf's own libraries will be installed in /usr/local/ by default. Fedora, and perhaps some other distributions of Linux, do not ship a diff --git a/Docs/BUILDING-Windows b/Docs/BUILDING-Windows index 55dfcfdfd..10454b9b2 100644 --- a/Docs/BUILDING-Windows +++ b/Docs/BUILDING-Windows @@ -204,7 +204,7 @@ EOF ----------- The windows resources may be rebuilt. Currently there is 1 object - file included in the svn distribution of NetSurf that could be + file included in the Git distribution of NetSurf that could be manually compiled $ cd windows/res diff --git a/Docs/LIBRARIES b/Docs/LIBRARIES index f6292809d..dc5a98048 100644 --- a/Docs/LIBRARIES +++ b/Docs/LIBRARIES @@ -30,7 +30,7 @@ Required: - $ git clone git://git.netsurf-browser.org/pencil + $ git clone git://git.netsurf-browser.org/libpencil $ git clone git://git.netsurf-browser.org/rufl -- cgit v1.2.3 From 82fe8989aefa072215d223cf92a1a1e7e7e7228a Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 16 Jul 2012 14:28:08 +0100 Subject: Remove reference to robuild web page. --- Docs/BUILDING-RISC_OS | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Docs/BUILDING-RISC_OS b/Docs/BUILDING-RISC_OS index 5c4c3d531..7e61bd22f 100644 --- a/Docs/BUILDING-RISC_OS +++ b/Docs/BUILDING-RISC_OS @@ -1,5 +1,5 @@ -------------------------------------------------------------------------------- - Build Instructions for RISC OS NetSurf 16 January 2010 + Build Instructions for RISC OS NetSurf 16 July 2012 -------------------------------------------------------------------------------- This document provides instructions for building the RISC OS NetSurf @@ -16,11 +16,6 @@ | + Perl 5.8.8 or later | + GCC 3.4.6 release 3 or later | + The latest NSTools - | - | For instructions on how to do all of the above, consult the following - | document: - | - | http://www.netsurf-browser.org/documentation/robuild If you want to cross-compile NetSurf for RISC OS, use the BUILDING-ROCross document. -- cgit v1.2.3 From ae7d1141012c438c1ec101747038f83c9db33d7a Mon Sep 17 00:00:00 2001 From: John-Mark Bell Date: Fri, 20 Jul 2012 16:30:12 +0100 Subject: Plumbing for Atari cross-compilation --- Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 22212a4d2..d51936fbb 100644 --- a/Makefile +++ b/Makefile @@ -241,8 +241,25 @@ else ifeq ($(TARGET),cocoa) PKG_CONFIG := PKG_CONFIG_PATH="$(PKG_CONFIG_PATH):/usr/local/lib/pkgconfig" pkg-config else - # Building for GTK, Framebuffer, Atari - PKG_CONFIG := pkg-config + ifeq ($(TARGET),atari) + ifeq ($(HOST),atari) + PKG_CONFIG := pkg-config + else + ifeq ($(HOST),mint) + PKG_CONFIG := pkg-config + else + GCCSDK_INSTALL_ENV ?= /opt/netsurf/m68k-atari-mint/env + GCCSDK_INSTALL_CROSSBIN ?= /opt/netsurf/m68k-atari-mint/cross/bin + + CC := $(wildcard $(GCCSDK_INSTALL_CROSSBIN)/*gcc) + + PKG_CONFIG := PKG_CONFIG_LIBDIR="$(GCCSDK_INSTALL_ENV)/lib/pkgconfig" pkg-config + endif + endif + else + # Building for GTK, Framebuffer + PKG_CONFIG := pkg-config + endif endif endif endif -- cgit v1.2.3 From 717dfae6f80beeaa8937510fb2f6e8113c2b3426 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 11:48:16 +0100 Subject: Fix ignore of files in !NetSurf dir. --- .gitignore | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f27ca08ca..053a22050 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,12 @@ *~ gtk/res/toolbarIndices windows/res/preferences -!NetSurf/!Run,feb -!NetSurf/!RunImage,ff8 -!NetSurf/Resources/en/Templates,fec -!NetSurf/Resources/fr/Templates,fec -!NetSurf/Resources/de/Templates,fec -!NetSurf/Resources/nl/Templates,fec +\!NetSurf/!Run,feb +\!NetSurf/!RunImage,ff8 +\!NetSurf/Resources/en/Templates,fec +\!NetSurf/Resources/fr/Templates,fec +\!NetSurf/Resources/de/Templates,fec +\!NetSurf/Resources/nl/Templates,fec test/nsurl test/urldbtest test/llcache -- cgit v1.2.3 From 02561162a9f4b3ded49cea72cd23b4b102092db8 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 13:09:14 +0100 Subject: Add welcome page resources. Add symlinks to English welcome page to gtk and framebuffer. --- !NetSurf/Resources/de/welcome.html,faf | 66 ++++++++++++++++++++++++++++++++++ !NetSurf/Resources/en/welcome.html,faf | 65 +++++++++++++++++++++++++++++++++ !NetSurf/Resources/it/welcome.html,faf | 65 +++++++++++++++++++++++++++++++++ !NetSurf/Resources/ja/welcome.html,faf | 66 ++++++++++++++++++++++++++++++++++ framebuffer/res/welcome.html | 1 + gtk/res/en/welcome.html | 1 + 6 files changed, 264 insertions(+) create mode 100644 !NetSurf/Resources/de/welcome.html,faf create mode 100644 !NetSurf/Resources/en/welcome.html,faf create mode 100644 !NetSurf/Resources/it/welcome.html,faf create mode 100644 !NetSurf/Resources/ja/welcome.html,faf create mode 120000 framebuffer/res/welcome.html create mode 120000 gtk/res/en/welcome.html diff --git a/!NetSurf/Resources/de/welcome.html,faf b/!NetSurf/Resources/de/welcome.html,faf new file mode 100644 index 000000000..975a67b0a --- /dev/null +++ b/!NetSurf/Resources/de/welcome.html,faf @@ -0,0 +1,66 @@ + + + +Welcome to NetSurf + + + + + +

NetSurf

+ + + +
+

Willkommen zu NetSurf

+ +

NetSurf ist ein kleiner, schneller Opensource Webbrowser. Wir sind ständig daran interessiert, unseren Browser zu verbessern. Bitte kontaktieren Sie uns, wenn Sie irgend welche Probleme bemerken.
+Danke, dass Sie sich für NetSurf entschieden haben!

+ +
+
+ + +
+
+ + + + +
+ + + diff --git a/!NetSurf/Resources/en/welcome.html,faf b/!NetSurf/Resources/en/welcome.html,faf new file mode 100644 index 000000000..dba8d37ee --- /dev/null +++ b/!NetSurf/Resources/en/welcome.html,faf @@ -0,0 +1,65 @@ + + + +Welcome to NetSurf + + + + + +

NetSurf

+ + + +
+

Welcome to NetSurf

+ +

NetSurf is a small, fast open source web browser. We are always keen to improve our browser, so get in touch if you run into any problems. Thanks for choosing NetSurf!

+ +
+
+ + +
+
+ + + + +
+ + + \ No newline at end of file diff --git a/!NetSurf/Resources/it/welcome.html,faf b/!NetSurf/Resources/it/welcome.html,faf new file mode 100644 index 000000000..76fb9ba36 --- /dev/null +++ b/!NetSurf/Resources/it/welcome.html,faf @@ -0,0 +1,65 @@ + + + +Benvenuti su NetSurf + + + + + +

NetSurf

+ + + +
+

Benvenuti su NetSurf

+ +

NetSurf la nostra idea di browser, per questo abbiamo scelto di renderlo piccolo e veloce e stiamo lavorando per renderlo sempre migliore, se hai qualche suggerimento o semplicemente hai bisogno di aiuto contattaci! Grazie per aver scelto NetSurf!

+ +
+
+ + +
+
+ + + + +
+ + + \ No newline at end of file diff --git a/!NetSurf/Resources/ja/welcome.html,faf b/!NetSurf/Resources/ja/welcome.html,faf new file mode 100644 index 000000000..e3eba1ad9 --- /dev/null +++ b/!NetSurf/Resources/ja/welcome.html,faf @@ -0,0 +1,66 @@ + + + + +NetSurfへようこそ + + + + + +

NetSurf

+ + + +
+

NetSurfへようこそ

+ +

NetSurfは小さくて速いオープンソースのウェブブラウザです。私たちはいつもこのブラウザを改良する気満々ですから、どんな問題でも声をかけてください。NetSurfを選んでくれてありがとう!

+ +
+
+ + +
+
+ + + + +
+ + + diff --git a/framebuffer/res/welcome.html b/framebuffer/res/welcome.html new file mode 120000 index 000000000..5b394445b --- /dev/null +++ b/framebuffer/res/welcome.html @@ -0,0 +1 @@ +../../!NetSurf/Resources/en/welcome.html,faf \ No newline at end of file diff --git a/gtk/res/en/welcome.html b/gtk/res/en/welcome.html new file mode 120000 index 000000000..28362130a --- /dev/null +++ b/gtk/res/en/welcome.html @@ -0,0 +1 @@ +../../../!NetSurf/Resources/en/welcome.html,faf \ No newline at end of file -- cgit v1.2.3 From a2dadbbe1261ec89fc6b05f356baef06efdc6df7 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 13:12:51 +0100 Subject: Add about:welcome handler and enable resource:welcome.html. --- content/fetchers/about.c | 22 ++++++++++++++++++++-- content/fetchers/resource.c | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/content/fetchers/about.c b/content/fetchers/about.c index eddd77ef0..1330217f9 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -548,6 +548,21 @@ static bool fetch_about_logo_handler(struct fetch_about_context *ctx) return true; } +static bool fetch_about_welcome_handler(struct fetch_about_context *ctx) +{ + fetch_msg msg; + + /* content is going to return redirect */ + fetch_set_http_code(ctx->fetchh, 302); + + msg.type = FETCH_REDIRECT; + msg.data.redirect = "resource:welcome.html"; + + fetch_about_send_callback(&msg, ctx); + + return true; +} + /* Forward declaration because this handler requires the handler table. */ static bool fetch_about_about_handler(struct fetch_about_context *ctx); @@ -560,13 +575,15 @@ struct about_handlers { }; /** List of about paths and their handlers */ -struct about_handlers about_handler_list[] = { +struct about_handlers about_handler_list[] = { { "credits", SLEN("credits"), NULL, fetch_about_credits_handler, false }, { "licence", SLEN("licence"), NULL, fetch_about_licence_handler, false }, { "license", SLEN("license"), NULL, fetch_about_licence_handler, true }, + { "welcome", SLEN("welcome"), NULL, + fetch_about_welcome_handler, false }, { "config", SLEN("config"), NULL, fetch_about_config_handler, false }, { "Choices", SLEN("Choices"), NULL, @@ -585,7 +602,8 @@ struct about_handlers about_handler_list[] = { fetch_about_blank_handler, true } }; -#define about_handler_list_len (sizeof(about_handler_list) / sizeof(struct about_handlers)) +#define about_handler_list_len (sizeof(about_handler_list) / \ + sizeof(struct about_handlers)) /** * List all the valid about: paths available diff --git a/content/fetchers/resource.c b/content/fetchers/resource.c index 1cd04f2dd..86d5498d5 100644 --- a/content/fetchers/resource.c +++ b/content/fetchers/resource.c @@ -79,6 +79,7 @@ static const char *fetch_resource_paths[] = { "user.css", "credits.html", "licence.html", + "welcome.html", "favicon.ico", "netsurf.png" }; -- cgit v1.2.3 From 5fc781d715cab48f03fb4d72558d35f65c6528c3 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 13:13:57 +0100 Subject: Update default homepage URL to about:welcome. Make RISC OS front end use NETSURF_HOMEPAGE too. Currently only the English welcome page will be fetched. Need to add language negotiation to choose best language option. --- Docs/PACKAGING-GTK | 4 ++-- Makefile.defaults | 2 +- riscos/gui.c | 13 ++++--------- riscos/iconbar.c | 9 +++------ riscos/window.c | 7 +------ 5 files changed, 11 insertions(+), 24 deletions(-) diff --git a/Docs/PACKAGING-GTK b/Docs/PACKAGING-GTK index 5453dff3f..67e63b231 100644 --- a/Docs/PACKAGING-GTK +++ b/Docs/PACKAGING-GTK @@ -74,8 +74,8 @@ =============== If the user hasn't specified a home page URL in their Preferences, NetSurf - defaults to a "portal" welcome page on http://www.netsurf-browser.org/ - if - you wish to change this, you can do so by editing NETSURF_HOMEPAGE in + defaults to a "portal" welcome page at about:netsurf - if you wish to + change this, you can do so by overriding the NETSURF_HOMEPAGE URL in Makefile.config. diff --git a/Makefile.defaults b/Makefile.defaults index 8995a7271..1fdb42552 100644 --- a/Makefile.defaults +++ b/Makefile.defaults @@ -86,7 +86,7 @@ NETSURF_UA_FORMAT_STRING := "NetSurf/%d.%d (%s; %s)" # option does not apply to the RISC OS version, as it has its own local # home page, and it can be changed by editing the end of gui_init2() in # riscos/gui.c -NETSURF_HOMEPAGE := "http://www.netsurf-browser.org/welcome/" +NETSURF_HOMEPAGE := "about:welcome" # Force using glibc internal iconv implementation instead of external libiconv # Valid options: YES, NO diff --git a/riscos/gui.c b/riscos/gui.c index 11f4e1df7..945f93770 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -761,13 +761,11 @@ static void gui_init2(int argc, char** argv) } /* default homepage */ else { - url = calloc(80, sizeof(char)); + url = strdup(NETSURF_HOMEPAGE); if (!url) { LOG(("malloc failed")); die("Insufficient memory for URL"); } - snprintf(url, 80, "file:////Docs/welcome/index_%s", - nsoption_charp(language)); } if (open_window) @@ -1825,14 +1823,11 @@ void ro_msg_dataopen(wimp_message *message) if (len < 9 || strcmp(".!NetSurf", message->data.data_xfer.file_name + len - 9)) return; - if (nsoption_charp(homepage_url) && nsoption_charp(homepage_url)[0]) { + if (nsoption_charp(homepage_url) && + nsoption_charp(homepage_url)[0]) { url = strdup(nsoption_charp(homepage_url)); } else { - url = malloc(80); - if (url) - snprintf(url, 80, - "file:////Docs/welcome/index_%s", - nsoption_charp(language)); + url = strdup(NETSURF_HOMEPAGE); } if (!url) warn_user("NoMemory", 0); diff --git a/riscos/iconbar.c b/riscos/iconbar.c index 9e3a050e1..0aa591a45 100644 --- a/riscos/iconbar.c +++ b/riscos/iconbar.c @@ -117,19 +117,16 @@ void ro_gui_iconbar_initialise(void) bool ro_gui_iconbar_click(wimp_pointer *pointer) { - char url[80]; int key_down = 0; switch (pointer->buttons) { case wimp_CLICK_SELECT: if (nsoption_charp(homepage_url) != NULL) { browser_window_create(nsoption_charp(homepage_url), - NULL, 0, true, false); + NULL, 0, true, false); } else { - snprintf(url, sizeof url, - "file:////Docs/welcome/index_%s", - nsoption_charp(language)); - browser_window_create(url, NULL, 0, true, false); + browser_window_create(NETSURF_HOMEPAGE, + NULL, 0, true, false); } break; diff --git a/riscos/window.c b/riscos/window.c index 78410ac6a..8287878fe 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -3882,18 +3882,13 @@ bool ro_gui_window_navigate_up(struct gui_window *g, const char *url) { void ro_gui_window_action_home(struct gui_window *g) { - char url[80]; - if (g == NULL || g->bw == NULL) return; if ((nsoption_charp(homepage_url)) && (nsoption_charp(homepage_url)[0])) { browser_window_go(g->bw, nsoption_charp(homepage_url), 0, true); } else { - snprintf(url, sizeof url, - "file:////Docs/welcome/index_%s", - nsoption_charp(language)); - browser_window_go(g->bw, url, 0, true); + browser_window_go(g->bw, NETSURF_HOMEPAGE, 0, true); } } -- cgit v1.2.3 From b412b93701b3e4327d1eed88ecc27b093c571f61 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 14:55:51 +0100 Subject: Use online docs. --- riscos/gui.c | 18 ------------------ riscos/gui.h | 1 - riscos/iconbar.c | 4 +++- riscos/window.c | 16 ++++++++++++---- 4 files changed, 15 insertions(+), 24 deletions(-) diff --git a/riscos/gui.c b/riscos/gui.c index 945f93770..e11679b82 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -2113,24 +2113,6 @@ void ro_gui_screen_size(int *width, int *height) } -/** - * Opens a language sensitive help page - * - * \param page the page to open - */ -void ro_gui_open_help_page(const char *page) -{ - char url[80]; - int length; - - if ((length = snprintf(url, sizeof url, - "file:////Docs/%s_%s", - page, nsoption_charp(language))) >= 0 && - length < (int)sizeof(url)) - browser_window_create(url, NULL, 0, true, false); -} - - /** * Send the source of a content to a text editor. */ diff --git a/riscos/gui.h b/riscos/gui.h index 14835274b..cd70a39a0 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -114,7 +114,6 @@ extern struct gui_window *ro_gui_current_redraw_gui; /* in gui.c */ void ro_gui_open_window_request(wimp_open *open); -void ro_gui_open_help_page(const char *page); void ro_gui_screen_size(int *width, int *height); void ro_gui_view_source(struct hlcache_handle *c); void ro_gui_dump_content(struct hlcache_handle *c); diff --git a/riscos/iconbar.c b/riscos/iconbar.c index 0aa591a45..24d8661cc 100644 --- a/riscos/iconbar.c +++ b/riscos/iconbar.c @@ -183,7 +183,9 @@ bool ro_gui_iconbar_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, switch (action) { case HELP_OPEN_CONTENTS: - ro_gui_open_help_page("documentation/index"); + browser_window_create( + "http://www.netsurf-browser.org/documentation/", + NULL, 0, true, false); return true; case BROWSER_NAVIGATE_URL: ro_gui_dialog_prepare_open_url(); diff --git a/riscos/window.c b/riscos/window.c index 8287878fe..deae43c25 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1917,7 +1917,9 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key, switch (c) { case IS_WIMP_KEY + wimp_KEY_F1: /* Help. */ - ro_gui_open_help_page("documentation/index"); + browser_window_create( + "http://www.netsurf-browser.org/documentation/", + NULL, 0, true, false); return true; case IS_WIMP_KEY + wimp_KEY_CONTROL + wimp_KEY_F1: @@ -2642,13 +2644,19 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, /* help actions */ case HELP_OPEN_CONTENTS: - ro_gui_open_help_page("documentation/index"); + browser_window_create( + "http://www.netsurf-browser.org/documentation/", + NULL, 0, true, false); break; case HELP_OPEN_GUIDE: - ro_gui_open_help_page("documentation/guide"); + browser_window_create( + "http://www.netsurf-browser.org/documentation/guide", + NULL, 0, true, false); break; case HELP_OPEN_INFORMATION: - ro_gui_open_help_page("documentation/info"); + browser_window_create( + "http://www.netsurf-browser.org/documentation/info", + NULL, 0, true, false); break; case HELP_OPEN_CREDITS: browser_window_create("about:credits", NULL, 0, true, false); -- cgit v1.2.3 From 9d3986e768b761e63f28c657de67c408ba0b9486 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 17:41:17 +0100 Subject: Avoid strcasecmp in form control creation node name handler. --- render/html.c | 9 +++++++++ render/html_forms.c | 26 ++++++++++++-------------- render/html_internal.h | 3 +++ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/render/html.c b/render/html.c index 8c5c76b8e..8dcd7a84c 100644 --- a/render/html.c +++ b/render/html.c @@ -113,6 +113,9 @@ dom_string *html_dom_string_coords; dom_string *html_dom_string_circle; dom_string *html_dom_string_poly; dom_string *html_dom_string_polygon; +dom_string *html_dom_string_button; +dom_string *html_dom_string_input; +dom_string *html_dom_string_textarea; static void html_destroy_objects(html_content *html) @@ -3140,6 +3143,9 @@ static void html_fini(void) HTML_DOM_STRING_UNREF(circle); HTML_DOM_STRING_UNREF(poly); HTML_DOM_STRING_UNREF(polygon); + HTML_DOM_STRING_UNREF(button); + HTML_DOM_STRING_UNREF(input); + HTML_DOM_STRING_UNREF(textarea); #undef HTML_DOM_STRING_UNREF @@ -3269,6 +3275,9 @@ nserror html_init(void) HTML_DOM_STRING_INTERN(circle); HTML_DOM_STRING_INTERN(poly); HTML_DOM_STRING_INTERN(polygon); + HTML_DOM_STRING_INTERN(button); + HTML_DOM_STRING_INTERN(input); + HTML_DOM_STRING_INTERN(textarea); #undef HTML_DOM_STRING_INTERN diff --git a/render/html_forms.c b/render/html_forms.c index c8b3c7fe6..5212b3ab8 100644 --- a/render/html_forms.c +++ b/render/html_forms.c @@ -416,7 +416,6 @@ struct form_control *html_forms_get_control_for_node(struct form *forms, dom_nod struct form_control *ctl = NULL; dom_exception err; dom_string *ds_name = NULL; - char *node_name = NULL; if (forms == NULL) return NULL; @@ -432,18 +431,18 @@ struct form_control *html_forms_get_control_for_node(struct form *forms, dom_nod /* Step two, extract the node's name so we can construct a gadget. */ err = dom_element_get_tag_name(node, &ds_name); if (err == DOM_NO_ERR && ds_name != NULL) { - node_name = strndup(dom_string_data(ds_name), - dom_string_byte_length(ds_name)); - } - - /* Step three, attempt to work out what gadget to make */ - if (node_name && strcasecmp(node_name, "button") == 0) - ctl = parse_button_element(forms, - (dom_html_button_element *) node); - else if (node_name && strcasecmp(node_name, "input") == 0) - ctl = parse_input_element(forms, - (dom_html_input_element *) node); + /* Step three, attempt to work out what gadget to make */ + if (dom_string_caseless_isequal(ds_name, + html_dom_string_button)) { + ctl = parse_button_element(forms, + (dom_html_button_element *) node); + } else if (dom_string_caseless_isequal(ds_name, + html_dom_string_input)) { + ctl = parse_input_element(forms, + (dom_html_input_element *) node); + } + } /* If all else fails, fake gadget time */ if (ctl == NULL) @@ -451,8 +450,7 @@ struct form_control *html_forms_get_control_for_node(struct form *forms, dom_nod if (ds_name != NULL) dom_string_unref(ds_name); - if (node_name != NULL) - free(node_name); + return ctl; } diff --git a/render/html_internal.h b/render/html_internal.h index ad032f720..a82d7c5c0 100644 --- a/render/html_internal.h +++ b/render/html_internal.h @@ -173,6 +173,9 @@ extern struct dom_string *html_dom_string_coords; extern struct dom_string *html_dom_string_circle; extern struct dom_string *html_dom_string_poly; extern struct dom_string *html_dom_string_polygon; +extern struct dom_string *html_dom_string_button; +extern struct dom_string *html_dom_string_input; +extern struct dom_string *html_dom_string_textarea; extern struct dom_string *html_dom_string_text_javascript; extern struct dom_string *html_dom_string_type; extern struct dom_string *html_dom_string_src; -- cgit v1.2.3 From 792dbe6e44cc1d3a78dfb62f99c001bc46131de7 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 18:16:04 +0100 Subject: Add textarea support back in. --- render/html_forms.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/render/html_forms.c b/render/html_forms.c index 5212b3ab8..5b917cde8 100644 --- a/render/html_forms.c +++ b/render/html_forms.c @@ -391,6 +391,52 @@ out: return control; } +static struct form_control * +parse_textarea_element(struct form *forms, dom_html_text_area_element *ta) +{ + struct form_control *control = NULL; + dom_html_form_element *form = NULL; + dom_string *ds_name = NULL; + + char *name = NULL; + + if (dom_html_text_area_element_get_form(ta, &form) != DOM_NO_ERR) + goto out; + + if (dom_html_text_area_element_get_name(ta, &ds_name) != DOM_NO_ERR) + goto out; + + if (ds_name != NULL) + name = strndup(dom_string_data(ds_name), + dom_string_byte_length(ds_name)); + + control = form_new_control(ta, GADGET_TEXTAREA); + + if (control == NULL) + goto out; + + if (name != NULL) { + /* Hand the name string over */ + control->name = name; + name = NULL; + } + + if (form != NULL && control != NULL) + form_add_control(find_form(forms, form), control); + +out: + if (form != NULL) + dom_node_unref(form); + if (ds_name != NULL) + dom_string_unref(ds_name); + + if (name != NULL) + free(name); + + + return control; +} + static struct form_control * invent_fake_gadget(dom_node *node) { @@ -441,6 +487,10 @@ struct form_control *html_forms_get_control_for_node(struct form *forms, dom_nod html_dom_string_input)) { ctl = parse_input_element(forms, (dom_html_input_element *) node); + } else if (dom_string_caseless_isequal(ds_name, + html_dom_string_textarea)) { + ctl = parse_textarea_element(forms, + (dom_html_text_area_element *) node); } } -- cgit v1.2.3 From 699e2e65e64af30b73d44aa5aa107de5a4a10d74 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 21 Jul 2012 18:50:04 +0100 Subject: Remove favicon and fix logo URL in non-en welcome pages. --- !NetSurf/Resources/de/welcome.html,faf | 3 +-- !NetSurf/Resources/en/welcome.html,faf | 1 - !NetSurf/Resources/it/welcome.html,faf | 3 +-- !NetSurf/Resources/ja/welcome.html,faf | 3 +-- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/!NetSurf/Resources/de/welcome.html,faf b/!NetSurf/Resources/de/welcome.html,faf index 975a67b0a..fbbed0399 100644 --- a/!NetSurf/Resources/de/welcome.html,faf +++ b/!NetSurf/Resources/de/welcome.html,faf @@ -3,11 +3,10 @@ Welcome to NetSurf - -

NetSurf

+

NetSurf