Auto merge of #25499 - NeverHappened:implement-form-dirname, r=jdm

Implement dirname support for form element

Added support for dirname in input on form submit
Added Dir getter / setter for HTMLElement
NOT YET Added get directionality according to https://html.spec.whatwg.org/multipage/dom.html#the-directionality

- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25379 (GitHub issue number if applicable)
This commit is contained in:
bors-servo 2020-02-24 21:18:10 -05:00 committed by GitHub
commit 145c89a2d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 252 additions and 3303 deletions

View file

@ -440,6 +440,26 @@ impl Node {
.upcast::<Event>()
.dispatch(self.upcast::<EventTarget>(), false);
}
pub fn parent_directionality(&self) -> String {
let mut current = self.GetParentNode();
loop {
match current {
Some(node) => {
if let Some(directionality) = node
.downcast::<HTMLElement>()
.and_then(|html_element| html_element.directionality())
{
return directionality;
} else {
current = node.GetParentNode();
}
},
None => return "ltr".to_owned(),
}
}
}
}
pub struct QuerySelectorIterator {