Stop using SendElement in StyleSharingCandiate.

MozReview-Commit-ID: AuNPDsq8bgk
This commit is contained in:
Bobby Holley 2017-07-11 17:20:52 -07:00
parent ec6cca6d08
commit 3bce0c7652

View file

@ -221,9 +221,8 @@ impl ValidationData {
/// FakeCandidate below. /// FakeCandidate below.
#[derive(Debug)] #[derive(Debug)]
pub struct StyleSharingCandidate<E: TElement> { pub struct StyleSharingCandidate<E: TElement> {
/// The element. We use SendElement here so that the cache may live in /// The element.
/// ScopedTLS. element: E,
element: SendElement<E>,
validation_data: ValidationData, validation_data: ValidationData,
} }
@ -244,12 +243,12 @@ impl<E: TElement> Deref for StyleSharingCandidate<E> {
impl<E: TElement> StyleSharingCandidate<E> { impl<E: TElement> StyleSharingCandidate<E> {
/// Get the classlist of this candidate. /// Get the classlist of this candidate.
fn class_list(&mut self) -> &[Atom] { fn class_list(&mut self) -> &[Atom] {
self.validation_data.class_list(*self.element) self.validation_data.class_list(self.element)
} }
/// Get the pres hints of this candidate. /// Get the pres hints of this candidate.
fn pres_hints(&mut self) -> &[ApplicableDeclarationBlock] { fn pres_hints(&mut self) -> &[ApplicableDeclarationBlock] {
self.validation_data.pres_hints(*self.element) self.validation_data.pres_hints(self.element)
} }
/// Compute the bit vector of revalidation selector match results /// Compute the bit vector of revalidation selector match results
@ -260,7 +259,7 @@ impl<E: TElement> StyleSharingCandidate<E> {
bloom: &StyleBloom<E>, bloom: &StyleBloom<E>,
) -> &BitVec { ) -> &BitVec {
self.validation_data.revalidation_match_results( self.validation_data.revalidation_match_results(
*self.element, self.element,
stylist, stylist,
bloom, bloom,
/* bloom_known_valid = */ false, /* bloom_known_valid = */ false,
@ -590,7 +589,7 @@ impl<E: TElement> StyleSharingCandidateCache<E> {
self.dom_depth = dom_depth; self.dom_depth = dom_depth;
} }
self.cache_mut().insert(StyleSharingCandidate { self.cache_mut().insert(StyleSharingCandidate {
element: unsafe { SendElement::new(*element) }, element: *element,
validation_data: validation_data, validation_data: validation_data,
}); });
} }