fix(selectors): resolve clean textarea directionality

This commit is contained in:
ldm0
2026-10-11 18:04:09 +08:00
parent d869e38d7b
commit 0c39cc671f
+11 -1
View File
@@ -1762,11 +1762,21 @@ mod tests {
let textarea = host.create_element("textarea");
assert!(host.set_attribute(textarea, "dir", "auto"));
assert!(host.set_input_value(textarea, "\u{05ea}"));
let textarea_text = host.create_text_node("\u{05ea}");
assert!(host.append_child(textarea, textarea_text));
assert!(host.append_child(body, textarea));
assert!(!engine.matches_host(&host, textarea, ":dir(ltr)").unwrap());
assert!(engine.matches_host(&host, textarea, ":dir(rtl)").unwrap());
assert!(host.set_text_content(textarea, "A"));
assert!(engine.matches_host(&host, textarea, ":dir(ltr)").unwrap());
assert!(!engine.matches_host(&host, textarea, ":dir(rtl)").unwrap());
assert!(host.set_input_value(textarea, "\u{05ea}"));
assert!(host.set_text_content(textarea, "A"));
assert!(!engine.matches_host(&host, textarea, ":dir(ltr)").unwrap());
assert!(engine.matches_host(&host, textarea, ":dir(rtl)").unwrap());
assert!(host.set_input_value(textarea, "A"));
assert!(engine.matches_host(&host, textarea, ":dir(ltr)").unwrap());
assert!(!engine.matches_host(&host, textarea, ":dir(rtl)").unwrap());