Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/45736594a173d7a715b217a5236e33fb89c95436
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/45736594a173d7a715b217a5236e33fb89c95436
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/45736594a173d7a715b217a5236e33fb89c95436

The branch, master has been updated
       via  45736594a173d7a715b217a5236e33fb89c95436 (commit)
       via  b1342796448c01515d8dcb4d992f804a5f2f4fb4 (commit)
      from  74a9ec6de4e4180a1279633de6a4611e57ef2995 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/45736594a173d7a715b217a5236e33fb89c95436
commit 45736594a173d7a715b217a5236e33fb89c95436
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Get presence of text input cleanly.

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 8354830..8ecc4ef 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -20,7 +20,6 @@
 #include "desktop/plotters.h"
 #include "desktop/selection.h"
 #include "desktop/textinput.h"
-#include "render/box.h"
 #include "utils/utf8.h"
 
 #include "amiga/bitmap.h"
@@ -345,7 +344,6 @@ struct ami_text_selection *ami_selection_to_text(struct 
gui_window_2 *gwin)
 
 void ami_drag_selection(struct selection *s)
 {
-       struct box *text_box;
        int x;
        int y;
        char *utf8text;
@@ -362,7 +360,7 @@ void ami_drag_selection(struct selection *s)
        x = gwin->win->MouseX;
        y = gwin->win->MouseY;
 
-       if(text_box = ami_text_box_at_point(gwin, (ULONG *)&x, (ULONG *)&y))
+       if(ami_text_box_at_point(gwin, (ULONG *)&x, (ULONG *)&y))
        {
                iffh = ami_clipboard_init_internal(1);
 
diff --git a/amiga/gui.c b/amiga/gui.c
index 8aef21a..bbbb3ba 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -30,9 +30,6 @@
 #include "desktop/textinput.h"
 #include "desktop/tree.h"
 #include "image/ico.h"
-#include "render/box.h"
-#include "render/form.h"
-#include "render/html.h"
 #include "utils/log.h"
 #include "utils/messages.h"
 #include "utils/utf8.h"
@@ -4113,17 +4110,12 @@ void ami_scroller_hook(struct Hook *hook,Object 
*object,struct IntuiMessage *msg
 /* return the text box at posn x,y in window coordinates
    x,y are updated to be document co-ordinates */
 
-struct box *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG 
*y)
+bool *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y)
 {
        struct IBox *bbox;
        ULONG xs,ys,width,height;
-       struct box *box,*text_box=0;
-       hlcache_handle *content;
        int box_x=0,box_y=0;
-
-       content = gwin->bw->current_content;
-
-       if(content_get_type(content) != CONTENT_HTML) return NULL;
+       struct contextual_content data;
 
        GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER],
                                (ULONG *)&bbox);
@@ -4137,27 +4129,12 @@ struct box *ami_text_box_at_point(struct gui_window_2 
*gwin, ULONG *x, ULONG *y)
        width=bbox->Width;
        height=bbox->Height;
 
-       box = html_get_box_tree(content);
-       while ((box = box_at_point(box, *x, *y, &box_x, &box_y, &content)))
-       {
-               if (box->style && css_computed_visibility(box->style) == 
CSS_VISIBILITY_HIDDEN) continue;
+       browser_window_get_contextual_content(gwin->bw, x, y, &data);
 
-               if (box->gadget)
-               {
-                       switch (box->gadget->type)
-                       {
-                               case GADGET_TEXTBOX:
-                               case GADGET_TEXTAREA:
-                               case GADGET_PASSWORD:
-                                       text_box = box;
-                               break;
+       if (data.form_features == CTX_FORM_TEXT)
+               return true;
 
-                               default:
-                               break;
-                       }
-               }
-       }
-       return text_box;
+       return false;
 }
 
 BOOL ami_gadget_hit(Object *obj, int x, int y)
diff --git a/amiga/gui.h b/amiga/gui.h
index 013be50..498e270 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -143,7 +143,7 @@ void ami_do_redraw_limits(struct gui_window *g, struct 
browser_window *bw,
                int x0, int y0, int x1, int y1);
 STRPTR ami_locale_langs(void);
 int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie);
