mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
examine_element: drop html_stack parameter
The stack is available via the html_context, which is passed to examine_element as of commit f42c86be70744e62af92282e4d64fc3066f6ba04.
This commit is contained in:
parent
c34a91a92f
commit
ecbc2271d1
@ -119,8 +119,7 @@ static css_applier_T css_appliers[CSS_PT_LAST] = {
|
|||||||
static void
|
static void
|
||||||
examine_element(struct html_context *html_context, struct css_selector *base,
|
examine_element(struct html_context *html_context, struct css_selector *base,
|
||||||
enum css_selector_type seltype, enum css_selector_relation rel,
|
enum css_selector_type seltype, enum css_selector_relation rel,
|
||||||
struct list_head *selectors, struct html_element *element,
|
struct list_head *selectors, struct html_element *element)
|
||||||
struct list_head *html_stack)
|
|
||||||
{
|
{
|
||||||
struct css_selector *selector;
|
struct css_selector *selector;
|
||||||
unsigned char *code;
|
unsigned char *code;
|
||||||
@ -138,7 +137,8 @@ examine_element(struct html_context *html_context, struct css_selector *base,
|
|||||||
dbginfo(sel, type, base); \
|
dbginfo(sel, type, base); \
|
||||||
merge_css_selectors(base, sel); \
|
merge_css_selectors(base, sel); \
|
||||||
/* Ancestor matches? */ \
|
/* Ancestor matches? */ \
|
||||||
if ((struct list_head *) element->next != html_stack) { \
|
if ((struct list_head *) element->next \
|
||||||
|
!= &html_context->stack) { \
|
||||||
struct html_element *ancestor; \
|
struct html_element *ancestor; \
|
||||||
/* This is less effective than doing reverse iterations,
|
/* This is less effective than doing reverse iterations,
|
||||||
* first over sel->leaves and then over the HTML stack,
|
* first over sel->leaves and then over the HTML stack,
|
||||||
@ -147,21 +147,20 @@ examine_element(struct html_context *html_context, struct css_selector *base,
|
|||||||
* have to duplicate the whole examine_element(), so if
|
* have to duplicate the whole examine_element(), so if
|
||||||
* profiles won't show it really costs... */ \
|
* profiles won't show it really costs... */ \
|
||||||
for (ancestor = element->next; \
|
for (ancestor = element->next; \
|
||||||
(struct list_head *) ancestor != html_stack;\
|
(struct list_head *) ancestor \
|
||||||
|
!= &html_context->stack;\
|
||||||
ancestor = ancestor->next) \
|
ancestor = ancestor->next) \
|
||||||
examine_element(html_context, base, \
|
examine_element(html_context, base, \
|
||||||
CST_ELEMENT, CSR_ANCESTOR, \
|
CST_ELEMENT, CSR_ANCESTOR, \
|
||||||
&sel->leaves, ancestor, \
|
&sel->leaves, ancestor); \
|
||||||
html_stack); \
|
|
||||||
examine_element(html_context, base, \
|
examine_element(html_context, base, \
|
||||||
CST_ELEMENT, CSR_PARENT, \
|
CST_ELEMENT, CSR_PARENT, \
|
||||||
&sel->leaves, element->next, \
|
&sel->leaves, element->next); \
|
||||||
html_stack); \
|
|
||||||
} \
|
} \
|
||||||
/* More specific matches? */ \
|
/* More specific matches? */ \
|
||||||
examine_element(html_context, base, type + 1, \
|
examine_element(html_context, base, type + 1, \
|
||||||
CSR_SPECIFITY, \
|
CSR_SPECIFITY, \
|
||||||
&sel->leaves, element, html_stack); \
|
&sel->leaves, element); \
|
||||||
}
|
}
|
||||||
|
|
||||||
if (seltype <= CST_ELEMENT && element->namelen) {
|
if (seltype <= CST_ELEMENT && element->namelen) {
|
||||||
@ -235,7 +234,7 @@ get_css_selector_for_element(struct html_context *html_context,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
examine_element(html_context, selector, CST_ELEMENT, CSR_ROOT,
|
examine_element(html_context, selector, CST_ELEMENT, CSR_ROOT,
|
||||||
&css->selectors, element, html_stack);
|
&css->selectors, element);
|
||||||
|
|
||||||
#ifdef DEBUG_CSS
|
#ifdef DEBUG_CSS
|
||||||
DBG("Element %.*s applied.", element->namelen, element->name);
|
DBG("Element %.*s applied.", element->namelen, element->name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user