Skip to content
Browse files

Import test data and improve the parser

  • Loading branch information...
1 parent 288f3b5 commit dac0b3b98a65b8ad81e0dbdb602a17de4770897f tomhuda committed Mar 23, 2012
Showing with 93,522 additions and 39 deletions.
  1. +1 −0 .gitignore
  2. +32 −0 .jshintrc
  3. +1 −0 .rspec
  4. +4 −0 Gemfile
  5. +22 −0 Gemfile.lock
  6. +1 −0 Rakefile
  7. +109 −39 parser.js
  8. +41 −0 spec/spec_helper.rb
  9. +51 −0 spec/testdata/encoding/chardet/test_big5.txt
  10. +10 −0 spec/testdata/encoding/test-yahoo-jp.dat
  11. +394 −0 spec/testdata/encoding/tests1.dat
  12. +115 −0 spec/testdata/encoding/tests2.dat
  13. +501 −0 spec/testdata/sanitizer/tests1.dat
  14. +125 −0 spec/testdata/serializer/core.test
  15. +66 −0 spec/testdata/serializer/injectmeta.test
  16. +965 −0 spec/testdata/serializer/optionaltags.test
  17. +60 −0 spec/testdata/serializer/options.test
  18. +51 −0 spec/testdata/serializer/whitespace.test
  19. +1 −0 spec/testdata/sites/google-results.htm
  20. +1 −0 spec/testdata/sites/python-ref-import.htm
  21. +1 −0 spec/testdata/sites/web-apps-old.htm
  22. +34,275 −0 spec/testdata/sites/web-apps.htm
  23. +43 −0 spec/testdata/sniffer/htmlOrFeed.json
  24. +75 −0 spec/testdata/tokenizer/contentModelFlags.test
  25. +90 −0 spec/testdata/tokenizer/domjs.test
  26. +283 −0 spec/testdata/tokenizer/entities.test
  27. +33 −0 spec/testdata/tokenizer/escapeFlag.test
  28. +44,189 −0 spec/testdata/tokenizer/namedEntities.test
  29. +1,313 −0 spec/testdata/tokenizer/numericEntities.test
  30. +7 −0 spec/testdata/tokenizer/pendingSpecChanges.test
  31. +196 −0 spec/testdata/tokenizer/test1.test
  32. +179 −0 spec/testdata/tokenizer/test2.test
  33. +6,047 −0 spec/testdata/tokenizer/test3.test
  34. +344 −0 spec/testdata/tokenizer/test4.test
  35. +1,295 −0 spec/testdata/tokenizer/unicodeChars.test
  36. +27 −0 spec/testdata/tokenizer/unicodeCharsProblematic.test
  37. +22 −0 spec/testdata/tokenizer/xmlViolation.test
  38. +194 −0 spec/testdata/tree-construction/adoption01.dat
  39. +31 −0 spec/testdata/tree-construction/adoption02.dat
  40. +135 −0 spec/testdata/tree-construction/comments01.dat
  41. +370 −0 spec/testdata/tree-construction/doctype01.dat
  42. BIN spec/testdata/tree-construction/domjs-unsafe.dat
  43. +603 −0 spec/testdata/tree-construction/entities01.dat
  44. +249 −0 spec/testdata/tree-construction/entities02.dat
  45. +246 −0 spec/testdata/tree-construction/html5test-com.dat
  46. +43 −0 spec/testdata/tree-construction/inbody01.dat
  47. +40 −0 spec/testdata/tree-construction/isindex.dat
  48. BIN spec/testdata/tree-construction/pending-spec-changes-plain-text-unsafe.dat
  49. +52 −0 spec/testdata/tree-construction/pending-spec-changes.dat
  50. BIN spec/testdata/tree-construction/plain-text-unsafe.dat
  51. +308 −0 spec/testdata/tree-construction/scriptdata01.dat
  52. +15 −0 spec/testdata/tree-construction/scripted/adoption01.dat
  53. +26 −0 spec/testdata/tree-construction/scripted/ark.dat
  54. +28 −0 spec/testdata/tree-construction/scripted/webkit01.dat
  55. +212 −0 spec/testdata/tree-construction/tables01.dat
