Further changes required by Servo

This commit is contained in:
Oriol Brufau 2023-06-06 22:23:35 +02:00
parent 454a9777b3
commit 07d1bd560b

View file

@ -1551,6 +1551,7 @@ impl<T> Default for LayerOrderedMap<T> {
}
}
#[cfg(feature = "gecko")]
impl<T: 'static> LayerOrderedVec<T> {
fn clear(&mut self) {
self.0.clear();
@ -1567,6 +1568,7 @@ impl<T: 'static> LayerOrderedMap<T> {
fn clear(&mut self) {
self.0.clear();
}
#[cfg(feature = "gecko")]
fn try_insert(&mut self, name: Atom, v: T, id: LayerId) -> Result<(), FailedAllocationError> {
self.try_insert_with(name, v, id, |_, _| Ordering::Equal)
}
@ -1583,6 +1585,7 @@ impl<T: 'static> LayerOrderedMap<T> {
vec.push((v, id));
Ok(())
}
#[cfg(feature = "gecko")]
fn sort(&mut self, layers: &[CascadeLayer]) {
self.sort_with(layers, |_, _| Ordering::Equal)
}
@ -2255,7 +2258,10 @@ impl CascadeData {
order.inc();
}
}
self.extra_data.sort_by_layer(&self.layers);
#[cfg(feature = "gecko")]
{
self.extra_data.sort_by_layer(&self.layers);
}
self.animations.sort_with(&self.layers, compare_keyframes_in_same_layer);
}
@ -2782,7 +2788,10 @@ impl CascadeData {
self.layer_id.clear();
self.layers.clear();
self.layers.push(CascadeLayer::root());
self.extra_data.clear();
#[cfg(feature = "gecko")]
{
self.extra_data.clear();
}
self.rules_source_order = 0;
self.num_selectors = 0;
self.num_declarations = 0;