blob: eff63e13ef4620dbba166a7ed6922486cf155567 [file] [log] [blame]
<pre id="console"></pre>
<script>
if (window.testRunner)
testRunner.dumpAsText();
function log(message)
{
document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
}
function testEpubProperty(name, alias, jsName, jsAlias, value)
{
var pass = true;
var element = document.createElement("div");
element.setAttribute("style", name + ": " + value);
if (eval("element.style." + jsAlias) !== value) {
log("FAIL: element.style." + jsAlias + " is not '" + value + "' after setting style to " + element.getAttribute("style") + ".");
pass = false;
}
element.setAttribute("style", alias + ":" + value);
if (eval("element.style." + jsName) !== value) {
log("FAIL: element.style." + jsName + " is not '" + value + "' after setting style to " + element.getAttribute("style") + ".");
pass = false;
}
if (pass)
log("PASS: " + alias + " is an alias for " + name);
}
testEpubProperty("caption-side", "-epub-caption-side", "captionSide", "epubCaptionSide", "bottom");
testEpubProperty("-webkit-text-combine", "-epub-text-combine", "webkitTextCombine", "epubTextCombine", "horizontal");
testEpubProperty("-webkit-text-emphasis-style", "-epub-text-emphasis-style", "webkitTextEmphasisStyle", "epubTextEmphasisStyle", "open sesame");
testEpubProperty("-webkit-text-emphasis-color", "-epub-text-emphasis-color", "webkitTextEmphasisColor", "epubTextEmphasisColor", "red");
testEpubProperty("-webkit-text-orientation", "-epub-text-orientation", "webkitTextOrientation", "epubTextOrientation", "upright");
testEpubProperty("text-transform", "-epub-text-transform", "textTransform", "epubTextTransform", "uppercase");
testEpubProperty("word-break", "-epub-word-break", "wordBreak", "epubWordBreak", "break-all");
testEpubProperty("-webkit-writing-mode", "-epub-writing-mode", "webkitWritingMode", "epubWritingMode", "vertical-rl");
</script>