Sorry, we could not display the entire diff because it was too big.
View
1 .gitignore
@@ -0,0 +1 @@
+html5lib
View
32 .jshintrc
@@ -0,0 +1,32 @@
+{
+ "predef": [
+ "console",
+ "require"
+ ],
+
+ "node" : true,
+ "es5" : true,
+ "browser" : true,
+
+ "boss" : true,
+ "curly": false,
+ "debug": false,
+ "devel": false,
+ "eqeqeq": true,
+ "evil": true,
+ "forin": false,
+ "immed": false,
+ "laxbreak": false,
+ "newcap": true,
+ "noarg": true,
+ "noempty": false,
+ "nonew": false,
+ "nomen": false,
+ "onevar": false,
+ "plusplus": false,
+ "regexp": false,
+ "undef": true,
+ "sub": true,
+ "strict": false,
+ "white": false
+}
View
1 .rspec
@@ -0,0 +1 @@
+-cfs
View
4 Gemfile
@@ -0,0 +1,4 @@
+source "https://rubygems.org"
+
+gem "therubyracer"
+gem "rspec"
View
22 Gemfile.lock
@@ -0,0 +1,22 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ diff-lcs (1.1.3)
+ libv8 (3.3.10.4)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.8.0)
+ therubyracer (0.9.10)
+ libv8 (~> 3.3.10)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rspec
+ therubyracer
View
1 Rakefile
@@ -0,0 +1 @@
+require "bundler/setup"
View
148 parser.js
@@ -24,7 +24,7 @@ Tk.prototype = {
finalize: function() {},
toTest: function() {
- return [ this.testName ];
+ return [ this.name ];
}
};
@@ -72,10 +72,8 @@ var TkStartTag = function(tagName) {
};
TkStartTag.prototype = Object.create(TkTag.prototype);
TkStartTag.prototype.name = "StartTag";
-TkStartTag.prototype.newAttribute = function(name) {
- if (this.attributeName) {
- this.attributes[this.attributeName] = this.attributeValue;
- }
+TkStartTag.prototype.newAttribute = function(name, lexer) {
+ this.finalizeAttribute(lexer);
this.attributeName = name;
this.attributeValue = "";
@@ -86,13 +84,21 @@ TkStartTag.prototype.pushAttributeName = function(char) {
TkStartTag.prototype.pushAttributeValue = function(char) {
this.attributeValue += char;
};
-TkStartTag.prototype.finalize = function() {
+TkStartTag.prototype.finalizeAttribute = function(lexer) {
if (this.attributeName) {
- this.attributes[this.attributeName] = this.attributeValue;
+ if (this.attributes.hasOwnProperty(this.attributeName)) {
+ lexer.tokens.push(new TkError("DuplicateAttribute"));
+ } else {
+ this.attributes[this.attributeName] = this.attributeValue;
+ }
+
delete this.attributeName;
delete this.attributeValue;
}
};
+TkStartTag.prototype.finalize = function(lexer) {
+ this.finalizeAttribute(lexer);
+};
TkStartTag.prototype.toTest = function() {
var tag = [ "StartTag", this.tagName, this.attributes ];
@@ -106,15 +112,22 @@ var TkEndTag = function(tagName) {
};
TkEndTag.prototype = Object.create(TkTag.prototype);
TkEndTag.prototype.name = "endTag";
-TkEndTag.prototype.newAttribute = function() {};
+TkEndTag.prototype.newAttribute = function() {
+ this.sawAttributes = true;
+};
TkEndTag.prototype.pushAttributeName = function() {};
TkEndTag.prototype.pushAttributeValue = function() {};
+TkEndTag.prototype.finalize = function(lexer) {
+ if (this.sawAttributes) {
+ lexer.tokens.push(new TkError("EndTag", "EndTag"));
+ }
+};
TkEndTag.prototype.toTest = function() {
return [ "EndTag", this.tagName ];
};
-var TkComment = function() {
- this.data = "";
+var TkComment = function(data) {
+ this.data = data || "";
};
TkComment.prototype = Object.create(Tk.prototype);
TkComment.prototype.name = "comment";
@@ -160,41 +173,47 @@ states.charRefInData = {
toString: function() { return "charRefInData"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.RCDATA = {
toString: function() { return "RCDATA"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.charRefInRCDATA = {
toString: function() { return "charRefInRCDATA"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.RAWTEXT = {
toString: function() { return "RAWTEXT"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptData = {
toString: function() { return "scriptData"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.PLAINTEXT = {
toString: function() { return "PLAINTEXT"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
@@ -211,10 +230,12 @@ states.tagOpen = {
lexer.setState('tagName');
lexer.setToken(TkStartTag, next.toLowerCase());
} else if (next === "?") {
+ lexer.setToken(TkComment, next);
lexer.errorState('bogusComment');
} else {
lexer.errorState('data');
- lexer.setToken(TkChar, "<");
+ lexer.pushToken(TkChar, "<");
+ lexer.reconsume();
}
});
}
@@ -236,6 +257,7 @@ states.endTagOpen = {
tokens.push(new TkChar("/"));
lexer.reconsume();
} else {
+ lexer.setToken(TkComment, next);
lexer.errorState('bogusComment');
}
});
@@ -273,41 +295,47 @@ states.RCDATALessThan = {
toString: function() { return "RCDATALessThan"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.RCDATAEndTagOpen = {
toString: function() { return "RCDATAEndTagOpen"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.RCDATAEndTagName = {
toString: function() { return "RCDATAEndTagName"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.RAWTEXTLessThan = {
toString: function() { return "RAWTEXTLessThan"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.RAWTEXTEndTagOpen = {
toString: function() { return "RAWTEXTEndTagOpen"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.RAWTEXTEndTagName = {
toString: function() { return "RAWTEXTEndTagName"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
@@ -389,97 +417,111 @@ states.scriptDataEscapeStart = {
toString: function() { return "scriptDataEscapeStart"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataEscapeStartDash = {
toString: function() { return "scriptDataEscapeStartDash"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataEscaped = {
toString: function() { return "scriptDataEscaped"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataEscapedDash = {
toString: function() { return "scriptDataEscapedDash"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataEscapedDashDash = {
toString: function() { return "scriptDataEscapedDashDash"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataEscapedLessThan = {
toString: function() { return "scriptDataEscapedLessThan"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataEscapedEndTagOpen = {
toString: function() { return "scriptDataEscapedEndTagOpen"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataEscapedEndTagName = {
toString: function() { return "scriptDataEscapedEndTagName"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataDoubleEscapeStart = {
toString: function() { return "scriptDataDoubleEscapeStart"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataDoubleEscaped = {
toString: function() { return "scriptDataDoubleEscaped"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataDoubleEscapedDash = {
toString: function() { return "scriptDataDoubleEscapedDash"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataDoubleEscapedDashDash = {
toString: function() { return "scriptDataDoubleEscapedDashDash"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataDoubleEscapedLessThan = {
toString: function() { return "scriptDataDoubleEscapedDashDash"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.scriptDataDoubleEscapeEnd = {
toString: function() { return "scriptDataDoubleEscapeEnd"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
@@ -497,19 +539,19 @@ states.beforeAttributeName = {
lexer.emitCurrentToken();
} else if (/[A-Z]/.test(next)) {
lexer.setState('attributeName');
- token.newAttribute(next.toLowerCase());
+ token.newAttribute(next.toLowerCase(), lexer);
} else if (next === NULL) {
lexer.errorState('attributeName');
- token.newAttribute(REPLACEMENT);
+ token.newAttribute(REPLACEMENT, lexer);
} else if (next === "\"" || next === "'" || next === "<" || next === "=") {
// same as else below
lexer.errorState('attributeName');
- token.newAttribute(next);
+ token.newAttribute(next, lexer);
} else if (next === EOF) {
lexer.errorState('data');
} else {
lexer.setState('attributeName');
- token.newAttribute(next);
+ token.newAttribute(next, lexer);
}
});
}
@@ -563,19 +605,19 @@ states.afterAttributeName = {
lexer.emitCurrentToken();
} else if (/[A-Z]/.test(next)) {
lexer.setState('attributeName');
- token.newAttribute(next.toLowerCase());
+ token.newAttribute(next.toLowerCase(), lexer);
} else if (next === NULL) {
lexer.errorState('attributeName');
- token.newAttribute(REPLACEMENT);
+ token.newAttribute(REPLACEMENT, lexer);
} else if (next === "\"" || next === "'" || next === "<") {
// same as else below
lexer.errorState('attributeName');
- token.newAttribute(next);
+ token.newAttribute(next, lexer);
} else if (next === EOF) {
lexer.errorState('data');
} else {
lexer.setState('attributeName');
- token.newAttribute(next);
+ token.newAttribute(next, lexer);
}
});
}
@@ -721,6 +763,7 @@ states.charRefInAttributeValue = {
toString: function() { return "charRefInAttributeValue"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
@@ -780,6 +823,20 @@ states.bogusComment = {
toString: function() { return "bogusComment"; },
consume: function(lexer) {
+ lexer.consume(function(next, token) {
+ switch (next) {
+ case NULL:
+ token.addChars(REPLACEMENT);
+ break;
+ case EOF:
+ case ">":
+ lexer.setState('data');
+ lexer.emitCurrentToken();
+ break;
+ default:
+ token.addChars(next);
+ }
+ });
}
};
@@ -789,14 +846,15 @@ states.markupDeclarationOpen = {
consume: function(lexer) {
if (lexer.peek(2) === "--") {
lexer.getChars(2);
- lexer.setState('comment');
+ lexer.setState('commentStart');
lexer.setToken(TkComment);
} else if (/DOCTYPE/i.test(lexer.peek(7))) {
lexer.getChars(7);
lexer.setState('DOCTYPE');
} else if (false) /* TODO: current node, not in HTML namespace, matching CDATA */ {
} else {
+ lexer.setToken(TkComment);
lexer.errorState('bogusComment');
}
}
@@ -812,25 +870,26 @@ states.commentStart = {
lexer.setState('commentStartDash');
break;
case ">":
- lexer.parseError();
- token.addChars(REPLACEMENT);
+ lexer.errorState('data');
+ lexer.emitCurrentToken();
break;
case EOF:
lexer.errorState('data');
lexer.emitCurrentToken();
break;
default:
+ lexer.setState('comment');
token.addChars(next);
}
});
}
};
states.commentStartDash = {
- toString: function() { return "commentStart"; },
+ toString: function() { return "commentStartDash"; },
consume: function(lexer) {
- lexer.consume(function() {
+ lexer.consume(function(next, token) {
switch (next) {
case "-":
lexer.setState('commentEnd');
@@ -856,7 +915,7 @@ states.commentStartDash = {
};
states.comment = {
- toString: function() { return "commentStart"; },
+ toString: function() { return "comment"; },
consume: function(lexer) {
lexer.consume(function(next, token) {
@@ -923,7 +982,7 @@ states.commentEnd = {
break;
case "-":
lexer.parseError();
- lexer.addChars("-");
+ token.addChars("-");
break;
case EOF:
lexer.errorState('data');
@@ -1157,80 +1216,91 @@ states.DOCTYPEPublicIdentifierDoubleQuoted = {
toString: function() { return "DOCTYPEPublicIdentifierDoubleQuoted"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.DOCTYPEPublicIdentifierSingleQuoted = {
toString: function() { return "DOCTYPEPublicIdentifierSingleQuoted"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.afterDOCTYPEPublicIdentifier = {
toString: function() { return "afterDOCTYPEPublicIdentifier"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.betweenDOCTYPEPublicAndSystemIdentifier = {
toString: function() { return "betweenDOCTYPEPublicAndSystemIdentifier"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.afterDOCTYPESystemKeyword = {
toString: function() { return "afterDOCTYPESystemKeyword"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.beforeDOCTYPESystemIdentifier = {
toString: function() { return "tagOpen"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.DOCTYPESystemIdentifierDoubleQuoted = {
toString: function() { return "DOCTYPESystemIdentifierDoubleQuoted"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.DOCTYPESystemIdentifierSingleQuoted = {
toString: function() { return "DOCTYPESystemIdentifierSingleQuoted"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.afterDOCTYPESystemIdentifier = {
toString: function() { return "afterDOCTYPESystemIdentifier"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.bogusDOCTYPE = {
toString: function() { return "bogusDOCTYPE"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
states.CDATASection = {
toString: function() { return "CDATASection"; },
consume: function(lexer) {
+ throw "Not implemented";
}
};
-Tokenizer = function(input, strict) {
+var Tokenizer = function (input, strict) {
this.input = input;
this.pos = 0;
this.state = states.data;
@@ -1241,14 +1311,14 @@ Tokenizer = function(input, strict) {
Tokenizer.prototype = {
lex: function() {
var length = this.input.length;
- while (this.pos < length) {
+ while (this.pos <= length) {
this.state.consume(this);
}
},
parseError: function(toState) {
if (this.strict) {
- msg = "Parse Error in " + this.state.toString() + " going to ";
+ var msg = "Parse Error in " + this.state.toString() + " going to ";
msg += toState || this.state.toString();
msg += " tokens so far: " + this.tokens.map(function(token) { return token.toTest(); });
throw msg;
@@ -1271,12 +1341,12 @@ Tokenizer.prototype = {
this.setState(state);
},
- setToken: function(token, param) {
- this.token = new token(param);
+ setToken: function(TokenClass, param) {
+ this.token = new TokenClass(param);
},
- pushToken: function(token, param) {
- this.token = new token(param);
+ pushToken: function(TokenClass, param) {
+ this.token = new TokenClass(param);
this.emitCurrentToken();
},
@@ -1309,15 +1379,15 @@ Tokenizer.prototype = {
},
emitCurrentToken: function() {
- this.token.finalize();
+ this.token.finalize(this);
this.tokens.push(this.token);
this.token = null;
}
};
-var input = "<div id='1' class=foo>hi</div><!-- hi --><p><!-- bye --></p><span style=zomg zomg>";
-input = "<h a='b'c='d'><!-- foo -->bar";
-var lexer = new Tokenizer(input);
-lexer.lex();
+exports.Tokenizer = Tokenizer;
+//var input = "<div id='1' class=foo>hi</div><!-- hi --><p><!-- bye --></p><span style=zomg zomg>";
+//var lexer = new Tokenizer(input);
+//lexer.lex();
-console.log(lexer.tokens.map(function(token) { return token.toTest(); }));
+//console.log(lexer.tokens.map(function(token) { return token.toTest(); }));
View
41 spec/spec_helper.rb
@@ -0,0 +1,41 @@
+require "v8"
+
+class TokenizerTest
+ def initialize
+ @context = V8::Context.new
+ @context['console'] = { "log" => lambda { |string| puts string } }
+
+ parser = File.expand_path("../../parser.js", __FILE__)
+ exports = @context.eval "(function(exports) { #{File.read(parser)}; return exports; })({})", "parser.js"
+ @tokenizer = exports['Tokenizer']
+ end
+
+ def tokenize(string)
+ tokenizer = @tokenizer.new(string)
+ tokenizer.lex
+ tokens = tokenizer.tokens
+
+ tokens.inject([]) do |arr, token|
+ test_value = token.toTest
+
+ next arr if test_value.is_a?(V8::Array) && test_value.first == "EOF"
+
+ if test_value.is_a?(V8::Array)
+ arr << test_value.map do |item|
+ item = js_to_hash(item) if item.instance_of?(V8::Object)
+ item
+ end
+ else
+ arr << test_value
+ end
+
+ arr
+ end
+ end
+
+
+ def js_to_hash(js)
+ Hash[*js.to_a.flatten]
+ end
+end
+
View
51 spec/testdata/encoding/chardet/test_big5.txt
@@ -0,0 +1,51 @@
+�Ѥl�m�D�w�g�n �Ĥ@~�|�Q��
+
+�Ѥl�D�g
+
+�Ĥ@��
+
+�D�i�D�A�D�`�D�C�W�i�W�A�D�`�W�C�L�A�W�Ѧa���l�Q���A�W�U������C
+�G�`�L�A��H�[�䧮�F�`���A��H�[���u�C����̡A�P�X�Ӳ��W�A�P�פ�
+�ȡC�Ȥ��S�ȡA��������C
+
+�ĤG��
+
+�ѤU�Ҫ����A���c�o�Q�Ҫ����������A�������o�C�G���L�ۥ͡A��
+��ۦ��A��u�ۧΡA���U�۶ɡA���n�۩M�A�e����H�C�O�H�t�H�B�u�L��
+�v���ơA��u�����v���СC�U���@�j�Ӥ���A�ͦӤ����A���Ӥ���A�\��
+�ӥ��~�C�Ұߥ��~�A�O�H���h�C
+
+�ĤT��
+
+���|��A�ϥ�����Q���Q��o���f�A�ϥ�����s�Q�����i��A�ϥ�ߤ���
+�C�O�H�u�t�H�v���v�A���ߡA��両�A�z��ӡA�j�䰩�C�`�ϥ�L���L
+��C�ϤҴ��̤������]�C���u�L���v�A�h�L���v�C
+
+�ĥ|��
+
+�u�D�v�R�A�ӥΤ��Τ��աC�W���A��U�����v�Q���U�A�Ѩ�ɡA�M���
+�A�P��СQ�祿��Φs�C�^�����֤��l�H�H�Ҥ���C
+
+�Ĥ���
+
+�Ѧa�����A�H�U�����쪯�Q�t�H�����A�H�ʩm���쪯�C�Ѧa�����A��S��
+���G�H��Ӥ��}�A�ʦӷU�X�C�h���ƽa�A���p�u���C
+
+�Ĥ���
+
+���������A�O�ץȦɡC�Ȧɤ���A�O�פѦa�ڡC���Y�s�A�Τ����ԡC
+
+�ĤC��
+
+�Ѫ�a�[�C�Ѧa�ҥH���B�[�̡A�H�䤣�ۥ͡A�G���[�C�O�H�t�H���
+���Ө���A�~�䨭�Ө��s�C�D�H��L�p���H�G�ন��p�C
+
+�ĤK��
+
+�W���Y��C��Q�U���Ӥ����C�B���H���Ҵc�A�G�X��D�C�~���a�A�ߵ�
+�W�A�P�����A�����H�A�F���v�A�Ƶ���A�ʵ��ɡC�Ұߤ����A�G�L�סC
+
+�ĤE��
+
+��Ӭդ��A���p��w�Q���ӾU���A���i��O�C��ɺ���A���u�Q�I�Q
+��ź�A�ۿ��S�C�\�E���h�A�Ѥ��D�C
View
10 spec/testdata/encoding/test-yahoo-jp.dat
@@ -0,0 +1,10 @@
+#data
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=euc-jp">
+<!--京-->
+<title>Yahoo! JAPAN</title>
+<meta name="description" content="日本最大級のポータルサイト。検索、オークション、ニュース、メール、コミュニティ、ショッピング、など80以上のサービスを展開。あなたの生活をより豊かにする「ライフ・エンジン」を目指していきます。">
+<style type="text/css" media="all">
+#encoding
+euc_jp
View
394 spec/testdata/encoding/tests1.dat
@@ -0,0 +1,394 @@
+#data
+<!DOCTYPE HTML>
+<!-- (control test - for the other tests to work, this should pass - you may have to set your defaults appropriately) -->
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-1">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta charset="iso8859-2">
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta charset='iso8859-2'>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta charset=iso8859-2>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta
+charset=iso8859-2>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<metacharset=iso8859-2>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content="text/html; charset=iso8859-2">
+<!-- XXX this is a tough one, not sure how to do this one, unless we explictly do content= processing -->
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta content="text/html; charset=iso8859-2" http-equiv="Content-Type">
+<!-- XXX this is a tough one, not sure how to do this one, unless we explictly do content= processing -->
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type" content=text/html; charset=iso8859-2>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type content="text/html; charset=iso8859-2">
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type " content="text/html; charset=iso8859-2">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta content="text/html; charset=iso8859-2" http-equiv="Content-Type ">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Type>" content="text/html; charset=iso8859-2">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta content="text/html; charset=iso8859-2" http-equiv="Content-Type>">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta http-equiv="Content-Style-Type" content="text/html; charset=iso8859-2">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta content="text/html; charset=iso8859-2" http-equiv="Content-Style-Type">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta name="Content-Style-Type" content="text/html; charset=iso8859-2">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta content="text/html; charset=iso8859-2" name="Content-Style-Type">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta content="text/html; charset=iso8859-2">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta content=" text/html; charset = iso8859-2 ">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta content="
+text/html; charset=iso8859-2
+" http-equiv="Content-Type">
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta charset="
+iso8859-2
+">
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta charset=
+iso8859-2
+>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta charset="iso8859-2>
+<p>"</p>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta charset=iso8859-2">
+<p>"</p>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta " charset=iso8859-2>
+<p>"</p>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta test" charset=iso8859-2>
+<p>"</p>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta test=" charset=iso8859-2>
+<p>"</p>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta test="' charset=iso8859-2>
+<p>"'</p>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta test='" charset=iso8859-2>
+<p>'"</p>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta test="" charset=iso8859-2>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta test=x" charset=iso8859-2>
+<p>"</p>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<head></head><p title="x>
+<meta test=x" charset=iso8859-2>
+<p>"</p>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<head></head><p title="x>
+<meta test=x charset=iso8859-2>
+<p>"</p>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<head></head><p title="x>
+<meta charset=iso8859-2>
+<p>"</p>
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<head></head><p title="x>">
+<meta charset=iso8859-2>
+<p>"</p>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-1">
+<meta charset="iso8859-2">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<meta charset="iso8859-2">
+<meta charset="ISO-8859-1">
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<!--<meta charset="ISO-8859-1">-->
+<meta charset="iso8859-2">
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<!--<meta charset="iso8859-2">-->
+<meta charset="ISO-8859-1">
+#encoding
+Windows-1252
+
+#data
+<!DOCTYPE HTML>
+<!-- Starts with UTF-8 BOM -->
+#encoding
+UTF-8
+
+#data
+<!DOCTYPE HTML>
+<meta charset="ISO-8859-1">
+<!-- Starts with UTF-8 BOM -->
+#encoding
+UTF-8
+
+#data
+<!-- 511 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
+<meta charset="iso8859-2">
+#encoding
+iso8859-2
+
+#data
+<!-- 512 characters xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz-->
+<meta charset="iso8859-2">
+#encoding
+iso8859-2
+
+#data
+<!-- multi-script test -->
+<script>alert('step 1 of 3 ("þ")')</script>
+<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
+<script>alert('step 2 of 3 ("þ")')</script>
+<meta charset="iso8859-2">
+<script>alert('step 3 of 3 ("þ")')</script>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<script>document.write('<meta charset="ISO-8859-' + '2">')</script>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<script>document.write('<meta charset="iso8859-2">')</script>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<script type="text/plain"><meta charset="iso8859-2"></script>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<style type="text/plain"><meta charset="iso8859-2"></style>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<p><meta charset="iso8859-2"></p>
+#encoding
+iso8859-2
+
+#data
+<!DOCTYPE HTML>
+<meta charset="bogus">
+<meta charset="iso8859-2">
+#encoding
+iso8859-2
View
115 spec/testdata/encoding/tests2.dat
@@ -0,0 +1,115 @@
+#data
+<meta
+#encoding
+windows-1252
+
+#data
+<
+#encoding
+windows-1252
+
+#data
+<!
+#encoding
+windows-1252
+
+#data
+<meta charset = "
+#encoding
+windows-1252
+
+#data
+<meta charset=euc_jp
+#encoding
+windows-1252
+
+#data
+<meta <meta charset='euc_jp'>
+#encoding
+euc_jp
+
+#data
+<meta charset = 'euc_jp'>
+#encoding
+euc_jp
+
+#data
+<!-- -->
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+#encoding
+utf-8
+
+#data
+<!-- -->
+<meta http-equiv="Content-Type" content="text/html; charset=utf
+#encoding
+windows-1252
+
+#data
+<meta http-equiv="Content-Type<meta charset="utf-8">
+#encoding
+windows-1252
+
+#data
+<meta http-equiv="Content-Type" content="text/html; charset='utf-8'">
+#encoding
+utf-8
+
+#data
+<meta http-equiv="Content-Type" content="text/html; charset='utf-8">
+#encoding
+windows-1252
+
+#data
+<meta
+#encoding
+windows-1252
+
+#data
+<meta charset =
+#encoding
+windows-1252
+
+#data
+<meta charset= utf-8
+>
+#encoding
+utf-8
+
+#data
+<meta content = "text/html;
+#encoding
+windows-1252
+
+#data
+<meta charset="UTF-16">
+#encoding
+utf-8
+
+#data
+<meta charset="UTF-16LE">
+#encoding
+utf-8
+
+#data
+<meta charset="UTF-16BE">
+#encoding
+utf-8
+
+#data
+<html a=ñ>
+<meta charset="utf-8">
+#encoding
+utf-8
+
+#data
+<html ñ>
+<meta charset="utf-8">
+#encoding
+utf-8
+
+#data
+<html>ñ
+<meta charset="utf-8">
+#encoding
+utf-8
View
501 spec/testdata/sanitizer/tests1.dat
@@ -0,0 +1,501 @@
+[
+ {
+ "name": "IE_Comments",
+ "input": "<!--[if gte IE 4]><script>alert('XSS');</script><![endif]-->",
+ "output": ""
+ },
+
+ {
+ "name": "IE_Comments_2",
+ "input": "<![if !IE 5]><script>alert('XSS');</script><![endif]>",
+ "output": "&lt;script&gt;alert('XSS');&lt;/script&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "allow_colons_in_path_component",
+ "input": "<a href=\"./this:that\">foo</a>",
+ "output": "<a href='./this:that'>foo</a>"
+ },
+
+ {
+ "name": "background_attribute",
+ "input": "<div background=\"javascript:alert('XSS')\"></div>",
+ "output": "<div/>",
+ "xhtml": "<div></div>",
+ "rexml": "<div></div>"
+ },
+
+ {
+ "name": "bgsound",
+ "input": "<bgsound src=\"javascript:alert('XSS');\" />",
+ "output": "&lt;bgsound src=\"javascript:alert('XSS');\"/&gt;",
+ "rexml": "&lt;bgsound src=\"javascript:alert('XSS');\"&gt;&lt;/bgsound&gt;"
+ },
+
+ {
+ "name": "div_background_image_unicode_encoded",
+ "input": "<div style=\"background-image:\u00a5\u00a2\u006C\u0028'\u006a\u0061\u00a6\u0061\u00a3\u0063\u00a2\u0069\u00a0\u00a4\u003a\u0061\u006c\u0065\u00a2\u00a4\u0028.1027\u0058.1053\u0053\u0027\u0029'\u0029\">foo</div>",
+ "output": "<div style=''>foo</div>"
+ },
+
+ {
+ "name": "div_expression",
+ "input": "<div style=\"width: expression(alert('XSS'));\">foo</div>",
+ "output": "<div style=''>foo</div>"
+ },
+
+ {
+ "name": "double_open_angle_brackets",
+ "input": "<img src=http://ha.ckers.org/scriptlet.html <",
+ "output": "<img src='http://ha.ckers.org/scriptlet.html'>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "double_open_angle_brackets_2",
+ "input": "<script src=http://ha.ckers.org/scriptlet.html <",
+ "output": "&lt;script src=\"http://ha.ckers.org/scriptlet.html\" &lt;=\"\"&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "grave_accents",
+ "input": "<img src=`javascript:alert('XSS')` />",
+ "output": "<img/>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "img_dynsrc_lowsrc",
+ "input": "<img dynsrc=\"javascript:alert('XSS')\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "img_vbscript",
+ "input": "<img src='vbscript:msgbox(\"XSS\")' />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "input_image",
+ "input": "<input type=\"image\" src=\"javascript:alert('XSS');\" />",
+ "output": "<input type='image'/>",
+ "rexml": "<input type='image' />"
+ },
+
+ {
+ "name": "link_stylesheets",
+ "input": "<link rel=\"stylesheet\" href=\"javascript:alert('XSS');\" />",
+ "output": "&lt;link rel=\"stylesheet\" href=\"javascript:alert('XSS');\"/&gt;",
+ "rexml": "&lt;link href=\"javascript:alert('XSS');\" rel=\"stylesheet\"/&gt;"
+ },
+
+ {
+ "name": "link_stylesheets_2",
+ "input": "<link rel=\"stylesheet\" href=\"http://ha.ckers.org/xss.css\" />",
+ "output": "&lt;link rel=\"stylesheet\" href=\"http://ha.ckers.org/xss.css\"/&gt;",
+ "rexml": "&lt;link href=\"http://ha.ckers.org/xss.css\" rel=\"stylesheet\"/&gt;"
+ },
+
+ {
+ "name": "list_style_image",
+ "input": "<li style=\"list-style-image: url(javascript:alert('XSS'))\">foo</li>",
+ "output": "<li style=''>foo</li>"
+ },
+
+ {
+ "name": "no_closing_script_tags",
+ "input": "<script src=http://ha.ckers.org/xss.js?<b>",
+ "output": "&lt;script src=\"http://ha.ckers.org/xss.js?&amp;lt;b\"&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "non_alpha_non_digit",
+ "input": "<script/XSS src=\"http://ha.ckers.org/xss.js\"></script>",
+ "output": "&lt;script XSS=\"\" src=\"http://ha.ckers.org/xss.js\"&gt;&lt;/script&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "non_alpha_non_digit_2",
+ "input": "<a onclick!\\#$%&()*~+-_.,:;?@[/|\\]^`=alert(\"XSS\")>foo</a>",
+ "output": "<a>foo</a>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "non_alpha_non_digit_3",
+ "input": "<img/src=\"http://ha.ckers.org/xss.js\"/>",
+ "output": "<img src='http://ha.ckers.org/xss.js'/>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "non_alpha_non_digit_II",
+ "input": "<a href!\\#$%&()*~+-_.,:;?@[/|]^`=alert('XSS')>foo</a>",
+ "output": "<a>foo</a>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "non_alpha_non_digit_III",
+ "input": "<a/href=\"javascript:alert('XSS');\">foo</a>",
+ "output": "<a>foo</a>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "platypus",
+ "input": "<a href=\"http://www.ragingplatypus.com/\" style=\"display:block; position:absolute; left:0; top:0; width:100%; height:100%; z-index:1; background-color:black; background-image:url(http://www.ragingplatypus.com/i/cam-full.jpg); background-x:center; background-y:center; background-repeat:repeat;\">never trust your upstream platypus</a>",
+ "output": "<a href='http://www.ragingplatypus.com/' style='display: block; width: 100%; height: 100%; background-color: black; background-x: center; background-y: center;'>never trust your upstream platypus</a>"
+ },
+
+ {
+ "name": "protocol_resolution_in_script_tag",
+ "input": "<script src=//ha.ckers.org/.j></script>",
+ "output": "&lt;script src=\"//ha.ckers.org/.j\"&gt;&lt;/script&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_allow_anchors",
+ "input": "<a href='foo' onclick='bar'><script>baz</script></a>",
+ "output": "<a href='foo'>&lt;script&gt;baz&lt;/script&gt;</a>"
+ },
+
+ {
+ "name": "should_allow_image_alt_attribute",
+ "input": "<img alt='foo' onclick='bar' />",
+ "output": "<img alt='foo'/>",
+ "rexml": "<img alt='foo' />"
+ },
+
+ {
+ "name": "should_allow_image_height_attribute",
+ "input": "<img height='foo' onclick='bar' />",
+ "output": "<img height='foo'/>",
+ "rexml": "<img height='foo' />"
+ },
+
+ {
+ "name": "should_allow_image_src_attribute",
+ "input": "<img src='foo' onclick='bar' />",
+ "output": "<img src='foo'/>",
+ "rexml": "<img src='foo' />"
+ },
+
+ {
+ "name": "should_allow_image_width_attribute",
+ "input": "<img width='foo' onclick='bar' />",
+ "output": "<img width='foo'/>",
+ "rexml": "<img width='foo' />"
+ },
+
+ {
+ "name": "should_handle_blank_text",
+ "input": "",
+ "output": ""
+ },
+
+ {
+ "name": "should_handle_malformed_image_tags",
+ "input": "<img \"\"\"><script>alert(\"XSS\")</script>\">",
+ "output": "<img/>&lt;script&gt;alert(\"XSS\")&lt;/script&gt;\"&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_handle_non_html",
+ "input": "abc",
+ "output": "abc"
+ },
+
+ {
+ "name": "should_not_fall_for_ridiculous_hack",
+ "input": "<img\nsrc\n=\n\"\nj\na\nv\na\ns\nc\nr\ni\np\nt\n:\na\nl\ne\nr\nt\n(\n'\nX\nS\nS\n'\n)\n\"\n />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_0",
+ "input": "<img src=\"javascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_1",
+ "input": "<img src=javascript:alert('XSS') />",
+ "output": "<img/>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_10",
+ "input": "<img src=\"jav&#x0A;ascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_11",
+ "input": "<img src=\"jav&#x0D;ascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_12",
+ "input": "<img src=\" &#14; javascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_13",
+ "input": "<img src=\"&#x20;javascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_14",
+ "input": "<img src=\"&#xA0;javascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_2",
+ "input": "<img src=\"JaVaScRiPt:alert('XSS')\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_3",
+ "input": "<img src='javascript:alert(&quot;XSS&quot;)' />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_4",
+ "input": "<img src='javascript:alert(String.fromCharCode(88,83,83))' />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_5",
+ "input": "<img src='&#106;&#97;&#118;&#97;&#115;&#99;&#114;&#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;&#40;&#39;&#88;&#83;&#83;&#39;&#41;' />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_6",
+ "input": "<img src='&#0000106;&#0000097;&#0000118;&#0000097;&#0000115;&#0000099;&#0000114;&#0000105;&#0000112;&#0000116;&#0000058;&#0000097;&#0000108;&#0000101;&#0000114;&#0000116;&#0000040;&#0000039;&#0000088;&#0000083;&#0000083;&#0000039;&#0000041' />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_7",
+ "input": "<img src='&#x6A;&#x61;&#x76;&#x61;&#x73;&#x63;&#x72;&#x69;&#x70;&#x74;&#x3A;&#x61;&#x6C;&#x65;&#x72;&#x74;&#x28;&#x27;&#x58;&#x53;&#x53;&#x27;&#x29' />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_8",
+ "input": "<img src=\"jav\tascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_not_fall_for_xss_image_hack_9",
+ "input": "<img src=\"jav&#x09;ascript:alert('XSS');\" />",
+ "output": "<img/>",
+ "rexml": "<img />"
+ },
+
+ {
+ "name": "should_sanitize_half_open_scripts",
+ "input": "<img src=\"javascript:alert('XSS')\"",
+ "output": "<img/>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_sanitize_invalid_script_tag",
+ "input": "<script/XSS SRC=\"http://ha.ckers.org/xss.js\"></script>",
+ "output": "&lt;script XSS=\"\" SRC=\"http://ha.ckers.org/xss.js\"&gt;&lt;/script&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_sanitize_script_tag_with_multiple_open_brackets",
+ "input": "<<script>alert(\"XSS\");//<</script>",
+ "output": "&lt;&lt;script&gt;alert(\"XSS\");//&lt;&lt;/script&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_sanitize_script_tag_with_multiple_open_brackets_2",
+ "input": "<iframe src=http://ha.ckers.org/scriptlet.html\n<",
+ "output": "&lt;iframe src=\"http://ha.ckers.org/scriptlet.html\" &lt;=\"\"&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_sanitize_tag_broken_up_by_null",
+ "input": "<scr\u0000ipt>alert(\"XSS\")</scr\u0000ipt>",
+ "output": "&lt;scr\ufffdipt&gt;alert(\"XSS\")&lt;/scr\ufffdipt&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_sanitize_unclosed_script",
+ "input": "<script src=http://ha.ckers.org/xss.js?<b>",
+ "output": "&lt;script src=\"http://ha.ckers.org/xss.js?&amp;lt;b\"&gt;",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "should_strip_href_attribute_in_a_with_bad_protocols",
+ "input": "<a href=\"javascript:XSS\" title=\"1\">boo</a>",
+ "output": "<a title='1'>boo</a>"
+ },
+
+ {
+ "name": "should_strip_href_attribute_in_a_with_bad_protocols_and_whitespace",
+ "input": "<a href=\" javascript:XSS\" title=\"1\">boo</a>",
+ "output": "<a title='1'>boo</a>"
+ },
+
+ {
+ "name": "should_strip_src_attribute_in_img_with_bad_protocols",
+ "input": "<img src=\"javascript:XSS\" title=\"1\">boo</img>",
+ "output": "<img title='1'/>boo",
+ "rexml": "<img title='1' />"
+ },
+
+ {
+ "name": "should_strip_src_attribute_in_img_with_bad_protocols_and_whitespace",
+ "input": "<img src=\" javascript:XSS\" title=\"1\">boo</img>",
+ "output": "<img title='1'/>boo",
+ "rexml": "<img title='1' />"
+ },
+
+ {
+ "name": "xml_base",
+ "input": "<div xml:base=\"javascript:alert('XSS');//\">foo</div>",
+ "output": "<div>foo</div>"
+ },
+
+ {
+ "name": "xul",
+ "input": "<p style=\"-moz-binding:url('http://ha.ckers.org/xssmoz.xml#xss')\">fubar</p>",
+ "output": "<p style=''>fubar</p>"
+ },
+
+ {
+ "name": "quotes_in_attributes",
+ "input": "<img src='foo' title='\"foo\" bar' />",
+ "rexml": "<img src='foo' title='\"foo\" bar' />",
+ "output": "<img title='&quot;foo&quot; bar' src='foo'/>"
+ },
+
+ {
+ "name": "uri_refs_in_svg_attributes",
+ "input": "<rect fill='url(#foo)' />",
+ "rexml": "<rect fill='url(#foo)'></rect>",
+ "xhtml": "<rect fill='url(#foo)'></rect>",
+ "output": "<rect fill='url(#foo)'/>"
+ },
+
+ {
+ "name": "absolute_uri_refs_in_svg_attributes",
+ "input": "<rect fill='url(http://bad.com/) #fff' />",
+ "rexml": "<rect fill=' #fff'></rect>",
+ "xhtml": "<rect fill=' #fff'></rect>",
+ "output": "<rect fill=' #fff'/>"
+ },
+
+ {
+ "name": "uri_ref_with_space_in svg_attribute",
+ "input": "<rect fill='url(\n#foo)' />",
+ "rexml": "<rect fill='url(\n#foo)'></rect>",
+ "xhtml": "<rect fill='url(\n#foo)'></rect>",
+ "output": "<rect fill='url(\n#foo)'/>"
+ },
+
+ {
+ "name": "absolute_uri_ref_with_space_in svg_attribute",
+ "input": "<rect fill=\"url(\nhttp://bad.com/)\" />",
+ "rexml": "<rect fill=' '></rect>",
+ "xhtml": "<rect fill=' '></rect>",
+ "output": "<rect fill=' '/>"
+ },
+
+ {
+ "name": "allow_html5_image_tag",
+ "input": "<image src='foo' />",
+ "rexml": "&lt;image src=\"foo\"&gt;&lt;/image&gt;",
+ "output": "&lt;image src=\"foo\"/&gt;"
+ },
+
+ {
+ "name": "style_attr_end_with_nothing",
+ "input": "<div style=\"color: blue\" />",
+ "output": "<div style='color: blue;'/>",
+ "xhtml": "<div style='color: blue;'></div>",
+ "rexml": "<div style='color: blue;'></div>"
+ },
+
+ {
+ "name": "style_attr_end_with_space",
+ "input": "<div style=\"color: blue \" />",
+ "output": "<div style='color: blue ;'/>",
+ "xhtml": "<div style='color: blue ;'></div>",
+ "rexml": "<div style='color: blue ;'></div>"
+ },
+
+ {
+ "name": "style_attr_end_with_semicolon",
+ "input": "<div style=\"color: blue;\" />",
+ "output": "<div style='color: blue;'/>",
+ "xhtml": "<div style='color: blue;'></div>",
+ "rexml": "<div style='color: blue;'></div>"
+ },
+
+ {
+ "name": "style_attr_end_with_semicolon_space",
+ "input": "<div style=\"color: blue; \" />",
+ "output": "<div style='color: blue;'/>",
+ "xhtml": "<div style='color: blue;'></div>",
+ "rexml": "<div style='color: blue;'></div>"
+ },
+
+ {
+ "name": "attributes_with_embedded_quotes",
+ "input": "<img src=doesntexist.jpg\"'onerror=\"alert(1) />",
+ "output": "<img src='doesntexist.jpg&quot;&apos;onerror=&quot;alert(1)'/>",
+ "rexml": "Ill-formed XHTML!"
+ },
+
+ {
+ "name": "attributes_with_embedded_quotes_II",
+ "input": "<img src=notthere.jpg\"\"onerror=\"alert(2) />",
+ "output": "<img src='notthere.jpg&quot;&quot;onerror=&quot;alert(2)'/>",
+ "rexml": "Ill-formed XHTML!"
+ }
+]
View
125 spec/testdata/serializer/core.test
@@ -0,0 +1,125 @@
+{"tests": [
+
+{"description": "proper attribute value escaping",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "test \"with\" &quot;"}]]],
+ "expected": ["<span title='test \"with\" &amp;quot;'>"]
+},
+
+{"description": "proper attribute value non-quoting",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo"}]]],
+ "expected": ["<span title=foo>"],
+ "xhtml": ["<span title=\"foo\">"]
+},
+
+{"description": "proper attribute value non-quoting (with <)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo<bar"}]]],
+ "expected": ["<span title=foo<bar>"],
+ "xhtml": ["<span title=\"foo&lt;bar\">"]
+},
+
+{"description": "proper attribute value quoting (with =)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo=bar"}]]],
+ "expected": ["<span title=\"foo=bar\">"]
+},
+
+{"description": "proper attribute value quoting (with >)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo>bar"}]]],
+ "expected": ["<span title=\"foo>bar\">"]
+},
+
+{"description": "proper attribute value quoting (with \")",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo\"bar"}]]],
+ "expected": ["<span title='foo\"bar'>"]
+},
+
+{"description": "proper attribute value quoting (with ')",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo'bar"}]]],
+ "expected": ["<span title=\"foo'bar\">"]
+},
+
+{"description": "proper attribute value quoting (with both \" and ')",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo'bar\"baz"}]]],
+ "expected": ["<span title=\"foo'bar&quot;baz\">"]
+},
+
+{"description": "proper attribute value quoting (with space)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo bar"}]]],
+ "expected": ["<span title=\"foo bar\">"]
+},
+
+{"description": "proper attribute value quoting (with tab)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo\tbar"}]]],
+ "expected": ["<span title=\"foo\tbar\">"]
+},
+
+{"description": "proper attribute value quoting (with LF)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo\nbar"}]]],
+ "expected": ["<span title=\"foo\nbar\">"]
+},
+
+{"description": "proper attribute value quoting (with CR)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo\rbar"}]]],
+ "expected": ["<span title=\"foo\rbar\">"]
+},
+
+{"description": "proper attribute value non-quoting (with linetab)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo\u000Bbar"}]]],
+ "expected": ["<span title=foo\u000Bbar>"],
+ "xhtml": ["<span title=\"foo\u000Bbar\">"]
+},
+
+{"description": "proper attribute value quoting (with form feed)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "span", [{"namespace": null, "name": "title", "value": "foo\u000Cbar"}]]],
+ "expected": ["<span title=\"foo\u000Cbar\">"]
+},
+
+{"description": "void element (as EmptyTag token)",
+ "input": [["EmptyTag", "img", {}]],
+ "expected": ["<img>"],
+ "xhtml": ["<img />"]
+},
+
+{"description": "void element (as StartTag token)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "img", {}]],
+ "expected": ["<img>"],
+ "xhtml": ["<img />"]
+},
+
+{"description": "doctype in error",
+ "input": [["Doctype", "foo"]],
+ "expected": ["<!DOCTYPE foo>"]
+},
+
+{"description": "character data",
+ "options": {"encoding":"utf-8"},
+ "input": [["Characters", "a<b>c&d"]],
+ "expected": ["a&lt;b&gt;c&amp;d"]
+},
+
+{"description": "rcdata",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "script", {}], ["Characters", "a<b>c&d"]],
+ "expected": ["<script>a<b>c&d"],
+ "xhtml": ["<script>a&lt;b&gt;c&amp;d"]
+},
+
+{"description": "doctype",
+ "input": [["Doctype", "HTML"]],
+ "expected": ["<!DOCTYPE HTML>"]
+},
+
+{"description": "HTML 4.01 DOCTYPE",
+ "input": [["Doctype", "HTML", "-//W3C//DTD HTML 4.01//EN", "http://www.w3.org/TR/html4/strict.dtd"]],
+ "expected": ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">"]
+},
+
+{"description": "HTML 4.01 DOCTYPE without system identifer",
+ "input": [["Doctype", "HTML", "-//W3C//DTD HTML 4.01//EN"]],
+ "expected": ["<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">"]
+},
+
+{"description": "IBM DOCTYPE without public identifer",
+ "input": [["Doctype", "html", "", "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"]],
+ "expected": ["<!DOCTYPE html SYSTEM \"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd\">"]
+}
+
+]}
View
66 spec/testdata/serializer/injectmeta.test
@@ -0,0 +1,66 @@
+{"tests": [
+
+{"description": "no encoding",
+ "options": {"inject_meta_charset": true},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": [""],
+ "xhtml": ["<head></head>"]
+},
+
+{"description": "empytag head",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta charset=utf-8>"],
+ "xhtml": ["<head><meta charset=\"utf-8\" /></head>"]
+},
+
+{"description": "head w/title",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["StartTag", "http://www.w3.org/1999/xhtml","title",{}], ["Characters", "foo"],["EndTag", "http://www.w3.org/1999/xhtml", "title"], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta charset=utf-8><title>foo</title>"],
+ "xhtml": ["<head><meta charset=\"utf-8\" /><title>foo</title></head>"]
+},
+
+{"description": "head w/meta-charset",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag","meta",[{"namespace": null, "name": "charset", "value": "ascii"}]], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta charset=utf-8>"],
+ "xhtml": ["<head><meta charset=\"utf-8\" /></head>"]
+},
+
+{"description": "head w/ two meta-charset",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag","meta",[{"namespace": null, "name": "charset", "value": "ascii"}]], ["EmptyTag","meta",[{"namespace": null, "name": "charset", "value": "ascii"}]], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta charset=utf-8><meta charset=utf-8>", "<head><meta charset=utf-8><meta charset=ascii>"],
+ "xhtml": ["<head><meta charset=\"utf-8\" /><meta charset=\"utf-8\" /></head>", "<head><meta charset=\"utf-8\" /><meta charset=\"ascii\" /></head>"]
+},
+
+{"description": "head w/robots",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag","meta",[{"namespace": null, "name": "name", "value": "robots"},{"namespace": null, "name": "content", "value": "noindex"}]], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta charset=utf-8><meta content=noindex name=robots>"],
+ "xhtml": ["<head><meta charset=\"utf-8\" /><meta content=\"noindex\" name=\"robots\" /></head>"]
+},
+
+{"description": "head w/robots & charset",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag","meta",[{"namespace": null, "name": "name", "value": "robots"},{"namespace": null, "name": "content", "value": "noindex"}]], ["EmptyTag","meta",[{"namespace": null, "name": "charset", "value": "ascii"}]], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta content=noindex name=robots><meta charset=utf-8>"],
+ "xhtml": ["<head><meta content=\"noindex\" name=\"robots\" /><meta charset=\"utf-8\" /></head>"]
+},
+
+{"description": "head w/ charset in http-equiv content-type",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag","meta",[{"namespace": null, "name": "http-equiv", "value": "content-type"}, {"namespace": null, "name": "content", "value": "text/html; charset=ascii"}]], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta content=\"text/html; charset=utf-8\" http-equiv=content-type>"],
+ "xhtml": ["<head><meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\" /></head>"]
+},
+
+{"description": "head w/robots & charset in http-equiv content-type",
+ "options": {"inject_meta_charset": true, "encoding":"utf-8"},
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag","meta",[{"namespace": null, "name": "name", "value": "robots"},{"namespace": null, "name": "content", "value": "noindex"}]], ["EmptyTag","meta",[{"namespace": null, "name": "http-equiv", "value": "content-type"}, {"namespace": null, "name": "content", "value": "text/html; charset=ascii"}]], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": ["<meta content=noindex name=robots><meta content=\"text/html; charset=utf-8\" http-equiv=content-type>"],
+ "xhtml": ["<head><meta content=\"noindex\" name=\"robots\" /><meta content=\"text/html; charset=utf-8\" http-equiv=\"content-type\" /></head>"]
+}
+
+]}
View
965 spec/testdata/serializer/optionaltags.test
@@ -0,0 +1,965 @@
+{"tests": [
+
+{"description": "html start-tag followed by text, with attributes",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", [{"namespace": null, "name": "lang", "value": "en"}]], ["Characters", "foo"]],
+ "expected": ["<html lang=en>foo"]
+},
+
+
+
+{"description": "html start-tag followed by comment",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["Comment", "foo"]],
+ "expected": ["<html><!--foo-->"]
+},
+
+{"description": "html start-tag followed by space character",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["Characters", " foo"]],
+ "expected": ["<html> foo"]
+},
+
+{"description": "html start-tag followed by text",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["Characters", "foo"]],
+ "expected": ["foo"]
+},
+
+{"description": "html start-tag followed by start-tag",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]],
+ "expected": ["<foo>"]
+},
+
+{"description": "html start-tag followed by end-tag",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]],
+ "expected": ["</foo>"]
+},
+
+{"description": "html start-tag at EOF (shouldn't ever happen?!)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}]],
+ "expected": [""]
+},
+
+
+
+{"description": "html end-tag followed by comment",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["Comment", "foo"]],
+ "expected": ["</html><!--foo-->"]
+},
+
+{"description": "html end-tag followed by space character",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["Characters", " foo"]],
+ "expected": ["</html> foo"]
+},
+
+{"description": "html end-tag followed by text",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["Characters", "foo"]],
+ "expected": ["foo"]
+},
+
+{"description": "html end-tag followed by start-tag",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]],
+ "expected": ["<foo>"]
+},
+
+{"description": "html end-tag followed by end-tag",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]],
+ "expected": ["</foo>"]
+},
+
+{"description": "html end-tag at EOF",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"]],
+ "expected": [""]
+},
+
+
+
+
+{"description": "head start-tag followed by comment",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["Comment", "foo"]],
+ "expected": ["<head><!--foo-->"]
+},
+
+{"description": "head start-tag followed by space character",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["Characters", " foo"]],
+ "expected": ["<head> foo"]
+},
+
+{"description": "head start-tag followed by text",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["Characters", "foo"]],
+ "expected": ["<head>foo"]
+},
+
+{"description": "head start-tag followed by start-tag",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]],
+ "expected": ["<foo>"]
+},
+
+{"description": "head start-tag followed by end-tag (shouldn't ever happen?!)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]],
+ "expected": ["<head></foo>", "</foo>"]
+},
+
+{"description": "empty head element",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": [""]
+},
+
+{"description": "head start-tag followed by empty-tag",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag", "foo", {}]],
+ "expected": ["<foo>"]
+},
+
+{"description": "head start-tag at EOF (shouldn't ever happen?!)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}]],
+ "expected": ["<head>", ""]
+},
+
+
+
+{"description": "head end-tag followed by comment",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["Comment", "foo"]],
+ "expected": ["</head><!--foo-->"]
+},
+
+{"description": "head end-tag followed by space character",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["Characters", " foo"]],
+ "expected": ["</head> foo"]
+},
+
+{"description": "head end-tag followed by text",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["Characters", "foo"]],
+ "expected": ["foo"]
+},
+
+{"description": "head end-tag followed by start-tag",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]],
+ "expected": ["<foo>"]
+},
+
+{"description": "head end-tag followed by end-tag",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]],
+ "expected": ["</foo>"]
+},
+
+{"description": "head end-tag at EOF",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"]],
+ "expected": [""]
+},
+
+
+
+
+{"description": "body start-tag followed by comment",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["Comment", "foo"]],
+ "expected": ["<body><!--foo-->"]
+},
+
+{"description": "body start-tag followed by space character",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["Characters", " foo"]],
+ "expected": ["<body> foo"]
+},
+
+{"description": "body start-tag followed by text",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["Characters", "foo"]],
+ "expected": ["foo"]
+},
+
+{"description": "body start-tag followed by start-tag",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]],
+ "expected": ["<foo>"]
+},
+
+{"description": "body start-tag followed by end-tag",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]],
+ "expected": ["</foo>"]
+},
+
+{"description": "body start-tag at EOF (shouldn't ever happen?!)",
+ "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}]],
+ "expected": [""]
+},
+
+
+
+{"description": "body end-tag followed by comment",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["Comment", "foo"]],
+ "expected": ["</body><!--foo-->"]
+},
+
+{"description": "body end-tag followed by space character",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["Characters", " foo"]],
+ "expected": ["</body> foo"]
+},
+
+{"description": "body end-tag followed by text",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["Characters", "foo"]],
+ "expected": ["foo"]
+},
+
+{"description": "body end-tag followed by start-tag",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]],
+ "expected": ["<foo>"]
+},
+
+{"description": "body end-tag followed by end-tag",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]],
+ "expected": ["</foo>"]
+},
+
+{"description": "body end-tag at EOF",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"]],
+ "expected": [""]
+},
+
+
+
+
+{"description": "li end-tag followed by comment",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["Comment", "foo"]],
+ "expected": ["</li><!--foo-->"]
+},
+
+{"description": "li end-tag followed by space character",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["Characters", " foo"]],
+ "expected": ["</li> foo"]
+},
+
+{"description": "li end-tag followed by text",
+ "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["Characters", "foo"]],
+ "expected": ["</li>foo"]
+},
+
+{"description": "li end-tag followed by start-tag",