style: Assert we don't try to share against ourselves.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-18 03:27:29 +02:00
parent 891bc7d174
commit a5842165d9
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -751,6 +751,7 @@ impl<E: TElement> StyleSharingCache<E> {
target: E,
) -> Option<PrimaryStyle> {
self.cache_mut().lookup(|candidate| {
debug_assert_ne!(candidate.element, target);
if !candidate.parent_style_identity().eq(inherited) {
return None;
}