Implement :visited handling for lazy pseudo-elements in stylo.

Part 2 of the fix for Gecko bug 1364242: https://bugzilla.mozilla.org/show_bug.cgi?id=1364242
This commit is contained in:
Boris Zbarsky 2017-06-29 16:22:13 -07:00
parent 351c7f7859
commit 52d1b59515
5 changed files with 134 additions and 47 deletions

View file

@ -184,7 +184,7 @@ impl Default for CascadeInputs {
impl CascadeInputs {
/// Construct inputs from previous cascade results, if any.
fn new_from_style(style: &Arc<ComputedValues>) -> Self {
pub fn new_from_style(style: &Arc<ComputedValues>) -> Self {
CascadeInputs {
rules: style.rules.clone(),
visited_rules: style.get_visited_style().and_then(|v| v.rules.clone()),
@ -204,6 +204,11 @@ impl CascadeInputs {
self.rules.as_mut()
}
/// Gets a reference to the rule node, if any.
pub fn get_rules(&self) -> Option<&StrongRuleNode> {
self.rules.as_ref()
}
/// Gets a reference to the rule node. Panic if the element does not have
/// rule node.
pub fn rules(&self) -> &StrongRuleNode {