From 97cd61e9ca455834cc2095241bf0f3517208b83d Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 11 Oct 2010 23:35:49 +0200 Subject: allow to apply CssContext to an arbitrary node in the docTree --- src/css.cc | 5 ++--- src/css.hh | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/css.cc b/src/css.cc index ea64a26c..384845f4 100644 --- a/src/css.cc +++ b/src/css.cc @@ -428,7 +428,7 @@ void CssStyleSheet::apply (CssPropertyList *props, } } - ruleList[numLists] = elementTable[docTree->top ()->element]; + ruleList[numLists] = elementTable[node->element]; if (ruleList[numLists]) numLists++; @@ -512,9 +512,8 @@ CssContext::~CssContext () { * This allows e.g. user styles to overwrite author styles. */ void CssContext::apply (CssPropertyList *props, Doctree *docTree, + DoctreeNode *node, CssPropertyList *tagStyle, CssPropertyList *nonCssHints) { - const DoctreeNode *node = docTree->top (); - if (sheet[CSS_PRIMARY_USER_AGENT]) sheet[CSS_PRIMARY_USER_AGENT]->apply (props, docTree, node); diff --git a/src/css.hh b/src/css.hh index 9922dd65..1ed8c39b 100644 --- a/src/css.hh +++ b/src/css.hh @@ -478,7 +478,7 @@ class CssContext { void addRule (CssSelector *sel, CssPropertyList *props, CssPrimaryOrder order); void apply (CssPropertyList *props, - Doctree *docTree, + Doctree *docTree, DoctreeNode *node, CssPropertyList *tagStyle, CssPropertyList *nonCssHints); }; -- cgit v1.2.3