mirror of
https://github.com/servo/servo.git
synced 2025-07-28 01:30:32 +01:00
Use Gecko's simpler Bloom filter instead of one based on hash
stretching. This preserves the usage of the Bloom filter throughout style recalc, but the implementation is rewritten. Provides a 15% improvement on Guardians of the Galaxy.
This commit is contained in:
parent
878ece58da
commit
2a790d06dd
10 changed files with 335 additions and 357 deletions
|
@ -496,6 +496,20 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
|
|||
self.element.has_class_for_layout(name)
|
||||
}
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn each_class(self, callback: |&Atom|) {
|
||||
unsafe {
|
||||
match self.element.get_classes_for_layout() {
|
||||
None => {}
|
||||
Some(mut classes) => {
|
||||
for class in classes {
|
||||
callback(class)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_content(content_list: &content::T) -> String {
|
||||
|
@ -890,13 +904,13 @@ pub unsafe fn layout_node_from_unsafe_layout_node(node: &UnsafeLayoutNode) -> La
|
|||
}
|
||||
|
||||
/// A top-down traversal.
|
||||
pub trait PreorderDOMTraversal {
|
||||
pub trait PreorderDomTraversal {
|
||||
/// The operation to perform. Return true to continue or false to stop.
|
||||
fn process(&self, _node: LayoutNode);
|
||||
fn process(&self, node: LayoutNode);
|
||||
}
|
||||
|
||||
/// A bottom-up traversal, with a optional in-order pass.
|
||||
pub trait PostorderDOMTraversal {
|
||||
pub trait PostorderDomTraversal {
|
||||
/// The operation to perform. Return true to continue or false to stop.
|
||||
fn process(&self, _node: LayoutNode);
|
||||
fn process(&self, node: LayoutNode);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue