libhtmlpp 1.0.0
Loading...
Searching...
No Matches
Public Attributes | List of all members
libhtmlpp::AncestorFrame Struct Reference

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
 

Detailed Description

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).

Definition at line 125 of file css.h.

Member Data Documentation

◆ attributes

std::map<std::string,std::string> libhtmlpp::AncestorFrame::attributes

Definition at line 129 of file css.h.

◆ classes

std::vector<std::string> libhtmlpp::AncestorFrame::classes

Definition at line 127 of file css.h.

◆ id

std::string libhtmlpp::AncestorFrame::id

Definition at line 128 of file css.h.

◆ tag

std::string libhtmlpp::AncestorFrame::tag

Definition at line 126 of file css.h.


The documentation for this struct was generated from the following file: