diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /layout/style/test/test_default_bidi_css.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/style/test/test_default_bidi_css.html')
-rw-r--r-- | layout/style/test/test_default_bidi_css.html | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/layout/style/test/test_default_bidi_css.html b/layout/style/test/test_default_bidi_css.html new file mode 100644 index 0000000000..9033c9b6a7 --- /dev/null +++ b/layout/style/test/test_default_bidi_css.html @@ -0,0 +1,80 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="utf-8"> + <title>Test for Bug </title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body> +<p id="display"></p> +<div id="content" style="display: none"> + +</div> +<pre id="test"> +<script type="application/javascript"> + +/** Test for default bidi css **/ +function styleOf(name, attributes) { + var element = document.createElement(name); + for (var name in attributes) { + var value = attributes[name]; + element.setAttribute(name, value); + } + document.body.appendChild(element); + return getComputedStyle(element); +} + +var tests = [ + ['div', {}, 'ltr', 'isolate'], + ['div', {'dir': 'ltr'}, 'ltr', 'isolate'], + ['div', {'dir': 'rtl'}, 'rtl', 'isolate'], + ['div', {'dir': 'auto'}, 'ltr', 'isolate'], + ['div', {'dir': ''}, 'ltr', 'isolate'], + + ['span', {}, 'ltr', 'normal'], + ['span', {'dir': 'ltr'}, 'ltr', 'isolate'], + ['span', {'dir': 'rtl'}, 'rtl', 'isolate'], + ['span', {'dir': 'auto'}, 'ltr', 'isolate'], + ['span', {'dir': ''}, 'ltr', 'isolate'], + + ['bdi', {}, 'ltr', 'isolate'], + ['bdi', {'dir': 'ltr'}, 'ltr', 'isolate'], + ['bdi', {'dir': 'rtl'}, 'rtl', 'isolate'], + ['bdi', {'dir': 'auto'}, 'ltr', 'isolate'], + ['bdi', {'dir': ''}, 'ltr', 'isolate'], + + ['output', {}, 'ltr', 'isolate'], + ['output', {'dir': 'ltr'}, 'ltr', 'isolate'], + ['output', {'dir': 'rtl'}, 'rtl', 'isolate'], + ['output', {'dir': 'auto'}, 'ltr', 'isolate'], + ['output', {'dir': ''}, 'ltr', 'isolate'], + + ['bdo', {}, 'ltr', 'isolate-override'], + ['bdo', {'dir': 'ltr'}, 'ltr', 'isolate-override'], + ['bdo', {'dir': 'rtl'}, 'rtl', 'isolate-override'], + ['bdo', {'dir': 'auto'}, 'ltr', 'isolate-override'], + ['bdo', {'dir': ''}, 'ltr', 'isolate-override'], + + ['textarea', {}, 'ltr', 'normal'], + ['textarea', {'dir': 'ltr'}, 'ltr', 'isolate'], + ['textarea', {'dir': 'rtl'}, 'rtl', 'isolate'], + ['textarea', {'dir': 'auto'}, 'ltr', 'plaintext'], + ['textarea', {'dir': ''}, 'ltr', 'isolate'], + + ['pre', {}, 'ltr', 'isolate'], + ['pre', {'dir': 'ltr'}, 'ltr', 'isolate'], + ['pre', {'dir': 'rtl'}, 'rtl', 'isolate'], + ['pre', {'dir': 'auto'}, 'ltr', 'plaintext'], + ['pre', {'dir': ''}, 'ltr', 'isolate'], +].forEach(function (test) { + var style = styleOf(test[0], test[1]); + is(style.direction, test[2], "default value for direction"); + is(style.unicodeBidi, test[3], "default value for unicode-bidi"); +}); + + +</script> +</pre> +</body> +</html> |