mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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:
commit
145c89a2d4
27 changed files with 252 additions and 3303 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue