diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-07-26 13:53:42 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-07-26 13:53:42 +0000 |
commit | 16b92d1613e245919743be5f168abe77712ec84b (patch) | |
tree | 5f2516ecf29989bd4fffeb56ef6b4a02410ec8c1 /render/html.c | |
parent | d97e99b02b40114c584661541805704006ffefee (diff) | |
download | netsurf-16b92d1613e245919743be5f168abe77712ec84b.tar.gz netsurf-16b92d1613e245919743be5f168abe77712ec84b.tar.bz2 |
Selection is now subordinate to html and text content types, and disassociated from browser windows. Note: search currently uses hlcache_handle_get_content() to go from bw to h to get at c for search highlighting via selection.
svn path=/trunk/netsurf/; revision=12626
Diffstat (limited to 'render/html.c')
-rw-r--r-- | render/html.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/render/html.c b/render/html.c index 5284f53c2..00db1e541 100644 --- a/render/html.c +++ b/render/html.c @@ -258,7 +258,7 @@ nserror html_create_html_data(html_content *c, const http_parameter *params) c->font_func = &nsfont; c->scrollbar = NULL; - selection_prepare(&c->sel); + selection_prepare(&c->sel, (struct content *)c, true); nerror = http_parameter_list_find_item(params, html_charset, &charset); if (nerror == NSERROR_OK) { @@ -2040,7 +2040,6 @@ void html_open(struct content *c, struct browser_window *bw, /* text selection */ selection_init(&html->sel, html->layout); - selection_set_browser_window(&html->sel, bw); for (object = html->object_list; object != NULL; object = next) { next = object->next; @@ -2068,8 +2067,6 @@ void html_close(struct content *c) html_content *html = (html_content *) c; struct content_html_object *object, *next; - selection_set_browser_window(&html->sel, NULL); - html->bw = NULL; for (object = html->object_list; object != NULL; object = next) { @@ -2367,3 +2364,19 @@ content_type html_content_type(lwc_string *mime_type) return CONTENT_HTML; } +/** + * Get the browser window containing an HTML content + * + * \param c HTML content + * \return the browser window + */ +struct browser_window *html_get_browser_window(struct content *c) +{ + html_content *html = (html_content *) c; + + assert(c != NULL); + assert(c->handler == &html_content_handler); + + return html->bw; +} + |