Subject: | No way to extract ELEMENT::pseudo-element information |
The cause of the problem lies inside the function CSS::SAC::parse_simple
_selector. The following code creates AND_CONDITION which combines the
ELEMENT and PSEUDO_ELEMENT, but this AND_CONDITION isn't attached to
anything, only a GENERAL_SELECTOR (*) is created and this is what will
be returned through CSS::SAC property() event.
# here we need to check whether the next token is also a selector
# if it is, we need to make an AND_CONDITION containing the two
selectors
# and to attach it to a universal selector
# then we'll have to mix it into the $cond below.
if (@tokens) {
eval { $tokens[0]->SelectorType };
if (!$@) {
my $and_cond = $sac->[_cf_]->create_and_condition($selector,
shift @tokens);
$selector = $sac->[_sf_]->create_element_selector(undef,
undef);
}
}
I have added a personal/temporary solution which changes pseudo-
elements to pseudo-classes
if (@tokens) {
eval { $tokens[0]->SelectorType };
if (!$@) {
# I added a temporal solution, which changes pseudo-elements
to pseudo-classes.
my $p_element_selector = shift @tokens;
my $pseudo_cond = $sac->[_cf_]->create_pseudo_class_condition
(undef, $p_element_selector->LocalName);
$selector = $sac->[_sf_]->create_conditional_selector(
$selector, $pseudo_cond);
}
}