Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/f67a1ab4cf3fc59bc9314623a6fbf41f7772d7bd
...commit
http://git.netsurf-browser.org/netsurf.git/commit/f67a1ab4cf3fc59bc9314623a6fbf41f7772d7bd
...tree
http://git.netsurf-browser.org/netsurf.git/tree/f67a1ab4cf3fc59bc9314623a6fbf41f7772d7bd
The branch, master has been updated
via f67a1ab4cf3fc59bc9314623a6fbf41f7772d7bd (commit)
from 45736594a173d7a715b217a5236e33fb89c95436 (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/f67a1ab4cf3fc59bc9314623a6fbf41f7772d7bd
commit f67a1ab4cf3fc59bc9314623a6fbf41f7772d7bd
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Avoid box_at_point.
diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c
index 25b3c84..2230e00 100644
--- a/atari/ctxmenu.c
+++ b/atari/ctxmenu.c
@@ -32,11 +32,8 @@
#include "desktop/textinput.h"
#include "content/content.h"
#include "content/hlcache.h"
-#include "content/urldb.h"
-#include "render/html.h"
+#include "content/urldb.h"
#include "css/css.h"
-#include "render/box.h"
-#include "render/form.h"
#include "utils/log.h"
#include "utils/messages.h"
@@ -68,12 +65,10 @@ struct s_context_info ctxinfo;
static struct s_context_info * get_context_info( struct gui_window * gw, short
mx, short my )
{
- struct box *box;
hlcache_handle *h;
- int box_x, box_y;
LGRECT bwrect;
struct contextual_content ccdata;
- struct browser_window * bw = gw->browser->bw;
+ struct browser_window * bw = gw->browser->bw;
h = bw->current_content;
ctxinfo.flags = 0;
@@ -107,31 +102,8 @@ static struct s_context_info * get_context_info( struct
gui_window * gw, short m
ctxinfo.flags |= CNT_IMG;
}
}
-
- box = html_get_box_tree(h);
- box_x = box->margin[LEFT];
- box_y = box->margin[TOP];
-
- while ((box = box_at_point(box, mx+gw->browser->scroll.current.x,
my+gw->browser->scroll.current.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_TEXTBOX:
- case GADGET_TEXTAREA:
- case GADGET_PASSWORD:
- // TODO: check if there is really an
selection, but it
- // doesn't hurt for now...:
- ctxinfo.flags |= (CNT_INTERACTIVE |
CNT_SELECTION);
- break;
-
- default: break;
- }
- }
- }
+ if ( ctxinfo.ccdata.form_features == CTX_FORM_TEXT )
+ ctxinfo.flags |= (CNT_INTERACTIVE | CNT_SELECTION);
return( &ctxinfo );
}
@@ -259,7 +231,7 @@ void context_popup( struct gui_window * gw, short x, short
y )
case POP_CTX_VIEW_SOURCE:
editor = nsoption_charp(atari_editor);
if (editor != NULL && strlen(editor)>0) {
- data =
content_get_source_data(gw->browser->bw->current_content,
+ data =
content_get_source_data(gw->browser->bw->current_content,
&size);
if (size > 0 && data != NULL){
tempfile = tmpnam( NULL );
-----------------------------------------------------------------------
Summary of changes:
atari/ctxmenu.c | 38 +++++---------------------------------
1 files changed, 5 insertions(+), 33 deletions(-)
diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c
index 25b3c84..2230e00 100644
--- a/atari/ctxmenu.c
+++ b/atari/ctxmenu.c
@@ -32,11 +32,8 @@
#include "desktop/textinput.h"
#include "content/content.h"
#include "content/hlcache.h"
-#include "content/urldb.h"
-#include "render/html.h"
+#include "content/urldb.h"
#include "css/css.h"
-#include "render/box.h"
-#include "render/form.h"
#include "utils/log.h"
#include "utils/messages.h"
@@ -68,12 +65,10 @@ struct s_context_info ctxinfo;
static struct s_context_info * get_context_info( struct gui_window * gw, short
mx, short my )
{
- struct box *box;
hlcache_handle *h;
- int box_x, box_y;
LGRECT bwrect;
struct contextual_content ccdata;
- struct browser_window * bw = gw->browser->bw;
+ struct browser_window * bw = gw->browser->bw;
h = bw->current_content;
ctxinfo.flags = 0;
@@ -107,31 +102,8 @@ static struct s_context_info * get_context_info( struct
gui_window * gw, short m
ctxinfo.flags |= CNT_IMG;
}
}
-
- box = html_get_box_tree(h);
- box_x = box->margin[LEFT];
- box_y = box->margin[TOP];
-
- while ((box = box_at_point(box, mx+gw->browser->scroll.current.x,
my+gw->browser->scroll.current.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_TEXTBOX:
- case GADGET_TEXTAREA:
- case GADGET_PASSWORD:
- // TODO: check if there is really an
selection, but it
- // doesn't hurt for now...:
- ctxinfo.flags |= (CNT_INTERACTIVE |
CNT_SELECTION);
- break;
-
- default: break;
- }
- }
- }
+ if ( ctxinfo.ccdata.form_features == CTX_FORM_TEXT )
+ ctxinfo.flags |= (CNT_INTERACTIVE | CNT_SELECTION);
return( &ctxinfo );
}
@@ -259,7 +231,7 @@ void context_popup( struct gui_window * gw, short x, short
y )
case POP_CTX_VIEW_SOURCE:
editor = nsoption_charp(atari_editor);
if (editor != NULL && strlen(editor)>0) {
- data =
content_get_source_data(gw->browser->bw->current_content,
+ data =
content_get_source_data(gw->browser->bw->current_content,
&size);
if (size > 0 && data != NULL){
tempfile = tmpnam( NULL );
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org