-struct box *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG 
*y);
+bool *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y);
 BOOL ami_gadget_hit(Object *obj, int x, int y);
 void ami_gui_history(struct gui_window_2 *gwin, bool back);
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commitdiff/b1342796448c01515d8dcb4d992f804a5f2f4fb4
commit b1342796448c01515d8dcb4d992f804a5f2f4fb4
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Allow the presence of form inputs to be obtained without knowledge of html 
content internals.

diff --git a/desktop/browser.c b/desktop/browser.c
index a33bbff..42acc34 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -549,6 +549,7 @@ void browser_window_get_contextual_content(struct 
browser_window *bw,
        data->link_url = NULL;
        data->object = NULL;
        data->main = NULL;
+       data->form_features = CTX_FORM_NONE;
 
        browser_window__get_contextual_content(bw, x, y, data);
 }
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 84c20ee..7973cc7 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -162,7 +162,8 @@ nsgtk_scaffolding *scaf_list = NULL;
 
 /** holds the context data for what's under the pointer, when the contextual
  *  menu is opened. */
-static struct contextual_content current_menu_ctx = { NULL, NULL, NULL };
+static struct contextual_content current_menu_ctx = {
+               NULL, NULL, NULL, CTX_FORM_NONE };
 
 
 /**
diff --git a/render/html.c b/render/html.c
index 17ca801..8d64fdf 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2670,6 +2670,23 @@ html_get_contextual_content(struct content *c,
                                        box->usemap, box_x, box_y, x, y,
                                        &target));
                }
+               if (box->gadget) {
+                       switch (box->gadget->type) {
+                       case GADGET_TEXTBOX:
+                       case GADGET_TEXTAREA:
+                       case GADGET_PASSWORD:
+                               data->form_features = CTX_FORM_TEXT;
+                               break;
+
+                       case GADGET_FILE:
+                               data->form_features = CTX_FORM_FILE;
+                               break;
+
+                       default:
+                               data->form_features = CTX_FORM_NONE;
+                               break;
+                       }
+               }
        }
 }
 
diff --git a/utils/types.h b/utils/types.h
index 3500968..617b493 100644
--- a/utils/types.h
+++ b/utils/types.h
@@ -52,6 +52,11 @@ struct contextual_content {
        const char *link_url;
        struct hlcache_handle *object;
        struct hlcache_handle *main;
+       enum {
+               CTX_FORM_NONE,
+               CTX_FORM_TEXT,
+               CTX_FORM_FILE
+       } form_features;
 };
 
 #endif


-----------------------------------------------------------------------

Summary of changes:
 amiga/clipboard.c |    4 +---
 amiga/gui.c       |   35 ++++++-----------------------------
 amiga/gui.h       |    2 +-
 desktop/browser.c |    1 +
 gtk/scaffolding.c |    3 ++-
 render/html.c     |   17 +++++++++++++++++
 utils/types.h     |    5 +++++
 7 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 8354830..8ecc4ef 100755
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -20,7 +20,6 @@
 #include "desktop/plotters.h"
 #include "desktop/selection.h"
 #include "desktop/textinput.h"
-#include "render/box.h"
 #include "utils/utf8.h"
 
 #include "amiga/bitmap.h"
@@ -345,7 +344,6 @@ struct ami_text_selection *ami_selection_to_text(struct 
gui_window_2 *gwin)
 
 void ami_drag_selection(struct selection *s)
 {
-       struct box *text_box;
        int x;
        int y;
        char *utf8text;
@@ -362,7 +360,7 @@ void ami_drag_selection(struct selection *s)
        x = gwin->win->MouseX;
        y = gwin->win->MouseY;
 
-       if(text_box = ami_text_box_at_point(gwin, (ULONG *)&x, (ULONG *)&y))
+       if(ami_text_box_at_point(gwin, (ULONG *)&x, (ULONG *)&y))
        {
                iffh = ami_clipboard_init_internal(1);
 
diff --git a/amiga/gui.c b/amiga/gui.c
index 8aef21a..bbbb3ba 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -30,9 +30,6 @@
 #include "desktop/textinput.h"
 #include "desktop/tree.h"
 #include "image/ico.h"
-#include "render/box.h"
-#include "render/form.h"
-#include "render/html.h"
 #include "utils/log.h"
 #include "utils/messages.h"
 #include "utils/utf8.h"
@@ -4113,17 +4110,12 @@ void ami_scroller_hook(struct Hook *hook,Object 
*object,struct IntuiMessage *msg
 /* return the text box at posn x,y in window coordinates
    x,y are updated to be document co-ordinates */
 
