Auto merge of #17471 - aethanyc:fix-pseudo-element-matching-xbl, r=emilio

stylo: Fix pseudo element matching for rules in XBL stylesheets

This change was reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1372876

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17471)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-22 19:53:37 -07:00 committed by GitHub
commit 6342a4b455
3 changed files with 22 additions and 21 deletions

View file

@ -602,6 +602,21 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
None
}
/// Returns the rule hash target given an element.
fn rule_hash_target(&self) -> Self {
let is_implemented_pseudo =
self.implemented_pseudo_element().is_some();
// NB: This causes use to rule has pseudo selectors based on the
// properties of the originating element (which is fine, given the
// find_first_from_right usage).
if is_implemented_pseudo {
self.closest_non_native_anonymous_ancestor().unwrap()
} else {
*self
}
}
/// Gets declarations from XBL bindings from the element. Only gecko element could have this.
fn get_declarations_from_xbl_bindings<V>(&self,
_pseudo_element: Option<&PseudoElement>,