2012-04-23 12:48:33 +04:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>Test for Bug </title>
|
|
|
|
<script type="application/javascript" 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);
|
|
|
|
}
|
|
|
|
return getComputedStyle(element);
|
|
|
|
}
|
|
|
|
|
|
|
|
var tests = [
|
2015-08-28 10:50:04 +03:00
|
|
|
['div', {}, 'ltr', 'isolate'],
|
|
|
|
['div', {'dir': 'ltr'}, 'ltr', 'isolate'],
|
|
|
|
['div', {'dir': 'rtl'}, 'rtl', 'isolate'],
|
|
|
|
['div', {'dir': 'auto'}, 'ltr', 'isolate'],
|
|
|
|
['div', {'dir': ''}, 'ltr', 'isolate'],
|
2012-04-23 12:48:33 +04:00
|
|
|
|
|
|
|
['span', {}, 'ltr', 'normal'],
|
2015-08-28 10:50:04 +03:00
|
|
|
['span', {'dir': 'ltr'}, 'ltr', 'isolate'],
|
|
|
|
['span', {'dir': 'rtl'}, 'rtl', 'isolate'],
|
|
|
|
['span', {'dir': 'auto'}, 'ltr', 'isolate'],
|
|
|
|
['span', {'dir': ''}, 'ltr', 'isolate'],
|
2012-04-23 12:48:33 +04:00
|
|
|
|
2015-08-28 10:50:04 +03:00
|
|
|
['bdi', {}, 'ltr', 'isolate'],
|
|
|
|
['bdi', {'dir': 'ltr'}, 'ltr', 'isolate'],
|
|
|
|
['bdi', {'dir': 'rtl'}, 'rtl', 'isolate'],
|
|
|
|
['bdi', {'dir': 'auto'}, 'ltr', 'isolate'],
|
|
|
|
['bdi', {'dir': ''}, 'ltr', 'isolate'],
|
2012-04-23 12:48:33 +04:00
|
|
|
|
2015-08-28 10:50:04 +03:00
|
|
|
['output', {}, 'ltr', 'isolate'],
|
|
|
|
['output', {'dir': 'ltr'}, 'ltr', 'isolate'],
|
|
|
|
['output', {'dir': 'rtl'}, 'rtl', 'isolate'],
|
|
|
|
['output', {'dir': 'auto'}, 'ltr', 'isolate'],
|
|
|
|
['output', {'dir': ''}, 'ltr', 'isolate'],
|
2012-04-23 12:48:33 +04:00
|
|
|
|
2016-07-01 02:53:26 +03:00
|
|
|
['bdo', {}, 'ltr', 'isolate-override'],
|
|
|
|
['bdo', {'dir': 'ltr'}, 'ltr', 'isolate-override'],
|
|
|
|
['bdo', {'dir': 'rtl'}, 'rtl', 'isolate-override'],
|
2015-08-28 10:50:04 +03:00
|
|
|
['bdo', {'dir': 'auto'}, 'ltr', 'isolate-override'],
|
2016-07-01 02:53:26 +03:00
|
|
|
['bdo', {'dir': ''}, 'ltr', 'isolate-override'],
|
2012-04-23 12:48:33 +04:00
|
|
|
|
|
|
|
['textarea', {}, 'ltr', 'normal'],
|
2015-08-28 10:50:04 +03:00
|
|
|
['textarea', {'dir': 'ltr'}, 'ltr', 'isolate'],
|
|
|
|
['textarea', {'dir': 'rtl'}, 'rtl', 'isolate'],
|
|
|
|
['textarea', {'dir': 'auto'}, 'ltr', 'plaintext'],
|
|
|
|
['textarea', {'dir': ''}, 'ltr', 'isolate'],
|
2012-04-23 12:48:33 +04:00
|
|
|
|
2015-08-28 10:50:04 +03:00
|
|
|
['pre', {}, 'ltr', 'isolate'],
|
|
|
|
['pre', {'dir': 'ltr'}, 'ltr', 'isolate'],
|
|
|
|
['pre', {'dir': 'rtl'}, 'rtl', 'isolate'],
|
|
|
|
['pre', {'dir': 'auto'}, 'ltr', 'plaintext'],
|
|
|
|
['pre', {'dir': ''}, 'ltr', 'isolate'],
|
2012-04-23 12:48:33 +04:00
|
|
|
].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>
|
2012-04-23 14:49:26 +04:00
|
|
|
</html>
|