-struct box *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG 
*y)
+bool *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y)
 {
        struct IBox *bbox;
        ULONG xs,ys,width,height;
-       struct box *box,*text_box=0;
-       hlcache_handle *content;
        int box_x=0,box_y=0;
-
-       content = gwin->bw->current_content;
-
-       if(content_get_type(content) != CONTENT_HTML) return NULL;
+       struct contextual_content data;
 
        GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER],
                                (ULONG *)&bbox);
@@ -4137,27 +4129,12 @@ struct box *ami_text_box_at_point(struct gui_window_2 
*gwin, ULONG *x, ULONG *y)
        width=bbox->Width;
        height=bbox->Height;
 
-       box = html_get_box_tree(content);
-       while ((box = box_at_point(box, *x, *y, &box_x, &box_y, &content)))
-       {
-               if (box->style && css_computed_visibility(box->style) == 
CSS_VISIBILITY_HIDDEN) continue;
+       browser_window_get_contextual_content(gwin->bw, x, y, &data);
 
-               if (box->gadget)
-               {
-                       switch (box->gadget->type)
-                       {
-                               case GADGET_TEXTBOX:
-                               case GADGET_TEXTAREA:
-                               case GADGET_PASSWORD:
-                                       text_box = box;
-                               break;
+       if (data.form_features == CTX_FORM_TEXT)
+               return true;
 
-                               default:
-                               break;
-                       }
-               }
-       }
-       return text_box;
+       return false;
 }
 
 BOOL ami_gadget_hit(Object *obj, int x, int y)
diff --git a/amiga/gui.h b/amiga/gui.h
index 013be50..498e270 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -143,7 +143,7 @@ void ami_do_redraw_limits(struct gui_window *g, struct 
browser_window *bw,
                int x0, int y0, int x1, int y1);
 STRPTR ami_locale_langs(void);
 int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie);
-struct box *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG 
*y);
+bool *ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y);
 BOOL ami_gadget_hit(Object *obj, int x, int y);
 void ami_gui_history(struct gui_window_2 *gwin, bool back);
 
diff --git a/desktop/browser.c b/desktop/browser.c
index a33bbff..42acc34 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -549,6 +549,7 @@ void browser_window_get_contextual_content(struct 
browser_window *bw,
        data->link_url = NULL;
        data->object = NULL;
        data->main = NULL;
+       data->form_features = CTX_FORM_NONE;
 
        browser_window__get_contextual_content(bw, x, y, data);
 }
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index 84c20ee..7973cc7 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -162,7 +162,8 @@ nsgtk_scaffolding *scaf_list = NULL;
 
 /** holds the context data for what's under the pointer, when the contextual
  *  menu is opened. */
-static struct contextual_content current_menu_ctx = { NULL, NULL, NULL };
+static struct contextual_content current_menu_ctx = {
+               NULL, NULL, NULL, CTX_FORM_NONE };
 
 
 /**
diff --git a/render/html.c b/render/html.c
index 17ca801..8d64fdf 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2670,6 +2670,23 @@ html_get_contextual_content(struct content *c,
                                        box->usemap, box_x, box_y, x, y,
                                        &target));
                }
+               if (box->gadget) {
+                       switch (box->gadget->type) {
+                       case GADGET_TEXTBOX:
+                       case GADGET_TEXTAREA:
+                       case GADGET_PASSWORD:
+                               data->form_features = CTX_FORM_TEXT;
+                               break;
+
+                       case GADGET_FILE:
+                               data->form_features = CTX_FORM_FILE;
+                               break;
+
+                       default:
+                               data->form_features = CTX_FORM_NONE;
+                               break;
+                       }
+               }
        }
 }
 
diff --git a/utils/types.h b/utils/types.h
index 3500968..617b493 100644
--- a/utils/types.h
+++ b/utils/types.h
@@ -52,6 +52,11 @@ struct contextual_content {
        const char *link_url;
        struct hlcache_handle *object;
        struct hlcache_handle *main;
+       enum {
+               CTX_FORM_NONE,
+               CTX_FORM_TEXT,
+               CTX_FORM_FILE
+       } form_features;
 };
 
 #endif


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to