Loading src/htmlcss.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,12 @@ libhtmlpp::CSSRuleResult libhtmlpp::getCSSRules(HtmlElement &target, std::string cssClass = target.getAtributte("class"); std::string id = target.getAtributte("id"); std::map<std::string,std::string> targetAttributes; for (const HtmlElement::Attributes *attr = target.firstAttribute(); attr; attr = attr->nextAttribute()) { targetAttributes[attr->getKey()] = attr->getValue(); } sheet.collectApproximateMatches(tag, cssClass, id, result.properties, result.mediaRules, seenMediaBlocks, ancestors); seenMediaBlocks, ancestors, &targetAttributes); return result; } src/htmlcss.h +6 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,12 @@ namespace libhtmlpp { * (this function's original behavior), a non-null chain (see * AncestorFrame) makes a descendant selector's leading compounds * required to actually be found among @p target's ancestors, in order, * instead of being ignored. */ * instead of being ignored. @p target's own attribute map (built here * from its actual attributes, no extra parameter needed) is forwarded * as CSSStyleSheet::collectApproximateMatches's @p targetAttributes, so * an attribute-selector condition on the TARGET compound itself (e.g. * ".fade-box[data-fit=fill]") is verified instead of ignored -- unlike * an ancestor's attributes, @p target's are always available here. */ CSSRuleResult getCSSRules(HtmlElement &target, const CSSStyleSheet &sheet, std::set<std::string> &seenMediaBlocks, Loading Loading
src/htmlcss.cpp +6 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,12 @@ libhtmlpp::CSSRuleResult libhtmlpp::getCSSRules(HtmlElement &target, std::string cssClass = target.getAtributte("class"); std::string id = target.getAtributte("id"); std::map<std::string,std::string> targetAttributes; for (const HtmlElement::Attributes *attr = target.firstAttribute(); attr; attr = attr->nextAttribute()) { targetAttributes[attr->getKey()] = attr->getValue(); } sheet.collectApproximateMatches(tag, cssClass, id, result.properties, result.mediaRules, seenMediaBlocks, ancestors); seenMediaBlocks, ancestors, &targetAttributes); return result; }
src/htmlcss.h +6 −1 Original line number Diff line number Diff line Loading @@ -81,7 +81,12 @@ namespace libhtmlpp { * (this function's original behavior), a non-null chain (see * AncestorFrame) makes a descendant selector's leading compounds * required to actually be found among @p target's ancestors, in order, * instead of being ignored. */ * instead of being ignored. @p target's own attribute map (built here * from its actual attributes, no extra parameter needed) is forwarded * as CSSStyleSheet::collectApproximateMatches's @p targetAttributes, so * an attribute-selector condition on the TARGET compound itself (e.g. * ".fade-box[data-fit=fill]") is verified instead of ignored -- unlike * an ancestor's attributes, @p target's are always available here. */ CSSRuleResult getCSSRules(HtmlElement &target, const CSSStyleSheet &sheet, std::set<std::string> &seenMediaBlocks, Loading