Gitweb links:

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

The branch, master has been updated
       via  d2a1c8506318208b7e7962332567d3285c54d01f (commit)
       via  a4f796e217373daa0498b85ed8f231d1a194daa4 (commit)
       via  7d4af30468b3d217f6a9ba2c01483329db94a367 (commit)
      from  a39082585ae833a6cabd864038e9926ac765e850 (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/d2a1c8506318208b7e7962332567d3285c54d01f
commit d2a1c8506318208b7e7962332567d3285c54d01f
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>

    Avoid box_at_point.

diff --git a/riscos/save.c b/riscos/save.c
index b1331d0..b9dbe51 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -627,41 +627,8 @@ void ro_gui_save_drag_end(wimp_dragged *drag)
                g = ro_gui_window_lookup(gui_save_sourcew);
 
                if (g && ro_gui_window_to_window_pos(g, dx, dy, &pos)) {
-                       hlcache_handle *h = g->bw->current_content;
-
-                       if (h && content_get_type(h) == CONTENT_HTML) {
-                               struct box *box = html_get_box_tree(h);
-                               int box_x, box_y;
-
-                               /* Consider the margins of the html page now */
-                               box_x = box->margin[LEFT];
-                               box_y = box->margin[TOP];
-
-                               while (!dest_ok && (box = box_at_point(box,
-                                               pos.x, pos.y, &box_x, &box_y,
-                                               &h))) {
-                                       if (box->style &&
-                                                       css_computed_visibility(
-                                                               box->style) ==
-                                                       CSS_VISIBILITY_HIDDEN)
-                                               continue;
-
-                                       if (box->gadget) {
-                                               switch (box->gadget->type) {
-                                               case GADGET_FILE:
-                                               case GADGET_TEXTBOX:
-                                               case GADGET_TEXTAREA:
-                                               case GADGET_PASSWORD:
-                                                       dest_ok = true;
-                                                       break;
-
-                                               default:
-                                                       /* appease compiler */
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
+                       dest_ok = browser_window_drop_file_at_point(g->bw,
+                                       pos.x, pos.y, NULL);
                }
                if (!dest_ok) {
                        /* cancel the drag operation */


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

    Let *_drop_file_at_point determine if a drop is possible.

diff --git a/desktop/browser.h b/desktop/browser.h
index 489a7ed..306124d 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -269,13 +269,14 @@ bool browser_window_scroll_at_point(struct browser_window 
*bw,
                int x, int y, int scrx, int scry);
 
 /**
- * Drop a file onto a browser window at a particular point.
+ * Drop a file onto a browser window at a particular point, or determine if a
+ * file may be dropped onto the content at given point.
  *
  * \param bw   browser window to look inside
  * \param x    x-coordinate of point of interest
  * \param y    y-coordinate of point of interest
- * \param file path to file to be dropped
- * \return true iff file drop has been handled
+ * \param file path to file to be dropped, or NULL to know if drop allowed
+ * \return true iff file drop has been handled, or if drop possible (NULL file)
  */
 bool browser_window_drop_file_at_point(struct browser_window *bw,
                int x, int y, char *file);
diff --git a/render/html.c b/render/html.c
index db9e208..2974497 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2731,13 +2731,14 @@ html_scroll_at_point(struct content *c, int x, int y, 
int scrx, int scry)
 
 
 /**
- * Drop a file onto a content at a particular point.
+ * Drop a file onto a content at a particular point, or determine if a file
+ * may be dropped onto the content at given point.
  *
  * \param c    html content to look inside
  * \param x    x-coordinate of point of interest
  * \param y    y-coordinate of point of interest
- * \param file path to file to be dropped
- * \return true iff file drop has been handled
+ * \param file path to file to be dropped, or NULL to know if drop allowed
+ * \return true iff file drop has been handled, or if drop possible (NULL file)
  */
 static bool html_drop_file_at_point(struct content *c, int x, int y, char 
*file)
 {
@@ -2785,6 +2786,10 @@ static bool html_drop_file_at_point(struct content *c, 
int x, int y, char *file)
                /* No box capable of handling drop */
                return false;
 
+       if (file == NULL)
+               /* There is a box capable of handling drop here */
+               return true;
+
        /* Handle the drop */
        if (file_box) {
                /* File dropped on file input */


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

    Minor style change.

diff --git a/riscos/save.c b/riscos/save.c
index f5f4f8e..b1331d0 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -648,15 +648,16 @@ void ro_gui_save_drag_end(wimp_dragged *drag)
 
                                        if (box->gadget) {
                                                switch (box->gadget->type) {
-                                                       case GADGET_FILE:
-                                                       case GADGET_TEXTBOX:
-                                                       case GADGET_TEXTAREA:
-                                                       case GADGET_PASSWORD:
-                                                               dest_ok = true;
-                                                               break;
-
-                                                       default:        /* 
appease compiler */
-                                                               break;
+                                               case GADGET_FILE:
+                                               case GADGET_TEXTBOX:
+                                               case GADGET_TEXTAREA:
+                                               case GADGET_PASSWORD:
+                                                       dest_ok = true;
+                                                       break;
+
+                                               default:
+                                                       /* appease compiler */
+                                                       break;
                                                }
                                        }
                                }


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

Summary of changes:
 desktop/browser.h |    7 ++++---
 render/html.c     |   11 ++++++++---
 riscos/save.c     |   36 ++----------------------------------
 3 files changed, 14 insertions(+), 40 deletions(-)

diff --git a/desktop/browser.h b/desktop/browser.h
index 489a7ed..306124d 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -269,13 +269,14 @@ bool browser_window_scroll_at_point(struct browser_window 
*bw,
                int x, int y, int scrx, int scry);
 
 /**
- * Drop a file onto a browser window at a particular point.
+ * Drop a file onto a browser window at a particular point, or determine if a
+ * file may be dropped onto the content at given point.
  *
  * \param bw   browser window to look inside
  * \param x    x-coordinate of point of interest
  * \param y    y-coordinate of point of interest
- * \param file path to file to be dropped
- * \return true iff file drop has been handled
+ * \param file path to file to be dropped, or NULL to know if drop allowed
+ * \return true iff file drop has been handled, or if drop possible (NULL file)
  */
 bool browser_window_drop_file_at_point(struct browser_window *bw,
                int x, int y, char *file);
diff --git a/render/html.c b/render/html.c
index db9e208..2974497 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2731,13 +2731,14 @@ html_scroll_at_point(struct content *c, int x, int y, 
int scrx, int scry)
 
 
 /**
- * Drop a file onto a content at a particular point.
+ * Drop a file onto a content at a particular point, or determine if a file
+ * may be dropped onto the content at given point.
  *
  * \param c    html content to look inside
  * \param x    x-coordinate of point of interest
  * \param y    y-coordinate of point of interest
- * \param file path to file to be dropped
- * \return true iff file drop has been handled
+ * \param file path to file to be dropped, or NULL to know if drop allowed
+ * \return true iff file drop has been handled, or if drop possible (NULL file)
  */
 static bool html_drop_file_at_point(struct content *c, int x, int y, char 
*file)
 {
@@ -2785,6 +2786,10 @@ static bool html_drop_file_at_point(struct content *c, 
int x, int y, char *file)
                /* No box capable of handling drop */
                return false;
 
+       if (file == NULL)
+               /* There is a box capable of handling drop here */
+               return true;
+
        /* Handle the drop */
        if (file_box) {
                /* File dropped on file input */
diff --git a/riscos/save.c b/riscos/save.c
index f5f4f8e..b9dbe51 100644
--- a/riscos/save.c
+++ b/riscos/save.c
@@ -627,40 +627,8 @@ void ro_gui_save_drag_end(wimp_dragged *drag)
                g = ro_gui_window_lookup(gui_save_sourcew);
 
                if (g && ro_gui_window_to_window_pos(g, dx, dy, &pos)) {
-                       hlcache_handle *h = g->bw->current_content;
-
-                       if (h && content_get_type(h) == CONTENT_HTML) {
-                               struct box *box = html_get_box_tree(h);
-                               int box_x, box_y;
-
-                               /* Consider the margins of the html page now */
-                               box_x = box->margin[LEFT];
-                               box_y = box->margin[TOP];
-
-                               while (!dest_ok && (box = box_at_point(box,
-                                               pos.x, pos.y, &box_x, &box_y,
-                                               &h))) {
-                                       if (box->style &&
-                                                       css_computed_visibility(
-                                                               box->style) ==
-                                                       CSS_VISIBILITY_HIDDEN)
-                                               continue;
-
-                                       if (box->gadget) {
-                                               switch (box->gadget->type) {
-                                                       case GADGET_FILE:
-                                                       case GADGET_TEXTBOX:
-                                                       case GADGET_TEXTAREA:
-                                                       case GADGET_PASSWORD:
-                                                               dest_ok = true;
-                                                               break;
-
-                                                       default:        /* 
appease compiler */
-                                                               break;
-                                               }
-                                       }
-                               }
-                       }
+                       dest_ok = browser_window_drop_file_at_point(g->bw,
+                                       pos.x, pos.y, NULL);
                }
                if (!dest_ok) {
                        /* cancel the drag operation */


-- 
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