mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Remove recursiveness from directionality search
This commit is contained in:
parent
7e2107b1a5
commit
edb940e613
4 changed files with 35 additions and 26 deletions
|
@ -543,8 +543,11 @@ impl Element {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#the-directionality
|
||||
pub fn directionality(&self) -> String {
|
||||
if let Some(html_element) = self.downcast::<HTMLElement>() {
|
||||
html_element.directionality()
|
||||
if let Some(directionality) = self
|
||||
.downcast::<HTMLElement>()
|
||||
.and_then(|html_element| html_element.directionality())
|
||||
{
|
||||
directionality
|
||||
} else {
|
||||
let node = self.upcast::<Node>();
|
||||
node.parent_directionality()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue