mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-17 13:39:25 +00:00
44 lines
1.3 KiB
HTML
44 lines
1.3 KiB
HTML
<!DOCTYPE html>
|
|
<style>
|
|
.test {
|
|
font-size: 12px;
|
|
}
|
|
</style>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
function testSelectorMatch(input, selector) {
|
|
println(`Input matches ${selector}: ${input.matches(selector)}`);
|
|
}
|
|
|
|
const input = document.createElement("input");
|
|
input.type = "text";
|
|
input.value = "Well hello friends!"
|
|
testSelectorMatch(input, ":dir(ltr)");
|
|
testSelectorMatch(input, ":dir(rtl)");
|
|
|
|
input.dir = "invalid";
|
|
testSelectorMatch(input, ":dir(ltr)");
|
|
testSelectorMatch(input, ":dir(rtl)");
|
|
|
|
input.dir = "rtl";
|
|
testSelectorMatch(input, ":dir(ltr)");
|
|
testSelectorMatch(input, ":dir(rtl)");
|
|
|
|
input.dir = "auto"
|
|
testSelectorMatch(input, ":dir(ltr)");
|
|
testSelectorMatch(input, ":dir(rtl)");
|
|
|
|
input.value = "حسنًا ، مرحباً أيها الأصدقاء";
|
|
testSelectorMatch(input, ":dir(ltr)");
|
|
testSelectorMatch(input, ":dir(rtl)");
|
|
|
|
input.dir = "ltr"
|
|
testSelectorMatch(input, ":dir(ltr)");
|
|
testSelectorMatch(input, ":dir(rtl)");
|
|
|
|
input.removeAttribute("dir");
|
|
testSelectorMatch(input, ":dir(ltr)");
|
|
testSelectorMatch(input, ":dir(rtl)");
|
|
});
|
|
</script>
|