blob: 0c0f4ccd6b744e951043feb7ae73a93248b28873 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<script src="../../resources/js-test-pre.js"></script>
<p id="description">This tests the computed value of unicode-bidi property.</p>
<div id="container"></div>
<div id="console"></div>
<script>
var container = document.getElementById('container');
function styleOf(name, attributes) {
var element = document.createElement('div');
for (var name in attributes) {
var value = attributes[name];
element.setAttribute(name, value);
}
container.appendChild(element);
return getComputedStyle(element);
}
var tests = [
['span', {}, 'normal'],
['span', {'style': 'unicode-bidi: embed;'}, 'embed'],
['span', {'style': 'unicode-bidi: -webkit-isolate;'}, '-webkit-isolate'],
['span', {'style': 'unicode-bidi: bidi-override;'}, 'bidi-override'],
['span', {'style': 'unicode-bidi: -webkit-plaintext;'}, '-webkit-plaintext'],
['span', {'style': 'unicode-bidi: bad-value;'}, 'normal'],
['span', {'style': 'unicode-bidi: embed embed;'}, 'normal'],
['span', {'style': 'unicode-bidi: embed -webkit-plain-text;'}, 'normal'],
['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate;'}, 'normal'],
['span', {'style': 'unicode-bidi: -webkit-isolate bidi-override;'}, 'normal'],
['span', {'style': 'unicode-bidi: -webkit-isolate-override;'}, '-webkit-isolate-override'],
['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate bidi-override;'}, 'normal'],
['span', {'style': 'unicode-bidi: bidi-override -webkit-isolate -webkit-isolate;'}, 'normal'],
['span', {'style': 'unicode-bidi: bidi-override bad-value;'}, 'normal'],
['span', {'style': 'unicode-bidi: bidi-override embed;'}, 'normal'],
].forEach(function (test) {
shouldBe('styleOf("' + test[0] + '", ' + JSON.stringify(test[1]) + ').unicodeBidi', '"' + test[2] + '"');
});
</script>
</body>
</html>