mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
style: Rework how precomputed pseudo stuff works, to avoid malloc/free churn.
This showed up in a few profiles, and was an easy improvement. MozReview-Commit-ID: HVqATaSB2Ak Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
48b7e6d27c
commit
64a96ce21c
3 changed files with 50 additions and 67 deletions
|
@ -222,16 +222,6 @@ fn test_insert() {
|
|||
assert!(selector_map.class_hash.get(&Atom::from("foo"), QuirksMode::NoQuirks).is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_get_universal_rules() {
|
||||
thread_state::initialize(thread_state::LAYOUT);
|
||||
let (map, _shared_lock) = get_mock_map(&["*|*", "#foo > *|*", "*|* > *|*", ".klass", "#id"]);
|
||||
|
||||
let decls = map.get_universal_rules(CascadeLevel::UserNormal);
|
||||
|
||||
assert_eq!(decls.len(), 1, "{:?}", decls);
|
||||
}
|
||||
|
||||
fn mock_stylist() -> Stylist {
|
||||
let device = Device::new(MediaType::Screen, TypedSize2D::new(0f32, 0f32), ScaleFactor::new(1.0));
|
||||
Stylist::new(device, QuirksMode::NoQuirks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue