mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Have a concrete SelectorImpl type everywhere in the style crate.
It is conditionally compiled to one implementation or the other (Gecko or Servo) with `#[cfg(…)]`.
This commit is contained in:
parent
4b7060554b
commit
5c70dfab01
16 changed files with 236 additions and 232 deletions
|
@ -5,26 +5,25 @@
|
|||
//! Per-node data used in style calculation.
|
||||
|
||||
use properties::ComputedValues;
|
||||
use selectors::parser::SelectorImpl;
|
||||
use selector_impl::PseudoElement;
|
||||
use std::collections::HashMap;
|
||||
use std::hash::BuildHasherDefault;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::AtomicIsize;
|
||||
|
||||
pub struct PrivateStyleData<Impl: SelectorImpl> {
|
||||
pub struct PrivateStyleData {
|
||||
/// The results of CSS styling for this node.
|
||||
pub style: Option<Arc<ComputedValues>>,
|
||||
|
||||
/// The results of CSS styling for each pseudo-element (if any).
|
||||
pub per_pseudo: HashMap<Impl::PseudoElement, Arc<ComputedValues>,
|
||||
pub per_pseudo: HashMap<PseudoElement, Arc<ComputedValues>,
|
||||
BuildHasherDefault<::fnv::FnvHasher>>,
|
||||
|
||||
/// Information needed during parallel traversals.
|
||||
pub parallel: DomParallelInfo,
|
||||
}
|
||||
|
||||
impl<Impl> PrivateStyleData<Impl>
|
||||
where Impl: SelectorImpl {
|
||||
impl PrivateStyleData {
|
||||
pub fn new() -> Self {
|
||||
PrivateStyleData {
|
||||
style: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue