style: Make Element::id not clone the attribute.

This commit is contained in:
Emilio Cobos Álvarez 2018-02-24 21:49:43 +01:00
parent 98c9292ecb
commit f2efd04a5d
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
10 changed files with 46 additions and 37 deletions

View file

@ -5,7 +5,7 @@
//! An invalidation processor for style changes due to state and attribute
//! changes.
use Atom;
use {Atom, WeakAtom};
use context::{QuirksMode, SharedStyleContext};
use data::ElementData;
use dom::TElement;
@ -42,8 +42,8 @@ where
snapshot: &'a Snapshot,
quirks_mode: QuirksMode,
lookup_element: E,
removed_id: Option<&'a Atom>,
added_id: Option<&'a Atom>,
removed_id: Option<&'a WeakAtom>,
added_id: Option<&'a WeakAtom>,
classes_removed: &'a SmallVec<[Atom; 8]>,
classes_added: &'a SmallVec<[Atom; 8]>,
state_changes: ElementState,
@ -239,8 +239,8 @@ where
snapshot: &snapshot,
quirks_mode: self.shared_context.quirks_mode(),
nth_index_cache: self.matching_context.nth_index_cache.as_mut().map(|c| &mut **c),
removed_id: id_removed.as_ref(),
added_id: id_added.as_ref(),
removed_id: id_removed,
added_id: id_added,
classes_removed: &classes_removed,
classes_added: &classes_added,
descendant_invalidations,