testText("
", "abc\ndef", "abcdef", "Newlines convert to in element"); testHTML("", "abc\ndef", "abcdef", "Newlines convert to in element"); testHTML("", "abc\ndef", "abcdef", "Newlines convert to in white-space:pre element"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in non-white-space:pre elements"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in element"); testHTML("", "abc\r\ndef", "abcdef", "Newline/CR pair converts to in non-white-space:pre element"); testHTML("", "abc\n\ndef", "abcdef", "Newline/newline pair converts to two s in non-white-space:pre element"); testHTML("", "abc\r\rdef", "abcdef", "CR/CR pair converts to two s in non-white-space:pre element"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in white-space:pre element"); testText("", "abc", "abc>def", "abc>def", "> preserved"); testText("", "abc&", "abc&", "& preserved"); testText("", "abc\"def", "abc\"def", "\" preserved"); testText("", "abc\'def", "abc\'def", "\' preserved"); testHTML("", "abc", "", "innerText not supported on SVG elements"); testHTML("", "abc", "", "innerText not supported on MathML elements"); testText("", "abc\0def", "abc\0def", "Null characters preserved"); testText("", "abc\tdef", "abc\tdef", "Tabs preserved"); testText("", " abc", " abc", "Leading whitespace preserved"); testText("", "abc ", "abc ", "Trailing whitespace preserved"); testText("", "abc def", "abc def", "Whitespace not compressed"); testText("abc\n\n", "abc", "abc", "Existing text deleted"); testText("", "abc", "abc", "Existing deleted"); testHTML("", "", "", "Assigning the empty string"); testHTML("", null, "", "Assigning null"); testHTML("", undefined, "undefined", "Assigning undefined"); testHTML("", "\rabc", "abc", "Start with CR"); testHTML("", "\nabc", "abc", "Start with LF"); testHTML("", "\r\nabc", "abc", "Start with CRLF"); testHTML("", "abc\r", "abc", "End with CR"); testHTML("", "abc\n", "abc", "End with LF"); testHTML("", "abc\r\n", "abc", "End with CRLF"); // Setting innerText on these should not throw ["area", "base", "basefont", "bgsound", "br", "col", "embed", "frame", "hr", "image", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr", "colgroup", "frameset", "head", "html", "table", "tbody", "tfoot", "thead", "tr"].forEach(function(tag) { testText(document.createElement(tag), "abc", "abc", "innerText on <" + tag + "> element"); });
element"); testHTML("", "abc\ndef", "abcdef", "Newlines convert to in element"); testHTML("", "abc\ndef", "abcdef", "Newlines convert to in white-space:pre element"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in non-white-space:pre elements"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in element"); testHTML("", "abc\r\ndef", "abcdef", "Newline/CR pair converts to in non-white-space:pre element"); testHTML("", "abc\n\ndef", "abcdef", "Newline/newline pair converts to two s in non-white-space:pre element"); testHTML("", "abc\r\rdef", "abcdef", "CR/CR pair converts to two s in non-white-space:pre element"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in white-space:pre element"); testText("", "abc", "abc>def", "abc>def", "> preserved"); testText("", "abc&", "abc&", "& preserved"); testText("", "abc\"def", "abc\"def", "\" preserved"); testText("", "abc\'def", "abc\'def", "\' preserved"); testHTML("", "abc", "", "innerText not supported on SVG elements"); testHTML("", "abc", "", "innerText not supported on MathML elements"); testText("", "abc\0def", "abc\0def", "Null characters preserved"); testText("", "abc\tdef", "abc\tdef", "Tabs preserved"); testText("", " abc", " abc", "Leading whitespace preserved"); testText("", "abc ", "abc ", "Trailing whitespace preserved"); testText("", "abc def", "abc def", "Whitespace not compressed"); testText("abc\n\n", "abc", "abc", "Existing text deleted"); testText("", "abc", "abc", "Existing deleted"); testHTML("", "", "", "Assigning the empty string"); testHTML("", null, "", "Assigning null"); testHTML("", undefined, "undefined", "Assigning undefined"); testHTML("", "\rabc", "abc", "Start with CR"); testHTML("", "\nabc", "abc", "Start with LF"); testHTML("", "\r\nabc", "abc", "Start with CRLF"); testHTML("", "abc\r", "abc", "End with CR"); testHTML("", "abc\n", "abc", "End with LF"); testHTML("", "abc\r\n", "abc", "End with CRLF"); // Setting innerText on these should not throw ["area", "base", "basefont", "bgsound", "br", "col", "embed", "frame", "hr", "image", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr", "colgroup", "frameset", "head", "html", "table", "tbody", "tfoot", "thead", "tr"].forEach(function(tag) { testText(document.createElement(tag), "abc", "abc", "innerText on <" + tag + "> element"); });
", "abc\rdef", "abcdef", "CRs convert to in element"); testHTML("", "abc\r\ndef", "abcdef", "Newline/CR pair converts to in non-white-space:pre element"); testHTML("", "abc\n\ndef", "abcdef", "Newline/newline pair converts to two s in non-white-space:pre element"); testHTML("", "abc\r\rdef", "abcdef", "CR/CR pair converts to two s in non-white-space:pre element"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in white-space:pre element"); testText("", "abc", "abc>def", "abc>def", "> preserved"); testText("", "abc&", "abc&", "& preserved"); testText("", "abc\"def", "abc\"def", "\" preserved"); testText("", "abc\'def", "abc\'def", "\' preserved"); testHTML("", "abc", "", "innerText not supported on SVG elements"); testHTML("", "abc", "", "innerText not supported on MathML elements"); testText("", "abc\0def", "abc\0def", "Null characters preserved"); testText("", "abc\tdef", "abc\tdef", "Tabs preserved"); testText("", " abc", " abc", "Leading whitespace preserved"); testText("", "abc ", "abc ", "Trailing whitespace preserved"); testText("", "abc def", "abc def", "Whitespace not compressed"); testText("abc\n\n", "abc", "abc", "Existing text deleted"); testText("", "abc", "abc", "Existing deleted"); testHTML("", "", "", "Assigning the empty string"); testHTML("", null, "", "Assigning null"); testHTML("", undefined, "undefined", "Assigning undefined"); testHTML("", "\rabc", "abc", "Start with CR"); testHTML("", "\nabc", "abc", "Start with LF"); testHTML("", "\r\nabc", "abc", "Start with CRLF"); testHTML("", "abc\r", "abc", "End with CR"); testHTML("", "abc\n", "abc", "End with LF"); testHTML("", "abc\r\n", "abc", "End with CRLF"); // Setting innerText on these should not throw ["area", "base", "basefont", "bgsound", "br", "col", "embed", "frame", "hr", "image", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr", "colgroup", "frameset", "head", "html", "table", "tbody", "tfoot", "thead", "tr"].forEach(function(tag) { testText(document.createElement(tag), "abc", "abc", "innerText on <" + tag + "> element"); });
element"); testHTML("", "abc\r\ndef", "abcdef", "Newline/CR pair converts to in non-white-space:pre element"); testHTML("", "abc\n\ndef", "abcdef", "Newline/newline pair converts to two s in non-white-space:pre element"); testHTML("", "abc\r\rdef", "abcdef", "CR/CR pair converts to two s in non-white-space:pre element"); testHTML("", "abc\rdef", "abcdef", "CRs convert to in white-space:pre element"); testText("", "abc", "abc>def", "abc>def", "> preserved"); testText("", "abc&", "abc&", "& preserved"); testText("", "abc\"def", "abc\"def", "\" preserved"); testText("", "abc\'def", "abc\'def", "\' preserved"); testHTML("", "abc", "", "innerText not supported on SVG elements"); testHTML("", "abc", "", "innerText not supported on MathML elements"); testText("", "abc\0def", "abc\0def", "Null characters preserved"); testText("", "abc\tdef", "abc\tdef", "Tabs preserved"); testText("", " abc", " abc", "Leading whitespace preserved"); testText("", "abc ", "abc ", "Trailing whitespace preserved"); testText("", "abc def", "abc def", "Whitespace not compressed"); testText("abc\n\n", "abc", "abc", "Existing text deleted"); testText("", "abc", "abc", "Existing deleted"); testHTML("", "", "", "Assigning the empty string"); testHTML("", null, "", "Assigning null"); testHTML("", undefined, "undefined", "Assigning undefined"); testHTML("", "\rabc", "abc", "Start with CR"); testHTML("", "\nabc", "abc", "Start with LF"); testHTML("", "\r\nabc", "abc", "Start with CRLF"); testHTML("", "abc\r", "abc", "End with CR"); testHTML("", "abc\n", "abc", "End with LF"); testHTML("", "abc\r\n", "abc", "End with CRLF"); // Setting innerText on these should not throw ["area", "base", "basefont", "bgsound", "br", "col", "embed", "frame", "hr", "image", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr", "colgroup", "frameset", "head", "html", "table", "tbody", "tfoot", "thead", "tr"].forEach(function(tag) { testText(document.createElement(tag), "abc", "abc", "innerText on <" + tag + "> element"); });