mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
parent
72ead882c0
commit
fc25397c91
10 changed files with 101 additions and 120 deletions
|
@ -32,19 +32,19 @@ pub trait PresentationalHintSynthesis {
|
|||
/// `common_style_affecting_attributes` or `rare_style_affecting_attributes` as appropriate. If
|
||||
/// you don't, you risk strange random nondeterministic failures due to false positives in
|
||||
/// style sharing.
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<'a,N,V>(
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<N,V>(
|
||||
&self, node: &N, matching_rules_list: &mut V, shareable: &mut bool)
|
||||
where N: TNode<'a>,
|
||||
N::Element: TElementAttributes<'a>,
|
||||
where N: TNode,
|
||||
N::Element: TElementAttributes,
|
||||
V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>;
|
||||
}
|
||||
|
||||
impl PresentationalHintSynthesis for Stylist {
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<'a,N,V>(
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<N,V>(
|
||||
&self, node: &N, matching_rules_list: &mut V, shareable: &mut bool)
|
||||
where N: TNode<'a>,
|
||||
N::Element: TElementAttributes<'a>,
|
||||
V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>> {
|
||||
where N: TNode,
|
||||
N::Element: TElementAttributes,
|
||||
V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>> {
|
||||
let element = node.as_element();
|
||||
|
||||
let length = matching_rules_list.len();
|
||||
|
|
|
@ -13,11 +13,11 @@ use selectors::matching::DeclarationBlock;
|
|||
pub use selectors::tree::{TNode, TElement};
|
||||
use string_cache::{Atom, Namespace};
|
||||
|
||||
pub trait TElementAttributes<'a> : Copy {
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<V>(self, &mut V)
|
||||
pub trait TElementAttributes {
|
||||
fn synthesize_presentational_hints_for_legacy_attributes<V>(&self, &mut V)
|
||||
where V: VecLike<DeclarationBlock<Vec<PropertyDeclaration>>>;
|
||||
fn get_unsigned_integer_attribute(self, attribute: UnsignedIntegerAttribute) -> Option<u32>;
|
||||
fn get_unsigned_integer_attribute(&self, attribute: UnsignedIntegerAttribute) -> Option<u32>;
|
||||
|
||||
fn get_attr(self, namespace: &Namespace, attr: &Atom) -> Option<&'a str>;
|
||||
fn get_attrs(self, attr: &Atom) -> Vec<&'a str>;
|
||||
fn get_attr<'a>(&'a self, namespace: &Namespace, attr: &Atom) -> Option<&'a str>;
|
||||
fn get_attrs<'a>(&'a self, attr: &Atom) -> Vec<&'a str>;
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ impl Stylist {
|
|||
/// The returned boolean indicates whether the style is *shareable*; that is, whether the
|
||||
/// matched selectors are simple enough to allow the matching logic to be reduced to the logic
|
||||
/// in `css::matching::PrivateMatchMethods::candidate_element_allows_for_style_sharing`.
|
||||
pub fn push_applicable_declarations<'a,N,V>(
|
||||
pub fn push_applicable_declarations<N,V>(
|
||||
&self,
|
||||
element: &N,
|
||||
parent_bf: &Option<Box<BloomFilter>>,
|
||||
|
@ -198,8 +198,8 @@ impl Stylist {
|
|||
pseudo_element: Option<PseudoElement>,
|
||||
applicable_declarations: &mut V)
|
||||
-> bool
|
||||
where N: TNode<'a>,
|
||||
N::Element: TElementAttributes<'a>,
|
||||
where N: TNode,
|
||||
N::Element: TElementAttributes,
|
||||
V: VecLike<DeclarationBlock> {
|
||||
assert!(!self.is_dirty);
|
||||
assert!(element.is_element());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue