mirror of
https://github.com/servo/servo.git
synced 2025-08-08 15:05:35 +01:00
Store slow selector flags in a hashmap.
This reduces the flag setting overhead on a pessimal testcase from over a second to ~20ms.
This commit is contained in:
parent
a32596131a
commit
297dc33a9f
5 changed files with 112 additions and 42 deletions
|
@ -20,6 +20,7 @@ use shared_lock::Locked;
|
|||
use sink::Push;
|
||||
use std::fmt;
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
use stylist::ApplicableDeclarationBlock;
|
||||
|
@ -275,7 +276,8 @@ pub struct AnimationRules(pub Option<Arc<Locked<PropertyDeclarationBlock>>>,
|
|||
pub Option<Arc<Locked<PropertyDeclarationBlock>>>);
|
||||
|
||||
/// The element trait, the main abstraction the style crate acts over.
|
||||
pub trait TElement : PartialEq + Debug + Sized + Copy + Clone + ElementExt + PresentationalHintsSynthetizer {
|
||||
pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
|
||||
ElementExt + PresentationalHintsSynthetizer {
|
||||
/// The concrete node type.
|
||||
type ConcreteNode: TNode<ConcreteElement = Self>;
|
||||
|
||||
|
@ -518,7 +520,7 @@ impl<N: TNode> Deref for SendNode<N> {
|
|||
|
||||
/// Same reason as for the existence of SendNode, SendElement does the proper
|
||||
/// things for a given `TElement`.
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, Eq, Hash, PartialEq)]
|
||||
pub struct SendElement<E: TElement>(E);
|
||||
unsafe impl<E: TElement> Send for SendElement<E> {}
|
||||
impl<E: TElement> SendElement<E> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue