diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2019-08-05 21:14:27 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2019-08-05 21:15:28 +0100 |
commit | be23d522db03f412bc9a855aac7598419336d4f1 (patch) | |
tree | c0e2c801616be9d302841518d85620e4281bb470 /content | |
parent | 170dc5d52419450edc440c054a94135c1cc1296a (diff) | |
download | netsurf-be23d522db03f412bc9a855aac7598419336d4f1.tar.gz netsurf-be23d522db03f412bc9a855aac7598419336d4f1.tar.bz2 |
HTML: Box coordinates: Take fast route to float container.
And assert that floats have a float_container.
Diffstat (limited to 'content')
-rw-r--r-- | content/handlers/html/box.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content/handlers/html/box.c b/content/handlers/html/box.c index d9e649558..30cb4e2a0 100644 --- a/content/handlers/html/box.c +++ b/content/handlers/html/box.c @@ -307,11 +307,11 @@ void box_coords(struct box *box, int *x, int *y) *y = box->y; while (box->parent) { if (box_is_float(box)) { - do { - box = box->parent; - } while (!box->float_children); - } else + assert(box->float_container); + box = box->float_container; + } else { box = box->parent; + } *x += box->x - scrollbar_get_offset(box->scroll_x); *y += box->y - scrollbar_get_offset(box->scroll_y); } |