diff --git a/src/document/css/parser.c b/src/document/css/parser.c index 86e6b7f3..9e301e0c 100644 --- a/src/document/css/parser.c +++ b/src/document/css/parser.c @@ -170,7 +170,20 @@ struct selector_pkg { struct css_selector *selector; }; -struct css_selector * +/** Move a CSS selector and its leaves into a new list. If a similar + * selector already exists in the list, merge them. + * + * \param sels + * The list to which \a selector should be moved. Must not be NULL. + * \param selector + * The selector that should be moved. Must not be NULL. If it is + * already in some list, this function removes it from there. + * \param watch + * This function updates \a *watch if it merges that selector into + * another one. \a watch must not be NULL but \a *watch may be. + * + * \return \a selector or the one into which it was merged. */ +static struct css_selector * reparent_selector(struct list_head *sels, struct css_selector *selector, struct css_selector **watch) {