diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-01-05 19:36:05 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-01-05 19:36:05 +0000 |
commit | 08ed4c207f7f8688075c84e4b3cd5ab73470c246 (patch) | |
tree | 90f517c899a05a61c64fca95746505ed94539266 /render/box.c | |
parent | 027726c4324663f391f070a759b5c730fc04dfe7 (diff) | |
download | netsurf-08ed4c207f7f8688075c84e4b3cd5ab73470c246.tar.gz netsurf-08ed4c207f7f8688075c84e4b3cd5ab73470c246.tar.bz2 |
Update to new libcss API for simultanious selection for base element and its pseudo elements.
svn path=/trunk/netsurf/; revision=11215
Diffstat (limited to 'render/box.c')
-rw-r--r-- | render/box.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/render/box.c b/render/box.c index e4292d20b..613b8c355 100644 --- a/render/box.c +++ b/render/box.c @@ -95,18 +95,23 @@ free_box_style(struct box *b) /** * Create a box tree node. * - * \param style style for the box (not copied) - * \param href href for the box (not copied), or 0 - * \param target target for the box (not copied), or 0 - * \param title title for the box (not copied), or 0 - * \param id id for the box (not copied), or 0 - * \param context context for allocations + * \param styles selection results for the box, or NULL + * \param style computed style for the box (not copied), or 0 + * \param style_owned whether style is owned by this box + * \param href href for the box (not copied), or 0 + * \param target target for the box (not copied), or 0 + * \param title title for the box (not copied), or 0 + * \param id id for the box (not copied), or 0 + * \param context context for allocations * \return allocated and initialised box, or 0 on memory exhaustion + * + * styles is always owned by the box, if it is set. + * style is only owned by the box in the case of implied boxes. */ -struct box * box_create(css_computed_style *style, bool style_owned, - char *href, const char *target, char *title, char *id, - void *context) +struct box * box_create(css_select_results *styles, css_computed_style *style, + bool style_owned, char *href, const char *target, char *title, + char *id, void *context) { unsigned int i; struct box *box; @@ -120,6 +125,7 @@ struct box * box_create(css_computed_style *style, bool style_owned, talloc_set_destructor(box, free_box_style); box->type = BOX_INLINE; + box->styles = styles; box->style = style; box->x = box->y = 0; box->width = UNKNOWN_WIDTH; @@ -278,6 +284,8 @@ void box_free_box(struct box *box) scroll_destroy(box->scroll_x); if (box->scroll_y != NULL) scroll_destroy(box->scroll_y); + if (box->styles != NULL) + css_select_results_destroy(box->styles); } talloc_free(box); @@ -1402,3 +1410,4 @@ bool box_hscrollbar_present(const struct box * const box) box->padding[LEFT] + box->width + box->padding[RIGHT] + box->border[RIGHT].width < box->descendant_x1; } + |