mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Rearrange directionality algorithm functions
This commit is contained in:
parent
cb34e5c887
commit
7d6d1c09cb
9 changed files with 141 additions and 95 deletions
|
@ -432,6 +432,25 @@ impl Node {
|
|||
.upcast::<Event>()
|
||||
.dispatch(self.upcast::<EventTarget>(), false);
|
||||
}
|
||||
|
||||
pub fn parent_directionality(&self) -> String {
|
||||
println!("Node#parent_directionality");
|
||||
match self.GetParentNode() {
|
||||
Some(parent) => {
|
||||
if parent.is::<Document>() {
|
||||
return "ltr".to_owned();
|
||||
}
|
||||
|
||||
println!("Node#parent_directionality Some(Parent)");
|
||||
return if let Some(parent_html) = parent.downcast::<Element>() {
|
||||
parent_html.directionality()
|
||||
} else {
|
||||
parent.parent_directionality()
|
||||
};
|
||||
},
|
||||
None => "ltr".to_owned(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct QuerySelectorIterator {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue