Files
popsu_rouen_strapi/static/lib/Hyphenopoly-master/testsuite/test39.html
T
2020-01-13 22:21:24 +01:00

89 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Test 039</title>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
document.getElementById("myTextField").focus();
});
var Hyphenopoly = {
require: {
"en-us": "FORCEHYPHENOPOLY"
},
setup: {
hide: "element"
},
handleEvent: {
hyphenopolyEnd: function (e) {
assert();
}
}
};
function assert() {
var tests = 1;
var i = 1;
var test = "";
var ref = "";
var result = true;
while (i <= tests) {
test = document.getElementById("myTextField");
ref = document.activeElement;
if (test === ref) {
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
result = result && true;
} else {
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
result = false;
}
i += 1;
}
if (parent != window) {
parent.postMessage(JSON.stringify({
desc: document.getElementById("desc").innerHTML,
index: 39,
result: (result ? "passed" : "failed")
}), window.location.href);
}
}
</script>
<script src="../Hyphenopoly_Loader.js"></script>
<style type="text/css">
body {
width:50%;
margin-left:25%;
margin-right:25%;
}
.test {
background-color: #D8E2F9;
}
.ref {
background-color: #FEEFC0;
}
.hyphenate {
hyphens: auto;
-ms-hyphens: auto;
-moz-hyphens: auto;
-webkit-hyphens: auto;
}
</style>
</head>
<body>
<div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test38.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test40.html">Next&nbsp;&rarr;</a></div>
<h1>Test 039</h1>
<p id="desc">Focus an element.</p>
<div id="result"></div>
<hr>
<h2>1: en-us</h2>
<input type="text" id="myTextField" value="Text field.">
<div id="test1" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</div>
<div id="ref1" class="ref" lang="en-us">A hy&shy;phen&shy;ation al&shy;go&shy;rithm is a set of rules that de&shy;cides at which points a word can be bro&shy;ken over two lines with a hy&shy;phen.</div>
<hr>
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
</body>
</html>