mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-23 02:42:11 +03:00
Fix crash when top-level content is not HTML and there is a fragment identifier in the URL.
Constify. svn path=/trunk/netsurf/; revision=10881
This commit is contained in:
parent
01c8552489
commit
d4d866c43f
@ -2220,14 +2220,16 @@ hlcache_handle *html_get_favicon(hlcache_handle *h)
|
||||
* \param y Updated to global y coord iff id found
|
||||
* \return true iff id found
|
||||
*/
|
||||
bool html_get_id_offset(hlcache_handle *h, char *frag_id, int *x, int *y)
|
||||
bool html_get_id_offset(hlcache_handle *h, const char *frag_id, int *x, int *y)
|
||||
{
|
||||
struct box *pos;
|
||||
struct box *layout = html_get_box_tree(h);
|
||||
struct box *layout;
|
||||
|
||||
if (content_get_type(h) != CONTENT_HTML)
|
||||
return false;
|
||||
|
||||
layout = html_get_box_tree(h);
|
||||
|
||||
if ((pos = box_find_by_id(layout, frag_id)) != 0) {
|
||||
box_coords(pos, x, y);
|
||||
return true;
|
||||
|
@ -247,7 +247,7 @@ struct html_stylesheet *html_get_stylesheets(struct hlcache_handle *h,
|
||||
struct content_html_object *html_get_objects(struct hlcache_handle *h,
|
||||
unsigned int *n);
|
||||
struct hlcache_handle *html_get_favicon(struct hlcache_handle *h);
|
||||
bool html_get_id_offset(struct hlcache_handle *h, char *frag_id,
|
||||
bool html_get_id_offset(struct hlcache_handle *h, const char *frag_id,
|
||||
int *x, int *y);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user