Implement step 5.13 for dirname correctly

This commit is contained in:
Dmitry Kolupaev 2020-02-18 18:43:19 +03:00
parent 6188116090
commit ab2aeb6d97
2 changed files with 23 additions and 24 deletions

View file

@ -339,14 +339,14 @@ impl HTMLInputElement {
}
pub fn directionality_from_value(value: &str) -> String {
if HTMLInputElement::first_strong_character_is_rtl(value) {
if HTMLInputElement::is_first_strong_character_rtl(value) {
"rtl".to_owned()
} else {
"ltr".to_owned()
}
}
fn first_strong_character_is_rtl(value: &str) -> bool {
fn is_first_strong_character_rtl(value: &str) -> bool {
for ch in value.chars() {
return match bidi_class(ch) {
BidiClass::L => false,