diff options
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; +} + |