mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-24 13:49:56 +09:00
merge from 1.6 ( html purifier lib )
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10579 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8943ff97f3
commit
7ea7157ce7
813 changed files with 65203 additions and 0 deletions
51
classes/security/htmlpurifier/smoketests/innerHTML.js
Normal file
51
classes/security/htmlpurifier/smoketests/innerHTML.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
var alphabet = 'a!`=[]\\;\':"/<> &';
|
||||
|
||||
var out = document.getElementById('out');
|
||||
var testContainer = document.getElementById('testContainer');
|
||||
|
||||
function print(s) {
|
||||
out.value += s + "\n";
|
||||
}
|
||||
|
||||
function testImage() {
|
||||
return testContainer.firstChild;
|
||||
}
|
||||
|
||||
function test(input) {
|
||||
var count = 0;
|
||||
var oldInput, newInput;
|
||||
testContainer.innerHTML = "<img />";
|
||||
testImage().setAttribute("alt", input);
|
||||
print("------");
|
||||
print("Test input: " + input);
|
||||
do {
|
||||
oldInput = testImage().getAttribute("alt");
|
||||
var intermediate = testContainer.innerHTML;
|
||||
print("Render: " + intermediate);
|
||||
testContainer.innerHTML = intermediate;
|
||||
if (testImage() == null) {
|
||||
print("Image disappeared...");
|
||||
break;
|
||||
}
|
||||
newInput = testImage().getAttribute("alt");
|
||||
print("New value: " + newInput);
|
||||
count++;
|
||||
} while (count < 5 && newInput != oldInput);
|
||||
if (count == 5) {
|
||||
print("Failed to achieve fixpoint");
|
||||
}
|
||||
testContainer.innerHTML = "";
|
||||
}
|
||||
|
||||
print("Go!");
|
||||
|
||||
test("`` ");
|
||||
test("'' ");
|
||||
|
||||
for (var i = 0; i < alphabet.length; i++) {
|
||||
for (var j = 0; j < alphabet.length; j++) {
|
||||
test(alphabet.charAt(i) + alphabet.charAt(j));
|
||||
}
|
||||
}
|
||||
|
||||
// document.getElementById('out').textContent = alphabet;
|
||||
Loading…
Add table
Add a link
Reference in a new issue