Struct style::sharing::StyleSharingCache [] [src]

pub struct StyleSharingCache<E: TElement> { /* fields omitted */ }

An LRU cache of the last few nodes seen, so that we can aggressively try to reuse their styles.

Note that this cache is flushed every time we steal work from the queue, so storing nodes here temporarily is safe.

Methods

impl<E: TElement> StyleSharingCache<E>
[src]

[src]

Create a new style sharing candidate cache.

[src]

Tries to insert an element in the style sharing cache.

Fails if we know it should never be in the cache.

NB: We pass a source for the validation data, rather than the data itself, to avoid memmoving at each function call. See rust issue #42763.

[src]

Clear the style sharing candidate cache.

[src]

Attempts to find an element in the cache with the given primary rule node and parent.

Trait Implementations

impl<E: TElement> Drop for StyleSharingCache<E>
[src]

[src]

Executes the destructor for this type. Read more