mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
Replace downcast with is
This commit is contained in:
parent
3ef182ca36
commit
53476f2397
2 changed files with 2 additions and 2 deletions
|
@ -91,7 +91,7 @@ impl CharacterDataMethods for CharacterData {
|
||||||
// If this is a Text node, we might need to re-parse (say, if our parent
|
// If this is a Text node, we might need to re-parse (say, if our parent
|
||||||
// is a <style> element.) We don't need to if this is a Comment or
|
// is a <style> element.) We don't need to if this is a Comment or
|
||||||
// ProcessingInstruction.
|
// ProcessingInstruction.
|
||||||
if let Some(_) = self.downcast::<Text>() {
|
if self.is::<Text>() {
|
||||||
if let Some(parent_node) = node.GetParentNode() {
|
if let Some(parent_node) = node.GetParentNode() {
|
||||||
let mutation = ChildrenMutation::ChangeText;
|
let mutation = ChildrenMutation::ChangeText;
|
||||||
vtable_for(&parent_node).children_changed(&mutation);
|
vtable_for(&parent_node).children_changed(&mutation);
|
||||||
|
|
|
@ -392,7 +392,7 @@ pub fn handle_is_selected(documents: &Documents,
|
||||||
else if let Some(option_element) = node.downcast::<HTMLOptionElement>() {
|
else if let Some(option_element) = node.downcast::<HTMLOptionElement>() {
|
||||||
Ok(option_element.Selected())
|
Ok(option_element.Selected())
|
||||||
}
|
}
|
||||||
else if let Some(_) = node.downcast::<HTMLElement>() {
|
else if node.is::<HTMLElement>() {
|
||||||
Ok(false) // regular elements are not selectable
|
Ok(false) // regular elements are not selectable
|
||||||
} else {
|
} else {
|
||||||
Err(())
|
Err(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue