diff options
author | Dmitry Kolupaev <dmitry.klpv@gmail.com> | 2020-02-16 00:15:24 +0300 |
---|---|---|
committer | Dmitry Kolupaev <dmitry.klpv@gmail.com> | 2020-02-25 01:18:20 +0300 |
commit | 7d6d1c09cb4227cef3662d6e72a72fd634f3fc73 (patch) | |
tree | d8bc0c497a6711f91eab4a072dc5def02a61bd34 /components/script/dom/node.rs | |
parent | cb34e5c887965de1e85d14d09bc14183c1724aed (diff) | |
download | servo-7d6d1c09cb4227cef3662d6e72a72fd634f3fc73.tar.gz servo-7d6d1c09cb4227cef3662d6e72a72fd634f3fc73.zip |
Rearrange directionality algorithm functions
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 457c1f0d55c..1ecafaf3bf3 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -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 { |