blob: 6dac167d11a91b9579b7a8271d904ca2e22e8da6 [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-hyphens", "-epub-hyphens", "webkitHyphens", "epubHyphens", "manual");
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>