aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/sharing/mod.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-11-30 17:26:12 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-11-30 17:26:45 +0100
commit0bcd36838d6364ffe30a1e3aa9ce25bccfbd97f1 (patch)
tree157eb49ae8f8e76c964a9faec5c8a3ca45eaba4f /components/style/sharing/mod.rs
parentfce44a2e139478a5fc3524c2fd72fbeea6e3eec1 (diff)
downloadservo-0bcd36838d6364ffe30a1e3aa9ce25bccfbd97f1.tar.gz
servo-0bcd36838d6364ffe30a1e3aa9ce25bccfbd97f1.zip
style: Remove redundant style sharing check.
We check that a few lines before calling test_candidate.
Diffstat (limited to 'components/style/sharing/mod.rs')
-rw-r--r--components/style/sharing/mod.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/components/style/sharing/mod.rs b/components/style/sharing/mod.rs
index 360d644f407..79ddd58dfce 100644
--- a/components/style/sharing/mod.rs
+++ b/components/style/sharing/mod.rs
@@ -648,6 +648,8 @@ impl<E: TElement> StyleSharingCache<E> {
nth_index_cache: &mut NthIndexCache,
selector_flags_map: &mut SelectorFlagsMap<E>
) -> Option<ResolvedElementStyles> {
+ debug_assert!(!target.is_native_anonymous());
+
// Check that we have the same parent, or at least that the parents
// share styles and permit sharing across their children. The latter
// check allows us to share style between cousins if the parents
@@ -657,13 +659,6 @@ impl<E: TElement> StyleSharingCache<E> {
return None;
}
- if target.is_native_anonymous() {
- debug_assert!(!candidate.element.is_native_anonymous(),
- "Why inserting NAC into the cache?");
- trace!("Miss: Native Anonymous Content");
- return None;
- }
-
// Note that in the XBL case, we should be able to assert that the
// scopes are different, since two elements with different XBL bindings
// need to necessarily have different style (and thus children of them