diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-07-13 13:20:26 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-07-13 13:20:26 +0000 |
commit | 9c918930289b18dbfd4bb44081891d5780105bfd (patch) | |
tree | 372de7dbf3d8393550e46ab1f8de6e9a97cf2140 /content | |
parent | 1832155b7c64e0a977541930fc78f47bbd675ab2 (diff) | |
download | netsurf-9c918930289b18dbfd4bb44081891d5780105bfd.tar.gz netsurf-9c918930289b18dbfd4bb44081891d5780105bfd.tar.bz2 |
Fix selection for non-gui browser windows (iframes).
Selection no longer uses current_redraw_browser.
Fix long-standing selection bugs on platforms that use action on release behaviour.
svn path=/trunk/netsurf/; revision=12598
Diffstat (limited to 'content')
-rw-r--r-- | content/content.c | 16 | ||||
-rw-r--r-- | content/content.h | 1 | ||||
-rw-r--r-- | content/content_protected.h | 1 |
3 files changed, 18 insertions, 0 deletions
diff --git a/content/content.c b/content/content.c index 1f7003404..c3f8d7855 100644 --- a/content/content.c +++ b/content/content.c @@ -676,6 +676,22 @@ void content_close(hlcache_handle *h) } +/** + * Find this content's selection context, if it has one. + */ + +struct selection *content_get_selection(hlcache_handle *h) +{ + struct content *c = hlcache_handle_get_content(h); + assert(c != 0); + + if (c->handler->get_selection != NULL) + return c->handler->get_selection(c); + else + return NULL; +} + + void content_add_error(struct content *c, const char *token, unsigned int line) { diff --git a/content/content.h b/content/content.h index ca267060c..40e7f2089 100644 --- a/content/content.h +++ b/content/content.h @@ -157,6 +157,7 @@ void content_open(struct hlcache_handle *h, struct browser_window *bw, struct content *page, struct box *box, struct object_params *params); void content_close(struct hlcache_handle *h); +struct selection *content_get_selection(struct hlcache_handle *h); /* Member accessors */ content_type content_get_type(struct hlcache_handle *c); diff --git a/content/content_protected.h b/content/content_protected.h index bc2079017..4fe9b942a 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -64,6 +64,7 @@ struct content_handler { struct box *box, struct object_params *params); void (*close)(struct content *c); + struct selection * (*get_selection)(struct content *c); nserror (*clone)(const struct content *old, struct content **newc); bool (*matches_quirks)(const struct content *c, bool quirks); content_type (*type)(lwc_string *mime_type); |