Stylo: Correct style match for element instances under a use-element tree.

This commit is contained in:
cku 2017-06-20 16:44:59 +08:00
parent 4d997f0d0c
commit 727725ac3d
6 changed files with 170 additions and 137 deletions

View file

@ -532,8 +532,12 @@ fn matches_complex_selector_internal<E, F>(mut selector_iter: SelectorIter<E::Im
SelectorMatchingResult::NotMatchedAndRestartFromClosestDescendant)
}
Combinator::Child | Combinator::Descendant => {
(element.parent_element(),
SelectorMatchingResult::NotMatchedGlobally)
if element.blocks_ancestor_combinators() {
(None, SelectorMatchingResult::NotMatchedGlobally)
} else {
(element.parent_element(),
SelectorMatchingResult::NotMatchedGlobally)
}
}
Combinator::PseudoElement => {
(element.pseudo_element_originating_element(),