|
libhtmlpp 1.0.0
|
One ancestor of the element being matched, for the optional ancestor chain approximateSelectorMatch/collectApproximateMatches/getCSSRules accept – classes pre-split (whitespace-separated tokens of the ancestor's own class attribute), same shape callers already need to build for the target element.
More...
#include <css.h>
Public Attributes | |
| std::string | tag |
| std::vector< std::string > | classes |
| std::string | id |
| std::map< std::string, std::string > | attributes |
One ancestor of the element being matched, for the optional ancestor chain approximateSelectorMatch/collectApproximateMatches/getCSSRules accept – classes pre-split (whitespace-separated tokens of the ancestor's own class attribute), same shape callers already need to build for the target element.
A caller passing a chain orders it outermost-ancestor-first, closest-ancestor (immediate parent) last – the same left-to-right order a selector's own text reads in (e.g. for ".a .b .c", ancestors[0] should be the frame checked against ".a"). Only presence/order in the chain is checked, not adjacency or combinator type: this remains an approximation of real CSS descendant matching, just a considerably safer one than ignoring ancestors entirely. attributes (name -> value, optional – an empty map means "not supplied", not "this ancestor has no attributes") lets an attribute-selector condition on an ANCESTOR compound (e.g. the "[data-fit=fill]" in ".fade-box[data-fit=fill] img") be verified the same way collectApproximateMatches's targetAttributes verifies one on the target compound – a caller that doesn't populate this for its ancestor frames gets the old "ignore it" behavior for THOSE attribute-only ancestor conditions specifically (a tag/class/id requirement in the same compound is still checked as before).
| std::map<std::string,std::string> libhtmlpp::AncestorFrame::attributes |