Improve modern layout and viewport rendering
This commit is contained in:
1 parent
aff0172987
commit
10b8492116
22 files changed
+5978
-450
No files matched your search
@@ -1031,6 +1031,22 @@ mod tests {
|
||||
assert_eq!(node.as_element().unwrap().local.as_ref(), "span");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compiled_nested_is_descendant_matches_with_ancestor_filter() {
|
||||
let tree = parse_html(
|
||||
r#"<div class="**:[.line]:block"><code><span id="target" class="line">x</span></code></div>"#,
|
||||
);
|
||||
let target = tree.get_element_by_id("target").unwrap();
|
||||
let compiled = tree
|
||||
.compile_rule_selector(r#":is(.\*\*\:\[\.line\]\:block *).line"#)
|
||||
.unwrap();
|
||||
let mut matcher = tree.matcher();
|
||||
for ancestor in tree.ancestors(target).into_iter().rev() {
|
||||
matcher.push_ancestor(&tree, ancestor);
|
||||
}
|
||||
assert!(matcher.matches(&tree, target, &compiled));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_query_selector_attribute() {
|
||||
let tree = parse_html(
|
||||
|
||||
Reference in new issue
Block a user