mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Removed unsafe from 'query_selector_iter'
This commit is contained in:
parent
1a376aa75d
commit
89e8a26539
3 changed files with 34 additions and 55 deletions
|
@ -232,13 +232,9 @@ impl<'a> Activatable for &'a HTMLButtonElement {
|
|||
if owner.is_none() || elem.click_in_progress() {
|
||||
return;
|
||||
}
|
||||
// This is safe because we are stopping after finding the first element
|
||||
// and only then performing actions which may modify the DOM tree
|
||||
unsafe {
|
||||
node.query_selector_iter("button[type=submit]".to_owned()).unwrap()
|
||||
.filter_map(HTMLButtonElementCast::to_root)
|
||||
.find(|r| r.r().form_owner() == owner)
|
||||
.map(|s| s.r().synthetic_click_activation(ctrlKey, shiftKey, altKey, metaKey));
|
||||
}
|
||||
node.query_selector_iter("button[type=submit]".to_owned()).unwrap()
|
||||
.filter_map(HTMLButtonElementCast::to_root)
|
||||
.find(|r| r.r().form_owner() == owner)
|
||||
.map(|s| s.r().synthetic_click_activation(ctrlKey, shiftKey, altKey, metaKey));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue